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. python获取第前多少天的日期

    1. 显示昨天(前一天)的日期 from datetime import date, timedelta yesterday_date = (date.today() + timedelta(days ...

  2. centos7安装redis 并配置在后台启动

    官网  https://redis.io/download 先进入 目录 /usr/local 1 下载文件包 $ wget http://download.redis.io/releases/red ...

  3. node ffmpeg 视频操作

    1,先安装ffmpeg 2,设置环境变量 3,npm install fluent-ffmpeg 4,编码 var ffmpeg = require('fluent-ffmpeg'); //视频合并 ...

  4. python3 生成二维码并存入word文档

    #二维码的制作与解析 import qrcode,zxing,os s='https:////www.baidu.com/' res=qrcode.make(data=s) res.show() re ...

  5. LG4351 [CERC2015]Frightful Formula

    Frightful Formula 给你一个\(n\times n\)矩阵的第一行和第一列,其余的数通过如下公式推出: \[f_{i,j}=a\cdot f_{i,j-1}+b\cdot f_{i-1 ...

  6. Django自定义filter

  7. Linux PAM 之cracklib模块

       如何在Linux系统中限制密码长度的同时对密码的复杂程度也进行管理,最近发现有人的密码符合长度规则,但是却很简单很容易被猜出来,查了相关资料后发现了PAM中的pam_cracklib模块就是用来 ...

  8. Vue 项目环境搭建

    Vue项目环境搭建 ''' 1) 安装node 官网下载安装包,傻瓜式安装:https://nodejs.org/zh-cn/ 2) 换源安装cnpm >: npm install -g cnp ...

  9. Node.js安装,多版本管理以及修改npm下载的镜像源

    注意:在操作之前建议先把整个文章看完,在决定要不要配置!!!!! 1.下载    地址:http://nodejs.cn/download/        根据系统对应版本下载文件 2.安装    下 ...

  10. Win10 Subsystem Linux : Ubuntu 的root密码

    安装完Ubuntu后忽然意识到没有设置root密码, 不知道密码自然就无法进入根用户下.Ubuntu的默认root密码是随机的, 即每次开机都有一个新的root密码.我们可以在终端输入命令 sudo ...