Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the Hard disk ID?
Message
 
À
25/03/2005 10:02:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
00999131
Message ID:
00999628
Vues:
55
This message has been marked as a message which has helped to the initial question of the thread.
DECLARE INTEGER GetVolumeInformation IN Kernel32.DLL;
  STRING @,STRING @,INTEGER,INTEGER @,INTEGER @,INTEGER @,STRING @,INTEGER

lcRoot="c:\"+CHR(0)
lcVolume=SPACE(255)
liVolume=LEN(lcVolume)
liSerNum=0
liMaxComp=0
liFlags=0
lcFileSystemName=SPACE(255)
liFileSystemName=LEN(lcFileSystemName)

liErr=GetVolumeInformation(@lcRoot,@lcVolume,liVolume,@liSerNum,@liMaxComp,@liFlags,@lcFileSystemName,liFileSystemName)
MartinJ
>Thank you Hilmar. The funny thing is that before asking that question I went to News2News. But I did'nt look at the right place.
>
>>Perhaps the GetVolumeInformation() API function?
>>
>>http://news2news.com/vfp/?group=29&function=145
>>
>>>I have that code which does the job
>>>
>>>
>>>oFS = CREATEOBJECT("Scripting.FileSystemObject")
>>>cDrive = SUBSTR(SYS(16,1),1,2) &&"C:"
>>>If oFS.DriveExists(cDrive)
>>>  oDrv = oFS.Drives.Item(cDrive)
>>>  lnvol=oDrv.SerialNumber
>>>  lnvolhex=substr(transform(lnvol,"@0"),3,4)+right(transform(lnvol,"@0"),4)
>>>  ?lnvolhex
>>>ENDIF
>>>
>>>
>>>What would be an alternative if WSH is not installed on a given machine?
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform