实现效果:
知识运用:
ManagementObjectSearcher类和ManagementObject类
实现代码:
private void button1_Click(object sender, EventArgs e) { ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController"); foreach (ManagementObject FlashDeviceObject in searcher.Get()) { textBox1.Text = FlashDeviceObject["Name"].ToString(); textBox2.Text = FlashDeviceObject["PNPDeviceID"].ToString(); } }
原文地址:https://www.cnblogs.com/feiyucha/p/10295775.html
时间: 2024-10-04 17:45:14