namespace Beisen.Native
{
using Beisen.Pdf;
using System;
using System.Runtime.InteropServices; internal sealed class DeviceInfo
{
private static DeviceInfo _Instance; public static DeviceInfo Instance
{
get
{
if (_Instance == null)
{
_Instance = new DeviceInfo();
}
return _Instance;
}
} public string Id
{
get
{
uint volumeSerialNumber = ;
uint num = 0u;
uint num2 = ;
uint num3 = ;
uint num4 = ;
uint num5 = ;
string systemDirectory = Environment.SystemDirectory;
if ((systemDirectory != null) && (systemDirectory.Length > ))
{
uint num6;
FileSystemFeature fileSystemFeature;
Platform.GetVolumeInformation(string.Format("{0}:\\", systemDirectory[]), null, , out num, out num6, out fileSystemFeature, null, );
}
string g = RegistryWOW6432.GetRegKey32<string>(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Cryptography", "MachineGuid");
if ((g == null) || (g.Trim() == ""))
{
g = RegistryWOW6432.GetRegKey64<string>(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Cryptography", "MachineGuid");
}
if (g != null)
{
byte[] buffer = new Guid(g).ToByteArray();
if (buffer != null)
{
num2 = BitConverter.ToUInt32(buffer, );
num3 = BitConverter.ToUInt32(buffer, );
num4 = BitConverter.ToUInt32(buffer, );
num5 = BitConverter.ToUInt32(buffer, );
}
}
return $"{volumeSerialNumber}-{num2}-{num3}-{num4}-{num5}";
}
}
}
}

C# 获取Windows 设备信息的更多相关文章

  1. Atitit.获取主板与bios序列号获取硬件设备信息  Wmi wmic 的作用

    Atitit.获取主板与bios序列号获取硬件设备信息  Wmi wmic 的作用 1 获取硬件核心基础核心基础Wmi1 2 其他资料2 3 Wmic WMI 命令行接口2 4 Atitit.获取主板 ...

  2. Qt 获取usb设备信息 hacking

    /************************************************************************** * Qt 获取usb设备信息 hacking * ...

  3. 【转】android 安卓APP获取手机设备信息和手机号码的代码示例

    http://blog.csdn.net/changemyself/article/details/7421476 下面我从安卓开发的角度,简单写一下如何获取手机设备信息和手机号码 准备条件:一部安卓 ...

  4. ?Object-C获取手机设备信息

    一.获取UiDevice设备信息 // 获取设备名称 NSString *name = [[UIDevice currentDevice] name]; // 获取设备系统名称 NSString *s ...

  5. Delphi调用API函数获取Windows目录信息、获取System目录信息、获取Temp临时文件目录信息

    var Str1, Str2: Array[..Max_Path]of Char;//开辟缓冲区 Str3: Array[..]of Char; begin GetWindowsDirectory(@ ...

  6. android 安卓APP获取手机设备信息和手机号码的代码示例

    下面我从安卓开发的角度,简单写一下如何获取手机设备信息和手机号码 准备条件:一部安卓手机.手机SIM卡确保插入手机里.eclipse ADT和android-sdk开发环境 第一步:新建一个andro ...

  7. iOS开发-Object-C获取手机设备信息(UIDevice)

    一.获取UiDevice设备信息 // 获取设备名称 NSString *name = [[UIDevice currentDevice] name]; // 获取设备系统名称 NSString *s ...

  8. Python学习---Django的request扩展[获取用户设备信息]

    关于Django的request扩展[获取用户设备信息] settings.py INSTALLED_APPS = [ ... 'app01', # 注册app ] STATICFILES_DIRS ...

  9. JavaScript获取访问设备信息

    <html xmlns=http://www.w3.org/1999/xhtml> <head> <title>JavaScript获取访问设备信息</tit ...

随机推荐

  1. java读取excel的内容(可保存到数据库中)

    //** poi jar包 // public class ReadExcel { @SuppressWarnings("static-access") private stati ...

  2. samba简单配置

    Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成.SMB (Server Messages Block,信息服务块)是一种在局域网上共享文件和打印机的一种 ...

  3. SQL进阶系列之1CASE表达式

    配置环境: 下载地址:https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows 使用数据库: C:\Po ...

  4. raw镜像与qcw2镜像互相转换

    qcow2是最小使用,raw是置零使用 . raw格式是原始镜像,会直接当作一个块设备给虚拟机来使用,至于文件里面的空洞,则是由宿主机的文件系统来管理的,linux下的文件系统可以很好的支持空洞的特性 ...

  5. machine learning (5)---learning rate

    degugging:make sure gradient descent is working correctly cost function(J(θ)) of Number of iteration ...

  6. 写一个python小程序

    在windows环境下进行操作 window+R 输入cmd  创建一个文件夹 mkdir pytxt 创建一个py文件 py.py  用notepad或者记事本等工具进行编辑 或 首先声明pytho ...

  7. python_requests ~爬虫~小视频~~~

    当一只小小的Py_Spider也有一段时间了, 期间,更多的时间是在爬取图片啊, 文字, 文档这类的东西, 今天突然一时兴起, 来爬一手视频! 所以就找到了远近闻名的六间房(六扇门)哈哈,~~~ 1. ...

  8. js判断radio选中状态

    var radios = document.getElementsByName("radiosName"); var checked = false; for ( var j = ...

  9. [c++11]右值引用、移动语义和完美转发

    c++中引入了右值引用和移动语义,可以避免无谓的复制,提高程序性能.有点难理解,于是花时间整理一下自己的理解. 左值.右值 C++中所有的值都必然属于左值.右值二者之一.左值是指表达式结束后依然存在的 ...

  10. PHP获取POST数据的三种方式

    一.PHP获取POST数据的几种方法 方法1.最常见的方法是:$_POST['fieldname']; 说明:只能接收Content-Type: application/x-www-form-urle ...