Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get physical disk of a logical drive letter
Message
De
05/03/2002 08:55:38
 
 
À
05/03/2002 08:24:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00627438
Message ID:
00628352
Vues:
57
>SNIP
>>You could do it with a bit more trouble in Delphi or VB6 or later, but they have real strong datatyping and structures and pointers and unions, oh my!
>
>Actually, I wouldn't do it that way at all in Delphi. Delphi has a function: GetMediaID that will examine a disk's serial number. GetMediaID is a wrapper around the Windows GetVolumeInformation API call.
>
>Wouldn't something like the below Delphi code be useful in VFP?
>
>
>var
>  ID : MediaIDType;
>begin
>  GetMediaID2('C', ID);
>  ListBox1.Items.Add('Volume Label = ' +
>    StrPas(ID.VolumeLabel));
>  ListBox1.Items.Add('File System = ' +
>    StrPas(ID.FileSystemID));
>  ListBox1.Items.Add('Serial Number = ' +
>    IntToStr(ID.SerialNumber));
>
>
>Actually, shouldn't the Windows Getvolumeinformation return the same information?

It does, and it fails to provide any useful information on the physical disk extents. IOW, you can do this in VFP. DeviceIoControl is a far more complex topic. And I have C++ to deal with this if I need it, and the ability to create functions that integrate seamlessly in VFP through FLLs. IOW, use the right tool and it's not a ptoblem. I can do some things in the VFP environment that wouyld be horrendous to implement in the Delphi environment. BFD.

And the API function is case-sensitive.

C++ - because there's a ton of sh!t you can't do well otherwise...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform