RuntimeEnvironment.GetRuntimeDirectory Method ()

 

Returns the directory where the common language runtime is installed.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

public static string GetRuntimeDirectory()

Return Value

Type: System.String

A string that contains the path to the directory where the common language runtime is installed.

The following example demonstrates calling the GetRuntimeDirectory method. This 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());

FileIOPermission

for accessing files and folders. Associated enumeration: FileIOPermissionAccess.PathDiscovery

.NET Framework
Available since 1.1
Return to top
Show: