获得在C#中唯一系统标识符 [英] Get Unique System Identifiers in C#

查看:198
本文介绍了获得在C#中唯一系统标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么样的​​独一无二的系统标识符可以使用C#很容易获得(散列,然后唯一标识系统)?我可以只散列硬盘容量之类的东西,但我需要识别和区分都是由相同的组件构建的,所以我不能由去电脑。

what kind of 'unique' system identifiers can be easily obtained using C# (to hash and then uniquely identify a system)? I could just hash HDD size and things like that but I need to identify and distinguish computers that are all built by the same components so I can't go by that.

欣赏提示,思路,示例代码!

Appreciate hints, ideas, sample code!

推荐答案

下面是一个良好的开端的 WMI ...

Here's a good start with WMI ...

// Win32_CPU will work too
var search = new ManagementObjectSearcher( "SELECT * FROM Win32_baseboard" );
var mobos = search.Get();

foreach (var m in mobos)
{
  var serial = m["SerialNumber"]; // ProcessorID if you use Win32_CPU
}

您可以做到这一点与硬件的多件并用解决方案上来。

You can do that with many pieces of hardware and come up with a solution.

这篇关于获得在C#中唯一系统标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆