Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Motherboard Serial Number
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00660435
Message ID:
00660732
Vues:
10
Thanks George,
I tried getting it to work in VFP for Silvio, but I'm TERRIBLE at converting VB scripts to VFP! I guess I need more practice at that because I often find useful vbscripts that I would like to do in VFP! I knew if anyone could get it working though that you or Ed could! I appreciate your taking a look at it!
Tracy

>>I thought motherboards did not have serial numbers, only cpus (PIII and up), but I found this. Here is code to do this in VB, maybe someone out there can modify it to work with VFP? (George and Ed know alot about scripting)
>>
>>YOU MUST HAVE WMI INSTALLED AND A REFERENCE TO
>>Microsoft WMI Scripting Library IS REQUIRED IN VB FOR THIS TO WORK
>>
>>
>>Public Function MBSerialNumber() As String
>>
>>Dim objs As Object
>>
>>Dim obj As Object
>>Dim WMI As Object
>>Dim sAns As String
>>
>>
>>Set WMI = GetObject("WinMgmts:")
>>Set objs = WMI.InstancesOf("Win32_BaseBoard")
>>For Each obj In objs
>>  sAns = sAns & obj.SerialNumber
>> If sAns < objs.Count Then sAns = sAns & ","
>>Next
>>MBSerialNumber = sAns
>>End Function
>>
>>
>>
>>
>>
>>>I have already sent a message for everybody, but I think you didn't see it...
>>>
>>>Thanks anyway...
>>>
>>>Silvio
>
>Tracy,
>
>I haven't played around with this much. However, I believe, that in order for GETOBJECT() in VFP to work, you'll have to first create one of the WMI object. Like so
oWMI = CREATEOBJECT("WbemScripting.SWbemNamedValueSet")
>oObj = GETOBJECT("WINMGMTS:")
GETOBJECT() will fail otherwise. Now whether or not that's the ProgID you need in CREATEOBJECT(), is another question entirely. I haven't been able to duplicate your code in VBScript in VFP (yet), but the documentation shows a lot of useful information. I think (but don't know for sure) that WMI may install on Win2K Pro by default. That's a guess, however.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform