RuntimeEnvironment.GetRuntimeDirectory 方法

定義

傳回安裝 Common Language Runtime 所在的目錄。

public:
 static System::String ^ GetRuntimeDirectory();
public static string GetRuntimeDirectory ();
static member GetRuntimeDirectory : unit -> string
Public Shared Function GetRuntimeDirectory () As String

傳回

含有安裝 Common Language Runtime 所在之目錄路徑的字串。

範例

下列程式碼範例示範如何呼叫 GetRuntimeDirectory 方法。 此程式代碼範例是提供給 類別之較大範例的 RuntimeEnvironment 一部分。

// Show the path where the CLR was loaded from.
Console::WriteLine("Runtime directory: {0}",
    RuntimeEnvironment::GetRuntimeDirectory());
// Show the path where the CLR was loaded from.
Console.WriteLine("Runtime directory: {0}", RuntimeEnvironment.GetRuntimeDirectory());
' Show the path where the CLR was loaded from.
Console.WriteLine("Runtime directory: {0}", RuntimeEnvironment.GetRuntimeDirectory())

適用於