Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BIOS serial number
Message
 
À
26/08/2005 09:21:51
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01044217
Message ID:
01044419
Vues:
19
Have you tried it with th e rest of the function, or on its own. I'm noot sure it is related to the OS
lcComputer = "."
loWMIService = Getobject("winmgmts:" ;
	+ "{impersonationLevel=impersonate}!\\" + lcComputer + "\root\cimv2")
colBIOS = loWMIService.ExecQuery ;
	("Select * from Win32_BIOS")
For Each loBIOS In colBIOS
	?"Build Number: " + loBIOS.BuildNumber
	?"Current Language: " + loBIOS.CurrentLanguage
	?"Installable Languages: " + TRANSFORM(loBIOS.InstallableLanguages)
	?"Manufacturer: " + loBIOS.Manufacturer
	?"Name: " + loBIOS.Name
	?"Primary BIOS: " + TRANSFORM(loBIOS.PrimaryBIOS)
	?"Release Date: " + WMIDateStringToDate(loBios.ReleaseDate)
	?"Serial Number: " + loBIOS.SerialNumber
	?"SMBIOS Version: " + loBIOS.SMBIOSBIOSVersion
	?"SMBIOS Major Version: " + transf(loBIOS.SMBIOSMajorVersion)
	?"SMBIOS Minor Version: " + TRANSFORM((loBIOS.SMBIOSMinorVersion))
	?"SMBIOS Present: " + TRANSFORM(loBIOS.SMBIOSPresent)
	?"Status: " + loBIOS.Status
	?"Version: " + loBIOS.Version
Next

Function WMIDateStringToDate(dtmDate)
WMIDateStringToDate = Ctot(Substr(dtmDate, 5, 2) + "/" + ;
Substr(dtmDate, 7, 2) + "/" + Left(dtmDate, 4) ;
+ " " + Substr (dtmDate, 9, 2) + ":" + ;
Substr(dtmDate, 11, 2) + ":" + Substr(dtmDate, ;
13, 2))
Return Transform(WMIDateStringToDate)
Endfunc
>Hi Mike,
>I tried your code and release date seem empty with my computer installed W2k?
>
>
>
>
>>To correct the date representation you need to use a function like this.
>>
>>
>>
"ReleaseDate: " , WMIDateStringToDate(loItem.ReleaseDate)
>>
>>Function WMIDateStringToDate(dtmDate)
>>WMIDateStringToDate = Ctot(Substr(dtmDate, 5, 2) + "/" + ;
>>Substr(dtmDate, 7, 2) + "/" + Left(dtmDate, 4) ;
>>+ " " + Substr (dtmDate, 9, 2) + ":" + ;
>>Substr(dtmDate, 11, 2) + ":" + Substr(dtmDate, ;
>>13, 2))
>>Return Transform(WMIDateStringToDate)
>>Endfunc
>>
>>
>>
>>>I try to get Bios SerialNumber with thi code:
>>>
>>>
>>>local loWMI, loItems, loItem, loLocator
>>>CLEAR
>>>loLocator		= CREATEOBJECT('WBEMScripting.SWBEMLocator')
>>>loWMIService	= loLocator.ConnectServer()
>>>loItems			= loWMIService.ExecQuery("Select * from Win32_BIOS where PrimaryBIOS = TRUE")
>>>
>>>For Each loItem in loItems
>>>    ? "Caption: " , loItem.Caption
>>>    ? "CurrentLanguage: " , loItem.CurrentLanguage
>>>    ? "Description: " , loItem.Description
>>>    ? "Manufacturer: " , loItem.Manufacturer
>>>    ? "Name: " , loItem.Name
>>>    ? "ReleaseDate: " , loItem.ReleaseDate
>>>    ? "SerialNumber: " , loItem.SerialNumber
>>>    ? "SMBIOSBIOSVersion: " , loItem.SMBIOSBIOSVersion
>>>    ? "SMBIOSMajorVersion: " , loItem.SMBIOSMajorVersion
>>>    ? "SMBIOSMinorVersion: " , loItem.SMBIOSMinorVersion
>>>    ? "SMBIOSPresent: " , loItem.SMBIOSPresent
>>>    ? "Status: " , loItem.Status
>>>    ? "Version: " , loItem.Version
>>>Next
>>>
>>>
>>>and I received something like this:
>>>
>>> Caption: Award Modular BIOS v6.00PG
>>> CurrentLanguage: n|US|iso8859-1
>>> Description: Award Modular BIOS v6.00PG
>>> Manufacturer: Award Software International, Inc.
>>> Name: Award Modular BIOS v6.00PG
>>> ReleaseDate: 20030912******.******+***
>>> SerialNumber:
>>> SMBIOSBIOSVersion: F8
>>> SMBIOSMajorVersion: 2
>>> SMBIOSMinorVersion: 3
>>> SMBIOSPresent: .T.
>>> Status: OK
>>> Version: GBT - 42302e31
>>>Why I don't get SerialNumber and I have "******.******+***" after the Release date?
>>>Can someone help me?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform