C#读取计算机串口号的方法
来源:互联网 发布:js typeof undefined 编辑:程序博客网 时间:2024/05/16 12:18
此方法用户读取计算机连接的串口设备的串口号,返回一个string数组,数组元素为形如“COM1”的串口名称。
/// <summary>
/// 获取本机可用串口号/// </summary>
/// <returns></returns>
public string[] GetCommKeys()
{
string[] values = null;
try
{
RegistryKey hklm = Registry.LocalMachine;
RegistryKey hs = hklm.OpenSubKey(@"HARDWARE\DEVICEMAP\SERIALCOMM");
values = new string[hs.ValueCount];
for (int i = 0; i < hs.ValueCount; i++)
{
values[i] = hs.GetValue(hs.GetValueNames()[i]).ToString();
}
}
catch (Exception ex)
{
}
return values;
}
- C#读取计算机串口号的方法
- C#读取计算机串口
- 【.Net码农】C#读取计算机串口
- C# 简单的串口读取
- Java读取串口的方法
- c#读取串口
- C#读取RSS的方法
- c# 读取文件的方法
- C#读取Excel的方法
- C#读取Excel的方法
- c#检测有效串口的方法
- C# 串口读取(事件驱动)
- c# 串口读取GPS信息
- c# 修改计算机名的方法
- c#获取计算机全名的方法
- linux串口数据读取方法
- C#通过串口关闭对方计算机
- 用c#读取Excel的方法
- Drush3.3 rsync 命令排除指定文件的方法
- 最新linux搭建gfs系统--iscsi+GFS实现网络存储
- directshow 连接filter
- 读《代码大全2》笔记:软件构建中的设计师
- drush features 常用命令
- C#读取计算机串口号的方法
- Xenomai-2.6.0-configure
- IAR数据定位方法 ,定义序列号和要存储的数据时会用到
- 数字图像处理 高频提升加强
- C++ DLL远程注入与卸载函数
- Understanding Android GPS HAL Driver
- 宽字符集(unicode)操作函数
- What browsers support HTML5 WebSocket API?
- 制作FFmpeg SDK for MS Visual Studio