Partager via


DevicePropertyFactory.CreateOperatingSystemProperty Method (String, Int32, SystemType)

 

Create an OperatingSystemProperty object that contains information about the operating system of a device.

Namespace:   Microsoft.WindowsServerSolutions.Common.Devices
Assembly:  DevicesOM (in DevicesOM.dll)

Syntax

public static OperatingSystemProperty CreateOperatingSystemProperty(
    string os,
    int spMajor,
    SystemType type
)
public:
static OperatingSystemProperty^ CreateOperatingSystemProperty(
    String^ os,
    int spMajor,
    SystemType type
)
Public Shared Function CreateOperatingSystemProperty (
    os As String,
    spMajor As Integer,
    type As SystemType
) As OperatingSystemProperty

Parameters

  • os
    Type: System.String

    The name of the operating system that is running on the device.

  • spMajor
    Type: System.Int32

    The major service pack version of the operating system.

Return Value

Type: Microsoft.WindowsServerSolutions.Common.Devices.OperatingSystemProperty

An instance of OperatingSystemProperty.

Examples

The following code example shows how to create an OperatingSystemProperty object:

string os = "Windows Vista";
int spMajor = 2;
SystemType type = SystemType.AMD64;

OperatingSystemProperty operatingSystemProperty = 
   DevicePropertyFactory.CreateOperatingSystemProperty(os, spMajor, type);

Console.WriteLine("OS Name = {0}", operatingSystemProperty.OSName);
Console.WriteLine("Service Pack Major Version = {0}",
   operatingSystemProperty.ServicePackMajorVersion);
Console.WriteLine("System Type = {0}", 
   operatingSystemProperty.SystemType);

// expected output:
// OS Name = Windows Vista
// Service Pack Major Version = 2
// System Type = AMD64

See Also

CreateOperatingSystemProperty Overload
DevicePropertyFactory Class
Microsoft.WindowsServerSolutions.Common.Devices Namespace

Return to top