请问如何取得计算机内所有盘符?
最好可以知道某某是软盘,某某是移动盘,某某是硬盘(又分主盘和从盘)
谢谢
最好可以知道某某是软盘,某某是移动盘,某某是硬盘(又分主盘和从盘)
谢谢
解决方案 »
- 枚举子窗口,进行不下去了
- 怎么查询不重复的记录
- 两个BMP图片,大的图片作背景,小的图片叠在其上面,如何在背景图片上截取小图片面积一样大小的一块呢?
- ShellListView如何根据特定文件后缀名字过滤显示好像没有找到这个属性
- 又是菜鸟问题?
- 是不是用ADO连接数据库,就不能显示货币符号了?
- 如何在程序中获得鼠标的位置?
- 怎么实现像网络邻居中的IP地址的输入一样的edit控件(再现等待)
- 问个最幼稚的问题,怎样用opendialog控件来得到文件名,假如我想通过选择来得到c:\aa.doc的文件名,让a的值等于c:\aa.doc,看我的代码有
- 解决重大技术问题! 高手请进!!!一定继续加分
- 在delphi上如何用ie打开特定的网页
- 如何通过句柄得到类名??请教高手!
Windows.PasSyntax
GetDriveType(
lpRootPathName: PChar {a pointer to the root path string}
): UINT; {returns a value based on the drive type}Description
GetDriveType is used to determine the type of drive being accessed, and will indicate fixed, removable, or remote (network) drives.Parameters
lpRootPathName: A null terminated string containing the root directory of the drive to be queried. If this parameter is NIL, the function uses the root of the current directory.Return Value
If the function is successful, it returns one value, otherwise it returns DRIVE_UNKNOWN.The Tomes of Delphi 3: Win32 Core API Help File by Larry Diehlprocedure TForm1.DriveComboBox1Change(Sender: TObject);
var
DrivePath: array[0..3] of char; // holds the root directory to query
begin
{assemble the name of the root path of the drive to query}
StrPCopy(DrivePath, DriveComboBox1.Drive);
StrCat(DrivePath, ':\'); {retrieve the drive type and display it}
case GetDriveType(DrivePath) of
DRIVE_UNKNOWN: Panel1.Caption := 'No Type Information'; DRIVE_NO_ROOT_DIR: Label1.Caption := 'Root Directory does not exist';
DRIVE_REMOVABLE: Panel1.Caption := 'Removable';
DRIVE_FIXED: Panel1.Caption := 'Fixed';
DRIVE_REMOTE: Panel1.Caption := 'Remote';
DRIVE_CDROM: Panel1.Caption := 'CDROM';
DRIVE_RAMDISK: Panel1.Caption := 'RamDisk';
end;
end;The Tomes of Delphi 3: Win32 Core API Help File by Larry Diehl