Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I retrieve CPU vendor info?
Message
De
15/12/2005 11:07:29
Somesh Sahu
Cybage Software Pvt Ltd,
Pune, Inde
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00985386
Message ID:
01078296
Vues:
26
Hi,
I found ur code to get the HD info very helpful.
Can u give some idea or API name to get the serial number of the ethernet card installed on a CPU. I am working on vfp 7.
Thanks in advance,

Regards/ Somesh


>>Thanks Hugo. This is very nice!
>>
>>But is WMI something that comes with the OS? If so, above what version? What does it take to install one if it doesn't exit?
>>
>
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/system_requirements.asp
>
>
>>I also read from what Jos refered me to that some CPU doesn't support Serial #.
>>HD info could be a good alternative for CPU one for what I am trying to achieve.
>
>
>You can use WMI for this too, but only with XP or + (for this sample at least).
>
>Here is a sample for getting the HD info, a little clumsy for I do not know a better way of just getting the object from the physical number:
>
>
>function GetHDSerial(tnDevice)
>local loLocator, lcUser, lcPassword, lcDomain, loNetWork, lnDevice
>local loDrives, loDrive, lnCurrDevice, lcSerial
>
>
>lnDevice			= Iif(Vartype(tnDevice) = 'N', tnDevice, 0)
>lcSerial			= 'Unknown'
>
>try
>	loWBEMLocator		= createObject("wbemScripting.SwbemLocator")
>	loWMIService		= loWBEMLocator.ConnectServer()
>catch
>	loWMIService		= null
>endtry
>
>if not Isnull(loWMIService)
>	loDrives			= loWMIService.ExecQuery('Select SerialNumber from Win32_PhysicalMedia')
>	lnCurrDevice		= 0
>	for each loDrive in loDrives
>		if lnCurrDevice	= lnDevice
>			lcSerial		= loDrive.SerialNumber
>			exit
>		endif
>		lnCurrDevice	= lnCurrDevice + 1
>	endfor
>endif
>return Alltrim(lcSerial)
>
>
>So, if you want the Serial of Disk 0:
>
>? GetHDSerial(0)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform