C#获取串口列表
2007-08-24 14:51
323 查看
参考VC方法实现的:
public void GetComList()
{
RegistryKey keyCom = Registry.LocalMachine.OpenSubKey("Hardware//DeviceMap//SerialComm");
if (keyCom != null)
{
string[] sSubKeys = keyCom.GetValueNames();
this.cmbComPort.Items.Clear();
foreach(string sName in sSubKeys)
{
string sValue = (string)keyCom.GetValue(sName);
this.cmbComPort.Items.Add(sValue);
}
}
}
public void GetComList()
{
RegistryKey keyCom = Registry.LocalMachine.OpenSubKey("Hardware//DeviceMap//SerialComm");
if (keyCom != null)
{
string[] sSubKeys = keyCom.GetValueNames();
this.cmbComPort.Items.Clear();
foreach(string sName in sSubKeys)
{
string sValue = (string)keyCom.GetValue(sName);
this.cmbComPort.Items.Add(sValue);
}
}
}
相关文章推荐
- C# 获取打印机列表以及串口
- c#获取本机串口列表
- c#获取本机的串口列表
- C#获取串口列表 ZT
- C#获取串口列表(可用于实现实时监控串口)
- C#获取串口列表实现实时监控串口
- C#中获取串口与并口列表
- C#获取远程FTP文件列表
- C#获取远程FTP文件列表
- C#获取远程FTP文件列表
- BIM360: C#如何发送HTTP GET和POST请求登陆BIM 360 Glue以及获取项目列表
- c#获取打印机列表
- C# 获取本地安装的软件列表
- C# FTP 命令无法获取ServerU目录列表问题 转载的啊
- C# 获取打印机和串口
- ArcEngine利用C#反射获取事件列表
- C# 如何获取某文件夹的文件列表,并按文件的创建时间排序?
- C# WPD PortableDeviceApiLib获取便携设备列表
- 在c# 的分页获取数据列表
- C# 获取本机“设备管理器”信息列表