因为它是API。你在代码中写上GetDriveType,然后把光标移到上面按F1。
解决方案 »
- 数据导入
- 如何为dbgrideh控件添加LineColor属性,可以在设计时任意改变dbgrideh的行、列线颜色?
- 为什么我的MSComm控件的OnComm事件会不断的重复执行啊,导致接收的数据为空,报“variant array index out of bounds”的错误,高手指点
- ADO+Access问题
- 如何编写日志文件?
- delphi 如何实现静态变量,指点一下。
- 如何获得选中的dbgrid中的数据?
- Combobox方面的 小问题
- 在DBGride里我怎样把一个int型的字段显示成 "0000123"的类型?
- 急急急,mediaplayer播放时怎样实现全屏播放
- 大家一起进: 急!急!急:我的多语言程序在繁体版win2000出现乱码,该什么办?
- ActiveForm的问题?请帮忙!
delphi带有的
);
ParameterslpRootPathNamePoints to a null-terminated string that specifies the root directory of the disk to return information about. If lpRootPathName is NULL, the function uses the root of the current directory. Return ValuesThe return value specifies the type of drive. It can be one of the following values: Value Meaning
0 The drive type cannot be determined.
1 The root directory does not exist.
DRIVE_REMOVABLE The drive can be removed from the drive.
DRIVE_FIXED The disk cannot be removed from the drive.
DRIVE_REMOTE The drive is a remote (network) drive.
DRIVE_CDROM The drive is a CD-ROM drive.
DRIVE_RAMDISK The drive is a RAM disk.
See AlsoGetDiskFreeSpace
0:
showmessage('The drive type cannot be determined');
1:
showmessage('The root directory does not exist');
DRIVE_REMOVABLE:
showmessage('The drive can be removed from the drive.');
DRIVE_FIXED:
Showmessage('The disk cannot be removed from the drive.');
DRIVE_REMOTE:
showmessage('The drive is a remote (network) drive.');
DRIVE_CDROM:
Showmessage('The drive is a CD-ROM drive.');
DRIVE_RAMDISK:
Showmessage('The drive is a RAM disk.');
end;
怎样得到当前计算机的所有驱动器,
例程中定义的一个类型没有
DriveType:TDriveType;
依次用getdrivetype判断
如果有一个驱动器返回值为0后面就不用判断了
LPTSTR lpBuffer // address of buffer for drive strings
);
ParametersnBufferLengthSpecifies the maximum size, in characters, of the buffer pointed to by lpBuffer. This size does not include the terminating null character. lpBufferPoints to a buffer that receives a series of null-terminated strings, one for each valid drive in the system, that end with a second null character. The following example shows the buffer contents with <null> representing the terminating null character. c:\<null>d:\<null><null>
Return ValuesIf the function succeeds, the return value is the length, in characters, of the strings copied to the buffer, not including the terminating null character. Note that an ANSI-ASCII null character uses one byte, but a Unicode null character uses two bytes.
If the buffer is not large enough, the return value is greater than nBufferLength. It is the size of the buffer required to hold the drive strings.
If the function fails, the return value is zero. To get extended error information, use the GetLastError function.