更新:2007 年 11 月
获取计算机上可用的虚拟地址空间总数。
' Usage
Dim value As ULong = My.Computer.Info.TotalVirtualMemory
' Declaration
Public ReadOnly Property TotalVirtualMemory As ULong
返回值
包含计算机上可用的虚拟地址空间字节数的 ULong。
异常
下面的情况可能会导致异常:
- 应用程序无法获取内存状态 (Win32Exception)。
备注
My.Computer.Info.TotalVirtualMemory 属性要求使用 Windows XP、Windows 2000 Professional、Windows Server 2003 或 Windows 2000 Server。
示例
此示例使用 My.Computer.Info.TotalVirtualMemory 属性显示运行代码的计算机中的虚拟内存总数。
MsgBox("Computer's available virtual memory: " & _
My.Computer.Info.TotalVirtualMemory)
要求
命名空间:Microsoft.VisualBasic.Devices
**程序集:**Visual Basic 运行库(位于 Microsoft.VisualBasic.dll 中)
不同项目类型的可用性
项目类型 |
是否可用 |
---|---|
Windows 应用程序 |
是 |
类库 |
是 |
控制台应用程序 |
是 |
Windows 控件库 |
是 |
Web 控件库 |
是 |
Windows 服务 |
是 |
网站 |
是 |
权限
不需要任何权限。
请参见
参考
My.Computer.Info.AvailableVirtualMemory 属性