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. c# 字符串修改

  2. Exchange 退信550 5.1.11 RESOLVER.ADR.ExRecipNotFound

    问题描述: 在Exchange 2013环境下,某客户将一个用户的邮箱test@abc.com禁用,过了几天又想连接该邮箱,但是却没有找到禁用的邮箱,然后客户就Enable-MailBox重新创建了一 ...

  3. MongoDB/聚合/MR

    管道与Aggregation: 文档结构如下: { "_id" : 1, "item" : "abc", "price" ...

  4. Dubbo基础入门

    Dubbo概述 Dubbo的背景 随着互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,亟需一个治理系统确保架构有条不紊的演进. 单一应用架构 ...

  5. 01.Vue前端路由学习目标

    路由的基本概念与原理 vue-router的基本使用 vue-router嵌套路由 vue-router动态路由匹配 vue-router命名路由 vue-router编程式导航 基于vue-rout ...

  6. JAVA面试中需要准备的点

    零基础入门学习Java,如何准备Java初级和高级的技术面试   本人最近几年一直在做java后端方面的技术面试官,而在最近两周,又密集了面试了一些java初级和高级开发的候选人,在面试过程中,我自认 ...

  7. 初始SpringBoot

    导入依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http:/ ...

  8. YAML_10 把监听端口是8080的Apache服务全部停止

    ansible]# vim ad.yml --- - hosts: cache   remote_user: root   tasks:     - shell: netstat -atunlp  | ...

  9. b/s实现大文件上传分片上传断点续传

    关键部分 前端用file.slice()分块 前端用FileReader获取每一分块的md5值 后端用MultipartFile接受分块文件 后端用FileOutputStream拼装分块文件 话不多 ...

  10. learning armbian steps(1) ----- armbian 入门知识基础学习

    第一问: armbian是什么? Armbian是轻量级的Debian系统和为ARM开发板专门发行并重新编译的Ubuntu系统. 第二问:  什么场景下会用到armbian系统? 一个带有arm编译器 ...