29 lines
820 B
C#
29 lines
820 B
C#
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 "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|