Environment.SystemDirectory Propriété

Définition

Obtient le chemin qualifié complet du répertoire du système.

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

Valeur de propriété

Chaîne contenant un chemin d'accès au répertoire.

Exemples

L’exemple suivant affiche le répertoire système de l’ordinateur qui exécute l’exemple de code. (Le répertoire système est omis de l’exemple de sortie pour des raisons de sécurité.)

// Sample for the Environment::SystemDirectory property
using namespace System;
int 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
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
'

Remarques

La chaîne « C:\WINDOWS\System32 » est un exemple de valeur retournée.

S’applique à