My.Computer.Info.OSPlatform 属性

更新:2007 年 11 月

获取计算机操作系统的平台标识符。

' Usage
Dim value As String = My.Computer.Info.OSPlatform
' Declaration
Public ReadOnly Property OSPlatform As String

返回值

包含计算机操作系统平台标识符的 String,从 PlatformID 枚举的成员名称中选择。

异常

下面的情况可能会导致异常:

备注

My.Computer.Info.OSPlatform 属性提供的功能与 OSVersion 属性所返回对象的 Platform 属性类似。

示例

此示例使用 My.Computer.Info.OSPlatform 属性来显示计算机操作系统的平台。

MsgBox("Computer's operating system platform: " & _
    My.Computer.Info.OSPlatform)

要求

命名空间:Microsoft.VisualBasic.Devices

类:ComputerInfo

**程序集:**Visual Basic 运行库(位于 Microsoft.VisualBasic.dll 中)

按项目类型列出的可用性

项目类型

可用

Windows 应用程序

类库

控制台应用程序

Windows 控件库

Web 控件库

Windows 服务

网站

权限

不需要任何权限。

请参见

参考

My.Computer.Info 对象

Platform

OSVersion

ComputerInfo.OSPlatform