16 private string _servicePack;
18 private string _versionString;
30 if (_servicePack ==
null)
48 if (_versionString !=
null)
50 return _versionString;
56 str =
"Microsoft Windows NT ";
59 str = ((_version.Major <= 4 && (_version.Major != 4 || _version.Minor <= 0)) ?
"Microsoft Windows 95 " :
"Microsoft Windows 98 ");
62 str =
"Microsoft Win32S ";
65 str =
"Microsoft Windows CE ";
74 if (
string.IsNullOrEmpty(_servicePack))
76 _versionString = str + _version.ToString();
80 _versionString = str + _version.ToString(3) +
" " + _servicePack;
82 return _versionString;
98 : this(platform, version, null)
104 if (platform < PlatformID.Win32S || platform >
PlatformID.MacOSX)
108 if ((
object)version ==
null)
110 throw new ArgumentNullException(
"version");
112 _platform = platform;
114 _servicePack = servicePack;
122 switch (enumerator.
Name)
131 _servicePack = info.GetString(
"_servicePack");
135 if (_version ==
null)
153 info.AddValue(
"_version", _version);
154 info.AddValue(
"_platform", _platform);
155 info.AddValue(
"_servicePack", _servicePack);
PlatformID
Identifies the operating system, or platform, supported by an assembly.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
override string ToString()
Converts the value of this T:System.OperatingSystem object to its equivalent string representation.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Version Version
Gets a T:System.Version object that identifies the operating system.
PlatformID Platform
Gets a T:System.PlatformID enumeration value that identifies the operating system platform.
Provides information about, and means to manipulate, the current environment and platform....
string? VersionString
Gets the concatenated string representation of the platform identifier, version, and service pack tha...
void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a T:System.Runtime.Serialization.SerializationInfo object with the data necessary to deseri...
OperatingSystem(PlatformID platform, Version version)
Initializes a new instance of the T:System.OperatingSystem class, using the specified platform identi...
Supports cloning, which creates a new instance of a class with the same value as an existing instance...
object Clone()
Creates an T:System.OperatingSystem object that is identical to this instance.
Represents the version number of an assembly, operating system, or the common language runtime....
The exception thrown when an error occurs during serialization or deserialization.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
Represents information about an operating system, such as the version and platform identifier....
The exception that is thrown when one of the arguments provided to a method is not valid.
Allows an object to control its own serialization and deserialization.
Specifies that the class can be serialized.
string Name
Gets the name for the item currently being examined.
string ServicePack
Gets the service pack version represented by this T:System.OperatingSystem object.
object Clone()
Returns a new T:System.Version object whose value is the same as the current T:System....
Provides a formatter-friendly mechanism for parsing the data in T:System.Runtime.Serialization....
bool MoveNext()
Updates the enumerator to the next item.