Environment.SystemDirectory Property

Gets the fully qualified path of the system directory.

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

public static string SystemDirectory { get; }
/** @property */
public static String get_SystemDirectory ()

public static function get SystemDirectory () : String

Not applicable.

Property Value

A string containing a directory path.

An example of the value returned is the string "C:\WinNT\System32".

The following code example displays the system directory of the computer running the code example. (The system directory is omitted from the code example output for security reasons.)

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

import System.*;

class Sample
{
    public static void main(String[] args)
    {
        Console.WriteLine();
        //  <-- Keep this information secure! -->
        Console.WriteLine("SystemDirectory: {0}", 
            Environment.get_SystemDirectory());
    } //main
} //Sample

/*
This example produces the following results:

SystemDirectory: C:\WINDOWS\System32
*/

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: