ReadOnlyDeviceInfoCollection.GetDeviceInfo Method (String)
Returns information about a specified device.
Namespace: Microsoft.WindowsServerSolutions.Common.Devices
Assembly: DevicesOM (in DevicesOM.dll)
Syntax
public DeviceInfo GetDeviceInfo(
string deviceId
)
public:
DeviceInfo^ GetDeviceInfo(
String^ deviceId
)
Public Function GetDeviceInfo (
deviceId As String
) As DeviceInfo
Parameters
deviceId
Type: System.StringThe identifier of the device to be queried.
Return Value
Type: Microsoft.WindowsServerSolutions.Common.Devices.DeviceInfo
An instance of DeviceInfo that contains information about the specified device.
Examples
The following code example shows how to retrieve information about a specified device.
DevicesManager dm = new DevicesManager();
dm.Connect();
// report a device
string deviceId = Guid.NewGuid().ToString();
Guid deviceType = DeviceTypes.Client;
string deviceName = "SDK Device";
DeviceIdentityStatus status = DeviceIdentityStatus.Active;
string additionalInfo = null;
dm.ReportDevice(deviceId, deviceType, deviceName, status, additionalInfo);
// retrieve information about the device
ReadOnlyDeviceInfoCollection devices = dm.GetAllDevicesInfo();
DeviceInfo device = devices.GetDeviceInfo(deviceId);
Console.WriteLine("Device Name = {0}", device.DeviceName);
// expected output
// Device Name = SDK Device
See Also
ReadOnlyDeviceInfoCollection Class
Microsoft.WindowsServerSolutions.Common.Devices Namespace
Return to top