Get CPU ID & HD Serial number
-
Hi, I have a problem if I read CPU ID and HD serial number with P/Invoce. It possible read this property with .NET 2.0 class? Help me please ( possible with example :) ) Thanks a lot!
Alex
Yes try this
Public Class Processor_ID
Public Function Get_CPU_ID() As String
Try
Dim objMOS As ManagementObjectSearcherDim objMOC As Management.ManagementObjectCollection Dim objMO As Management.ManagementObject objMOS = New ManagementObjectSearcher("Select \* From Win32\_Processor") objMOC = objMOS.Get For Each objMO In objMOC MessageBox.Show("CPU ID = " & objMO("ProcessorID")) Next objMOS.Dispose() objMOS = Nothing objMO.Dispose() objMO = Nothing Catch ex As ApplicationException MessageBox.Show(ex.Message) End Try End Function
End Class
and Call the Function like this in your Form
Dim strId As String
Try
Dim objID As New Processor_IDstrId = objID.Get\_CPU\_ID() MessageBox.Show(strId) Catch ex As ApplicationException MessageBox.Show(ex.Message) End Try
And that is in vb, its easy to convert it to C# Hope it Helps
Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za
-
Hi, I have a problem if I read CPU ID and HD serial number with P/Invoce. It possible read this property with .NET 2.0 class? Help me please ( possible with example :) ) Thanks a lot!
Alex
Look at this, it may help. http://www.codeproject.com/KB/system/GetHardwareInformation.aspx
Der Staat mit der niedrigsten Geburtenrate ist nicht die Bundesrepublik, sondern der Vatikan.