RuntimeEnvironment.GetRuntimeDirectory 方法

定义

返回公共语言运行时的安装目录。

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

返回

包含语言运行时安装目录的路径的字符串。

示例

下面的示例演示如何调用 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())

适用于