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;
}WinCE下使用获取设备名
本文介绍了一段使用C#编程语言从Windows注册表中读取设备名称的方法。通过打开指定的注册表路径并获取Name值来实现设备名称的读取。
7712

被折叠的 条评论
为什么被折叠?



