public static string GetDeviceName() { RegistryKey folders; folders = OpenRegistryPath(Registry.LocalMachine, @"/Ident"); string name = folders.GetValue("Name").ToString(); return name; } private static RegistryKey OpenRegistryPath(RegistryKey root, string s) { s = s.Remove(0, 1) + @"/"; while (s.IndexOf(@"/") != -1) { root = root.OpenSubKey(s.Substring(0, s.IndexOf(@"/"))); s = s.Remove(0, s.IndexOf(@"/") + 1); } return root; }
相关文章
- windows下获取文件上传路径报错:: (文件名、目录名或卷标语法不正确。)
- 使用Lambda获取List对象中某一个属性以及获取特定条件下的属性对象
- Win10使用.bat命令 获取本机设备信息/MAC信息/IP信息,转存为txt文件并保存至目标目录
- Linux 下使用umount强行卸载设备
- C++ Windows 下 根据进程名获取进程ID 以及该进程下所有窗口的句柄
- 在Linux下用获取命令的使用方法(man)
- Struts1.x下使用jquery的Ajax获取后台数据
- springboot使用telnet连接设备获取数据
- inf安装驱动方式---win10下使用VS+WDK10生成win7 X64的设备驱动的过程
- ubuntu16.04 下修改账户名和设备名