-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathhwid.cs
35 lines (34 loc) · 1.06 KB
/
hwid.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Management;
using System;
namespace discord_aio_release
{
internal class HWID
{
public static string getHWID()
{
string cDiskID = getDiskC();
string processorID = getProcessor();
string compiledID = cDiskID + processorID;
return compiledID;
}
public static string getProcessor()
{
ManagementObjectCollection mbsList = null;
ManagementObjectSearcher mbs = new ManagementObjectSearcher("Select * From Win32_processor");
mbsList = mbs.Get();
string id = "";
foreach (ManagementObject mo in mbsList)
{
id = mo["ProcessorID"].ToString();
}
return id;
}
public static string getDiskC()
{
ManagementObject dsk = new ManagementObject(@"win32_logicaldisk.deviceid=""c:""");
dsk.Get();
string id = dsk["VolumeSerialNumber"].ToString();
return id;
}
}
}