Environment.SystemDirectory Egenskap

Definition

Hämtar den fullständigt kvalificerade sökvägen för systemkatalogen.

public:
 static property System::String ^ SystemDirectory { System::String ^ get(); };
public static string SystemDirectory { get; }
static member SystemDirectory : string
Public Shared ReadOnly Property SystemDirectory As String

Egenskapsvärde

En sträng som innehåller en katalogsökväg.

Exempel

I följande exempel visas systemkatalogen för den dator som kör kodexemplet. (Systemkatalogen utelämnas från exempelutdata av säkerhetsskäl.)

// Sample for the Environment.SystemDirectory property
using System;

class Sample
{
    public static void Main()
    {
    Console.WriteLine();
//  <-- Keep this information secure! -->
    Console.WriteLine("SystemDirectory: {0}", Environment.SystemDirectory);
    }
}
/*
This example produces the following results:

SystemDirectory: C:\WINNT\System32
*/
// Sample for the Environment.SystemDirectory property
open System

//  <-- Keep this information secure! -->
printfn $"\nSystemDirectory: {Environment.SystemDirectory}"

// This example produces the following results:
//     SystemDirectory: C:\WINNT\System32
' Sample for the Environment.SystemDirectory property
Class Sample
   Public Shared Sub Main()
      Console.WriteLine()
      '  <-- Keep this information secure! -->
      Console.WriteLine("SystemDirectory: {0}", Environment.SystemDirectory)
   End Sub
End Class
'
'This example produces the following results:
'
'SystemDirectory: C:\WINNT\System32
'

Kommentarer

Ett exempel på det returnerade värdet är strängen "C:\WINDOWS\System32".

Gäller för