Environment.SystemDirectory 属性

获取系统目录的完全限定路径。

**命名空间:**System
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
Public Shared ReadOnly Property SystemDirectory As String
用法
Dim value As String

value = Environment.SystemDirectory
public static string SystemDirectory { get; }
public:
static property String^ SystemDirectory {
    String^ get ();
}
/** @property */
public static String get_SystemDirectory ()
public static function get SystemDirectory () : String

属性值

包含目录路径的字符串。

备注

例如,返回值为字符串“C:\WinNT\System32”。

示例

下面的代码示例显示运行代码示例的计算机的系统目录。(出于安全原因,代码示例输出中省略了系统目录。)

' Sample for the Environment.SystemDirectory property
Imports System

Class Sample
   Public Shared Sub Main()
      Console.WriteLine()
      '  <-- Keep this information secure! -->
      Console.WriteLine("SystemDirectory: {0}", Environment.SystemDirectory)
   End Sub 'Main
End Class 'Sample
'
'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
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

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

.NET Framework 安全性

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

Environment 类
Environment 成员
System 命名空间