语言

OperatingSystem(PlatformID, Version) 构造函数

定义

使用指定的平台标识符值和版本对象初始化类的新实例 OperatingSystem 。

public:
 OperatingSystem(PlatformID platform, Version ^ version);
public OperatingSystem(PlatformID platform, Version version);
new OperatingSystem : PlatformID * Version -> OperatingSystem
Public Sub New (platform As PlatformID, version As Version)

参数

platform
PlatformID

指示操作系统平台的值之 PlatformID 一。

version
Version

一个 Version 对象,指示操作系统的版本。

例外

version 是 null。

platform 不是 PlatformID 枚举值。

调用方说明

如果使用 OperatingSystem 类来检索有关运行时操作系统的信息,则不应调用此构造函数来实例化对象 OperatingSystem 。 相反,可以从属性中检索 OperatingSystem 描述操作系统 OSVersion 的对象。

适用于