当前位置: 首页>>代码示例>>C#>>正文


C# ManagementObject.TryGet方法代码示例

本文整理汇总了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");
		}
开发者ID:cssack,项目名称:CsGlobals,代码行数:9,代码来源:PrinterDevice.cs

示例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");
		}
开发者ID:cssack,项目名称:CsGlobals,代码行数:11,代码来源:MemoryDevice.cs

示例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");
		}
开发者ID:cssack,项目名称:CsGlobals,代码行数:22,代码来源:GraphicDevice.cs

示例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");
		}
开发者ID:cssack,项目名称:CsGlobals,代码行数:16,代码来源:DiskDriveDevice.cs

示例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;
		}
开发者ID:cssack,项目名称:CsGlobals,代码行数:14,代码来源:CsgOsUser.cs

示例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");
		}
开发者ID:cssack,项目名称:CsGlobals,代码行数:11,代码来源:DiskDrivePartition.cs

示例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");
		}
开发者ID:cssack,项目名称:CsGlobals,代码行数:17,代码来源:NetworkDevice.cs

示例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");
		}
开发者ID:cssack,项目名称:CsGlobals,代码行数:10,代码来源:LogicalDisk.cs


注:本文中的System.Management.ManagementObject.TryGet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。