Home  >  Article  >  php教程  >  简述关于软件加密软件注册通用技术

简述关于软件加密软件注册通用技术

WBOY
WBOYOriginal
2016-06-06 20:01:321499browse

1. // 获取硬盘号 2. private string GetDiskID() 3. { 4. try 5. { 6. // 获取硬盘 ID 7. StringHDid= "" ; 8. ManagementClassmc= new ManagementClass( "Win32_DiskDrive" ); 9. ManagementObjectCollectionmoc=mc.GetInstances(); 10. foreach (Manageme

1.                //获取硬盘号

2.                private string GetDiskID()

3.                {   

4.                    try

5.                    {

6.                        //获取硬盘ID

7.                        String HDid = "";

8.                        ManagementClass mc = new ManagementClass("Win32_DiskDrive");

9.                        ManagementObjectCollection moc = mc.GetInstances();

10.                     foreach (ManagementObject mo in moc)

11.                     {

12.                         HDid = (string)mo.Properties["Model"].Value;

13.                     }

14.                     moc = null;

15.                     mc = null;

16.                     return HDid;

17.                 }

18.                 catch

19.                 {

20.                     return "";

21.                 }

22.                 finally

23.                 {

24.                 }

25.             }

26.             //获取CPU信息

27.             private string GetCpuInfo()

28.             {

29.                 try

30.                 {

31.                     string cpuInfo = "";//cpu序列号

32.                     ManagementClass cimobject = new ManagementClass("Win32_Processor");

33.                     ManagementObjectCollection moc = cimobject.GetInstances();

34.                     foreach (ManagementObject mo in moc)

35.                     {

36.                         cpuInfo = mo.Properties["ProcessorId"].Value.ToString();

37.                     }

38.                     return cpuInfo;

39.                 }

40.                 catch

41.                 {

42.                     this.senRegeditID.Enabled = false;

43.                     this.GetId.Enabled = true;

44.                 }

45.           

46.                 return "";

47.             }

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:读取RSS文件Next article:GridView 导入Excel