Share via


ComputerInfo.OSPlatform 属性

定义

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

public:
 property System::String ^ OSPlatform { System::String ^ get(); };
public string OSPlatform { get; }
member this.OSPlatform : string
Public ReadOnly Property OSPlatform As String

属性值

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

例外

应用程序无法获取操作系统平台信息。

示例

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

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

注解

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

适用于

另请参阅