有谁会用GetVolumeInformation( ) !!??(50分)

  • 主题发起人 主题发起人 knmfkr
  • 开始时间 开始时间
K

knmfkr

Unregistered / Unconfirmed
GUEST, unregistred user!
<br>&nbsp; &nbsp;清高手赐教 GetVolumeInformation( ) 的用法!
 
这个例子很不错,推荐<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; RootPath: array[0..20] of Char; &nbsp; &nbsp; // holds the root directory name<br>&nbsp; VolName: array[0..255] of Char; &nbsp; &nbsp; // holds the volume name<br>&nbsp; SerialNumber: DWORD; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// holds the serial number<br>&nbsp; MaxCLength: DWORD; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// holds the maximum file component length<br>&nbsp; FileSysFlag: DWORD; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // holds file system flags<br><br>&nbsp; FileSysName: array[0..255] of Char; // holds the name of the file system<br>begin<br>&nbsp; {indicate information is to be retrieved from the C drive}<br>&nbsp; RootPath := 'C:/';<br><br>&nbsp; {retrieve the volume information}<br>&nbsp; GetVolumeInformation(RootPath, VolName, 255, @SerialNumber, MaxCLength,<br>&nbsp; &nbsp; &nbsp;FileSysFlag, FileSysName, 255);<br><br>&nbsp; {display the information}<br>&nbsp; Panel2.Caption := VolName;<br>&nbsp; Panel3.Caption := IntToHex(SerialNumber,8);<br>&nbsp; Panel4.Caption := FileSysName;<br>end;<br>
 
老猫总是快一不
 
接受答案了.
 
后退
顶部