本文整理汇总了C#中System.Management.ManagementObject.TryGet方法的典型用法代码示例。如果您正苦于以下问题:C# ManagementObject.TryGet方法的具体用法?C# ManagementObject.TryGet怎么用?C# ManagementObject.TryGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Management.ManagementObject
的用法示例。
在下文中一共展示了ManagementObject.TryGet方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
internal void Load(ManagementObject mo)
{
Name = mo.TryGet<string>("Name");
DriverName = mo.TryGet<string>("DriverName");
Comment = mo.TryGet<string>("Comment");
Default = mo.TryGet<bool>("Default");
ExtendedPrinterStatus = mo.TryGet<CsiPrinterExtendedStates>("ExtendedPrinterStatus");
PrinterStatus = mo.TryGet<CsiPrinterStates>("PrinterStatus");
}
示例2: Load
internal void Load(ManagementObject o)
{
Tag = o.TryGet<string>("Tag");
BankLabel = o.TryGet<string>("BankLabel");
Capacity = o.TryGet<ulong>("Capacity");
ConfiguredClockSpeed = o.TryGet<uint>("ConfiguredClockSpeed");
DeviceLocator = o.TryGet<string>("DeviceLocator");
Manufacturer = o.TryGet<string>("Manufacturer");
MemoryType = (CsiMemoryTypes) o.TryGet<ushort>("MemoryType");
Speed = o.TryGet<uint>("Speed");
}
示例3: Load
internal void Load(ManagementObject o)
{
DeviceId = o.TryGet<string>("DeviceID");
AdapterRam = o.TryGet<uint>("AdapterRAM");
Caption = o.TryGet<string>("Caption");
Description = o.TryGet<string>("Description");
CurrentBitsPerPixel = o.TryGet<uint>("CurrentBitsPerPixel");
CurrentHorizontalResolution = o.TryGet<uint>("CurrentHorizontalResolution");
CurrentVerticalResolution = o.TryGet<uint>("CurrentVerticalResolution");
CurrentNumberOfColors = o.TryGet<ulong>("CurrentNumberOfColors");
CurrentRefreshRate = o.TryGet<uint>("CurrentRefreshRate");
CurrentScanMode = (CsiVideoControllerScanModes) o.TryGet<ushort>("CurrentScanMode");
DriverDate = o.TryGet<DateTime>("DriverDate");
DriverVersion = o.TryGet<string>("DriverVersion");
MaxRefreshRate = o.TryGet<uint>("MaxRefreshRate");
MinRefreshRate = o.TryGet<uint>("MinRefreshRate");
Name = o.TryGet<string>("Name");
VideoArchitecture = (CsiVideoControllerArchitectures) o.TryGet<ushort>("VideoArchitecture");
VideoMemoryType = (CsiVideoControllerMemoryTypes) o.TryGet<ushort>("VideoMemoryType");
VideoModeDescription = o.TryGet<string>("VideoModeDescription");
VideoProcessor = o.TryGet<string>("VideoProcessor");
}
示例4: Load
internal void Load(ManagementObject mo)
{
DeviceId = mo.TryGet<string>("DeviceID");
Index = mo.TryGet<UInt32>("Index");
InterfaceType = mo.TryGet<string>("InterfaceType");
Manufacturer = mo.TryGet<string>("Manufacturer");
Model = mo.TryGet<string>("Model");
FirmwareRevision = mo.TryGet<string>("FirmwareRevision");
Capabilitys = mo.TryGet<string[]>("CapabilityDescriptions");
MediaLoaded = mo.TryGet<bool>("MediaLoaded");
MediaType = mo.TryGet<string>("MediaType");
PartitionCount = mo.TryGet<UInt32>("Partitions");
SerialNumber = mo.TryGet<string>("SerialNumber");
Size = mo.TryGet<UInt64>("Size");
Status = mo.TryGet<string>("Status");
}
示例5: FromManagementObject
internal static CsgOsUser FromManagementObject(ManagementObject o)
{
var usr = new CsgOsUser();
usr.IsLocalAccount = o.TryGet<bool>("LocalAccount");
usr.Status = o.TryGet<string>("Status");
usr.Name = o.TryGet<string>("Name");
usr.FullName = o.TryGet<string>("FullName");
usr.Description = o.TryGet<string>("Description");
usr.Domain = o.TryGet<string>("Domain");
usr.AccountType = o.TryGet<UInt32>("AccountType");
usr.SidType = (CsiUserSidTypes) o.TryGet<byte>("SIDType");
usr.Sid = o.TryGet<string>("SID");
return usr;
}
示例6: Load
internal void Load(ManagementObject mo)
{
DeviceId = mo.TryGet<string>("DeviceID");
DiskIndex = mo.TryGet<UInt32>("DiskIndex");
Bootable = mo.TryGet<bool>("Bootable");
BootPartition = mo.TryGet<bool>("BootPartition");
PrimaryPartition = mo.TryGet<bool>("PrimaryPartition");
Description = mo.TryGet<string>("Description");
Type = mo.TryGet<string>("Type");
Size = mo.TryGet<UInt64>("Size");
}
示例7: Load
internal void Load(ManagementObject mo)
{
DeviceId = mo.TryGet<string>("DeviceID");
IanaType = (CsiNetworkAdapterIanaTypes) mo.TryGet<uint>("InterfaceType");
InterfaceIndex = mo.TryGet<uint>("InterfaceIndex");
PermanentAddress = mo.TryGet<string>("PermanentAddress");
Name = mo.TryGet<string>("Name");
ActiveMaximumTransmissionUnit = mo.TryGet<ulong>("ActiveMaximumTransmissionUnit");
Speed = mo.TryGet<ulong>("Speed");
DriverDate = mo.TryGet<string>("DriverDate");
DriverVersion = mo.TryGet<string>("DriverVersionString");
DriverProvider = mo.TryGet<string>("DriverProvider");
DriverDescription = mo.TryGet<string>("DriverDescription");
FullDuplex = mo.TryGet<bool>("FullDuplex");
OperationalStatus = (CsiNetworkAdapterOperationalStates) mo.TryGet<uint>("InterfaceOperationalStatus");
WdmInterface = mo.TryGet<bool>("WdmInterface");
}
示例8: Load
internal void Load(ManagementObject mo)
{
DeviceId = mo.TryGet<string>("DeviceID");
DriveType = (CsiLogicalDiskTypes) mo.TryGet<uint>("DriveType");
FileSystem = mo.TryGet<string>("FileSystem");
Size = mo.TryGet<UInt64>("Size");
FreeSpace = mo.TryGet<UInt64>("FreeSpace");
Name = mo.TryGet<string>("Name");
VolumeName = mo.TryGet<string>("VolumeName");
}