C# 获取Windows 设备信息
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 设备信息的更多相关文章
- Atitit.获取主板与bios序列号获取硬件设备信息 Wmi wmic 的作用
Atitit.获取主板与bios序列号获取硬件设备信息 Wmi wmic 的作用 1 获取硬件核心基础核心基础Wmi1 2 其他资料2 3 Wmic WMI 命令行接口2 4 Atitit.获取主板 ...
- Qt 获取usb设备信息 hacking
/************************************************************************** * Qt 获取usb设备信息 hacking * ...
- 【转】android 安卓APP获取手机设备信息和手机号码的代码示例
http://blog.csdn.net/changemyself/article/details/7421476 下面我从安卓开发的角度,简单写一下如何获取手机设备信息和手机号码 准备条件:一部安卓 ...
- ?Object-C获取手机设备信息
一.获取UiDevice设备信息 // 获取设备名称 NSString *name = [[UIDevice currentDevice] name]; // 获取设备系统名称 NSString *s ...
- Delphi调用API函数获取Windows目录信息、获取System目录信息、获取Temp临时文件目录信息
var Str1, Str2: Array[..Max_Path]of Char;//开辟缓冲区 Str3: Array[..]of Char; begin GetWindowsDirectory(@ ...
- android 安卓APP获取手机设备信息和手机号码的代码示例
下面我从安卓开发的角度,简单写一下如何获取手机设备信息和手机号码 准备条件:一部安卓手机.手机SIM卡确保插入手机里.eclipse ADT和android-sdk开发环境 第一步:新建一个andro ...
- iOS开发-Object-C获取手机设备信息(UIDevice)
一.获取UiDevice设备信息 // 获取设备名称 NSString *name = [[UIDevice currentDevice] name]; // 获取设备系统名称 NSString *s ...
- Python学习---Django的request扩展[获取用户设备信息]
关于Django的request扩展[获取用户设备信息] settings.py INSTALLED_APPS = [ ... 'app01', # 注册app ] STATICFILES_DIRS ...
- JavaScript获取访问设备信息
<html xmlns=http://www.w3.org/1999/xhtml> <head> <title>JavaScript获取访问设备信息</tit ...
随机推荐
- Spring Boot文档
本文来自于springboot官方文档 地址:https://docs.spring.io/spring-boot/docs/current/reference/html/ Spring Boot参考 ...
- 神经网络学习中的损失函数及mini-batch学习
# 损失函数(loss function).这个损失函数可以使用任意函数,# 但一般用均方误差(mean squared error)和交叉熵误差(cross entropy error)等一切都在代 ...
- 《代码敲不队》第九次团队作业:Beta冲刺第2天
项目 内容 这个作业属于哪个课程 任课教师博客主页链接 这个作业的要求在哪里 作业链接地址 团队名称 代码敲不队 作业学习目标 (1)项目文档的完善与整理:(2)团队项目总结陈述PPT编制:(3)符合 ...
- Bias vs. Variance(1)--diagnosing bias vs. variance
我们的函数是有high bias problem(underfitting problem)还是 high variance problem(overfitting problem),区分它们很得要, ...
- Linux命令基础3-cd命令
cd 到带空格的文件夹 [root@cctg-sjc16-grafana ccatgbld]# cd 'my test' [root@cctg-sjc16-grafana my test]# cd . ...
- java spring boot 导出/下载文本文件操作(包含写文本文件)
内容简介 本文主要内容为使用java把内容写入文本文件,并实现下载/导出的功能. 实现步骤 1. controller层 @ResponseBody @RequestMapping(value = & ...
- django 第三天 视图
今日内容 一.url路由分发之include 项目文件夹下的urls.py文件中的url写法: from django.conf.urls import url,include from django ...
- xml---基础了解
XML 被设计用来传输和存储数据. HTML 被设计用来显示数据. 什么是 XML? XML 指可扩展标记语言(EXtensible Markup Language). XML 是一种很像HTML的标 ...
- Greenplum Segment 的检测机制
Greenplum集群具有较好的容错性和高可用性,其中一点就体现在segment镜像机制上.接下来本文会简单地阐述segment的作用以及segment镜像机制是如何保证GP高可用的. Segment ...
- bzoj 5299: [Cqoi2018]解锁屏幕 状压dp+二进制
比较简单的状压 dp,令 $f[S][i]$ 表示已经经过的点集为 $S$,且最后一个访问的位置为 $i$ 的方案数. 然后随便转移一下就可以了,可以用 $lowbit$ 来优化一下枚举. code: ...