init
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Licensing.SystemInformation
|
||||
{
|
||||
public static class ProcessorInfo
|
||||
{
|
||||
private static ManagementObjectSearcher cpuSearcher = new ManagementObjectSearcher("SELECT ProcessorID,DeviceID,SerialNumber,UniqueId FROM Win32_processor");
|
||||
static public string ProcessorID
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return cpuSearcher.Get().OfType<ManagementObject>().FirstOrDefault()["ProcessorID"].ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user