Environment.WorkingSet 属性

获取映射到进程上下文的物理内存量。

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

语法

声明
Public Shared ReadOnly Property WorkingSet As Long
用法
Dim value As Long

value = Environment.WorkingSet
public static long WorkingSet { get; }
public:
static property long long WorkingSet {
    long long get ();
}
/** @property */
public static long get_WorkingSet ()
public static function get WorkingSet () : long

属性值

一个 64 位有符号整数,包含映射到进程上下文的物理内存字节的数目。

备注

Windows 98, Windows Millennium Edition 平台说明: 该属性总是返回零。

示例

下面的代码示例显示运行代码示例的计算机的工作集大小。

' Sample for the Environment.WorkingSet property
Imports System

Class Sample
   Public Shared Sub Main()
      Console.WriteLine("WorkingSet: {0}", Environment.WorkingSet)
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'
'WorkingSet: 5038080
'
// Sample for the Environment.WorkingSet property
using System;

class Sample 
{
    public static void Main() 
    {
    Console.WriteLine("WorkingSet: {0}", Environment.WorkingSet);
    }
}
/*
This example produces the following results:

WorkingSet: 5038080
*/
// Sample for the Environment::WorkingSet property
using namespace System;
int main()
{
   Console::WriteLine( "WorkingSet: {0}", Environment::WorkingSet );
}

/*
This example produces the following results:

WorkingSet: 5038080
*/
// Sample for the Environment.WorkingSet property
import System.*;

class Sample
{
    public static void main(String[] args)
    {
        Console.WriteLine("WorkingSet: {0}", 
            System.Convert.ToString(Environment.get_WorkingSet()));
    } //main
} //Sample

/*
This example produces the following results:

WorkingSet: 5038080
*/

.NET Framework 安全性

平台

Windows 98、Windows 2000 SP4、Windows CE、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 命名空间