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:24:55
 
 
À
04/03/2002 18:54:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00627438
Message ID:
00628335
Vues:
50
UPDATE: Ed, I just read the earlier messages and saw that the windows getvolumeinformation api is returning the same serial number for different logical drives on the same hard disk. I never noticed this before in my Delphi code--I'll have to test that tonight! :0(
Tracy

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?

Tracy
.·*´¨)
.·`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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform