这个例子很不错,推荐<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> RootPath: array[0..20] of Char; // holds the root directory name<br> VolName: array[0..255] of Char; // holds the volume name<br> SerialNumber: DWORD; // holds the serial number<br> MaxCLength: DWORD; // holds the maximum file component length<br> FileSysFlag: DWORD; // holds file system flags<br><br> FileSysName: array[0..255] of Char; // holds the name of the file system<br>begin<br> {indicate information is to be retrieved from the C drive}<br> RootPath := 'C:/';<br><br> {retrieve the volume information}<br> GetVolumeInformation(RootPath, VolName, 255, @SerialNumber, MaxCLength,<br> FileSysFlag, FileSysName, 255);<br><br> {display the information}<br> Panel2.Caption := VolName;<br> Panel3.Caption := IntToHex(SerialNumber,8);<br> Panel4.Caption := FileSysName;<br>end;<br>