RuntimeEnvironment.GetRuntimeDirectory 方法

定義

傳回安裝 Common Language Runtime 所在的目錄。Returns the directory where the common language runtime is installed.

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

傳回

String

含有安裝 Common Language Runtime 所在之目錄路徑的字串。A string that contains the path to the directory where the common language runtime is installed.

範例

下列程式碼範例示範如何呼叫 GetRuntimeDirectory 方法。The following example demonstrates calling the GetRuntimeDirectory method. 這個程式碼範例是針對類別提供之較大範例的一部分 RuntimeEnvironmentThis code example is part of a larger example provided for the RuntimeEnvironment class.

// 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())

適用於