My.Computer.Info.OSPlatform 属性
更新:2007 年 11 月
获取计算机操作系统的平台标识符。
' Usage
Dim value As String = My.Computer.Info.OSPlatform
' Declaration
Public ReadOnly Property OSPlatform As String
返回值
包含计算机操作系统平台标识符的 String,从 PlatformID 枚举的成员名称中选择。
异常
下面的情况可能会导致异常:
- 应用程序无法获取操作系统平台信息 (ExecutionEngineException)。
备注
My.Computer.Info.OSPlatform 属性提供的功能与 OSVersion 属性所返回对象的 Platform 属性类似。
示例
此示例使用 My.Computer.Info.OSPlatform 属性来显示计算机操作系统的平台。
MsgBox("Computer's operating system platform: " & _
My.Computer.Info.OSPlatform)
要求
命名空间:Microsoft.VisualBasic.Devices
**程序集:**Visual Basic 运行库(位于 Microsoft.VisualBasic.dll 中)
按项目类型列出的可用性
项目类型 |
可用 |
---|---|
Windows 应用程序 |
是 |
类库 |
是 |
控制台应用程序 |
是 |
Windows 控件库 |
是 |
Web 控件库 |
是 |
Windows 服务 |
是 |
网站 |
是 |
权限
不需要任何权限。