Пример #1
0
        /// <summary>
        /// DeviceID from Caption
        /// </summary>
        /// <param name="caption">Caption of the Device</param>
        /// <returns>DeviceID</returns>
        public string GetDeviceIdFromCaption(string caption)
        {
            Wmi TWmi = new Wmi("Win32_DiskDrive", "WHERE Caption='" + caption + "'");

            return TWmi.GetInfo("DeviceID");
        }
Пример #2
0
 /// <summary>
 /// Short description of the object
 /// </summary>
 /// <param name="tag">Unique identifier for the physical memory device that is represented by an instance of Win32_PhysicalMemory. </param>
 /// <returns>Caption</returns>
 public string GetCaptionFromTag(string tag)
 {
     Wmi tmp = new Wmi("Win32_PhysicalMemory", "WHERE Tag='" + tag + "'");
     return tmp.GetInfo("Caption");
 }
Пример #3
0
        public string GetDeviceIdFromCaption(string caption)
        {
            Wmi TWmi = new Wmi("Win32_VideoController", "WHERE Caption='" + caption + "'");

            return TWmi.GetInfo("DeviceID");
        }
Пример #4
0
        public string GetDeviceIdFromCaption(string caption)
        {
            Wmi TWmi = new Wmi("Win32_NetworkAdapter", "WHERE Caption='" + caption + "'");

              return TWmi.GetInfo("DeviceID");
        }