IWMSServer.CPUUtilization (C#)

banner art

Previous Next

IWMSServer.CPUUtilization (C#)

The CPUUtilization property retrieves the CPU utilization of the computer on which the server is running.

Syntax

  int = IWMSServer.CPUUtilization;

Property Value

int containing the percentage of CPU utilization.

Remarks

The parameter is returned as a percentage (0 to 100).

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;









    // Retrieve a value indicating the current CPU
    // load on the server.
    iValue = Server.CPUUtilization;
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next