تبليغاتX
دلفی باز - بدست آوردن اطلاعات مربوط به هارد ديسک - سي دي رام - فلاپي ديسک
دلفی_مهندسی عمران
طريقه بدست آوردن اطلاعات مربوط به هارد ديسک - سي دي رام - فلاپي ديسک
اطلاعاتي که روالهاي زير برمي گرداند عبارتست از شماره سريال - نوع سيستم فايل -
پشتيباني از نام فايلهاي طولاني و نام درايو

From The Windows.Pas
--------------------
--------------------

function GetVolumeInformationA(lpRootPathName: PAnsiChar;
lpVolumeNameBuffer: PAnsiChar; nVolumeNameSize: DWORD; lpVolumeSerialNumber: PDWORD;
var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
lpFileSystemNameBuffer: PAnsiChar; nFileSystemNameSize: DWORD): BOOL; stdcall;

function GetVolumeInformationW(lpRootPathName: PWideChar;
lpVolumeNameBuffer: PWideChar; nVolumeNameSize: DWORD; lpVolumeSerialNumber: PDWORD;
var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
lpFileSystemNameBuffer: PWideChar; nFileSystemNameSize: DWORD): BOOL; stdcall;

function GetVolumeInformation(lpRootPathName: PChar;
lpVolumeNameBuffer: PChar; nVolumeNameSize: DWORD; lpVolumeSerialNumber: PDWORD;
var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
lpFileSystemNameBuffer: PChar; nFileSystemNameSize: DWORD): BOOL; stdcall;

Example
-------
-------

Used Variables
--------------
Path : PChar;
--> String that contains the root directory of the volume to
be described.
VolumeName : PChar;
--> Points to a buffer that receives the name of the specified
volume.
VolumeNameSize : DWord;
--> Specifies the lenght in characters of the buffer that
receives the volume name.
SerialNumber : DWord;
--> Points to a variable that receives the volume's serial
number.
MaxLength : DWord;
--> Receives the maximum length in characters of a filename
supported by the specified file system.
(to indicate if long file names are supported)
- long file names --> value : 255
Flags : DWord;
- FS_CASE_IS_PRESERVED
- FS_CASE_SENSITIVE
- FS_UNICODE_STORED_ON_DISK
- FS_PERSISTENT_ACLS
- FS_FILE_COMPRESSION
- FS_VOL_IS_COMPRESSED
(for more info on the flags look in the help file)
FileSystem : PChar;
--> Points to a buffer that receives the name of the specified
file system.
FileSystemNameSize: DWord;
--> Specifies the lenght in characters of the buffer that
receives the filesytem name.

Code
----
Path := 'C:\';
VolumeNameSize := 256;
FileSystemNameSize := 256;
GetVolumeInformation(Path,VolumeName,VolumeNameSize,
@SerialNumber,MaxLength,Flags,FileSystem,FileSystemNameSize);
+ نوشته شده در  چهارشنبه دوم فروردین 1385ساعت 2:18  توسط حمید رادان  |