PDA

View Full Version : گرفتن Hard ware id



papa_toop
سه شنبه 30 مرداد 1386, 20:08 عصر
چطوری می شه کد یه سخت افزار،مثل MotherBoard,BIOS,HARd و ... رو گرفت و توی TextBox انداخت؟

omidreza812
چهارشنبه 31 مرداد 1386, 15:54 عصر
خوب باید واسه هر کدوم کد بنویسی
این کد واسه hard استفاده میشه:



Dim hardset As Object
Dim hard As Object
hardset = GetObject("winmgmts:{impersonationLevel=impersonate}"). _
InstancesOf("win32_diskdrive")
For Each hard In hardset
textbox3.Text = hard.Interfacetype
textbox4.Text = hard.model
Exit For
Next
'''''''''''''

hardset = GetObject("winmgmts:{impersonationLevel=impersonate}"). _
InstancesOf("win32_Physicalmedia")

For Each hard In hardset
textbox5.Text = hard.serialnumber
Exit For
Next



واسه باقی هم برو اینجا:
www.codeproject.com (http://www.codeproject.com)