获取机械码的问题,用生成注册码。
本人想做一个注册程序,打算用Cpu序号与硬盘的序号来计算注册码。现在碰到的问题是,有些Cpu的ID读不出来;硬盘的物理ID可以读来,但是如果插有U盘,则总是返回1,不返原来硬盘的物理ID,怎么能读出指定硬盘的ID,请多多指教,谢谢关注我读出硬盘ID与CpuID代码如下:
Dim StrID As String = ""
Dim cmicWmi As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
Dim Uint32 As UInt32
For Each cmicWmiObj As ManagementObject In cmicWmi.Get
Uint32 = cmicWmiObj("signature")
Next
MessageBox.Show("硬盘的ID:"+Uint32.ToString)
'获得CPU序列号
Dim Wmi As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_Processor")
Dim Uint33 As String = ""
For Each WmiObj As ManagementObject In Wmi.Get
Uint33 = WmiObj("ProcessorId")
Next
MessageBox.Show("Cpu的ID:"+Uint33)
--------------------编程问答-------------------- C#获取cpu序列号,硬盘ID,网卡MAC地址 --------------------编程问答-------------------- UP --------------------编程问答-------------------- 没接触过 纯顶 --------------------编程问答-------------------- 学习 --------------------编程问答-------------------- 刷新一下 --------------------编程问答--------------------
正解 --------------------编程问答-------------------- 1 楼正解...
如果了解更多的可以使用wmi....查看
msdn帮助上有
只要传入命令 :select * from Win32_PhysicalMedia
即可查出你想要的信息 --------------------编程问答-------------------- mark --------------------编程问答--------------------
有的硬读不出来ID --------------------编程问答-------------------- mark --------------------编程问答-------------------- 硬盘序列号
读不出使用CPU号等
http://topic.csdn.net/u/20081220/14/6fe92b89-0ee2-4276-8804-913171780304.html --------------------编程问答-------------------- 建议使用网卡id
--------------------编程问答-------------------- C#获取cpu序列号,硬盘ID,网卡MAC地址 --------------------编程问答--------------------
补充:.NET技术 , VB.NET