コード例 #1
0
ファイル: Helpers.cs プロジェクト: hs777it/Sales-Management
        public static string GetProductID(string drive)//use:: getUniqueID("C");
        {
            if (drive == string.Empty)
            {
                //Find first drive
                foreach (DriveInfo compDrive in DriveInfo.GetDrives())
                {
                    if (compDrive.IsReady)
                    {
                        drive = compDrive.RootDirectory.ToString();
                        break;
                    }
                }
            }
            if (drive.EndsWith(":\\"))
            {
                //C:\ -> C
                drive = drive.Substring(0, drive.Length - 2);
            }

            string volumeSerial = HardwareOp.HDDSerialNo(drive);
            string cpuID        = HardwareOp.CpuId();

            //Mix them up and remove some useless 0's
            return(cpuID.Substring(13) + cpuID.Substring(1, 4) + volumeSerial + cpuID.Substring(4, 4));
        }
コード例 #2
0
ファイル: Helpers.cs プロジェクト: hs777it/Sales-Management
 public static string GetProductID()
 {
     return(GetHash(
                "CPU >> " + HardwareOp.CpuId() +
                "\nBIOS >> " + HardwareOp.BiosId() +
                "\nBASE >> " + HardwareOp.BaseBoardId() +
                "\nDISK >> " + HardwareOp.DiskId() +
                "\nVIDEO >> " + HardwareOp.VideoId() +
                "\nMAC >> " + HardwareOp.MacId()));
 }