取当前可用驱动器
我想获得当前机器,可用的盘符急啊急 先回复的给分了啊高手们
我想获得当前机器,可用的盘符急啊急 先回复的给分了啊高手们
解决方案 »
- 求教SQL子查询的问题
- 求调用必须独立运行的.exe程序的方法
- 求教:ReportBuilder 打印过纸(走纸)的问题
- 怎么从一个txt文件按格式读出数据
- sp_attach_db?
- 求解数学题??? 假设有2000万美圆 = 1.6亿人民币,每建设一个希望学校要花20万人民币,请可以建设多少个学校???
- 如何把浮点型转换为整型?
- 新手想咨询的一个问题,请大家都进来看看。在线等待.
- delphi的DLL如何调用某个BPL中的窗体。
- 我现在急需找到windows环境下对modem编程的方案及编程资料,最好有相关的API资料或提供有关书籍信息.
- 继续:放分*多分=人气
- 如何获得数据库BDE的系统信息
function myGetLogicalDrives : String;
var
drives : set of 0..25;
drive : integer;
begin
Result := '';
DWORD( drives ) := Windows.GetLogicalDrives;
for drive := 0 to 25 do
if drive in drives then
Result := Result + Chr( drive + Ord( 'A' ));
end;
*********************
取的有效驱动器
API函数DWORD GetLogicalDrives(VOID);
DWORD GetLogicalDriveStrings(
DWORD nBufferLength, // size of buffer
LPTSTR lpBuffer // drive strings buffer
);
UINT GetDriveType(
LPCTSTR lpRootPathName // root directory
);
******************
AvailableDrives :dword;
AvailableDrives := GetLogicalDrives;
for i:= 0 to 25 do
if GetBit(AvailableDrives,i+1)=1 then//如果驱动器存在
begin
DrivePath:=Char(Ord('A')+i)+':\';
case GetDriveType(pchar(DrivePath)) of
DRIVE_FIXED :....//如果是硬盘
DRIVE_......
end;
end;
var
drives : set of 0..25;
drive : integer;
begin
Result := '';
DWORD( drives ) := Windows.GetLogicalDrives;
for drive := 0 to 25 do
if drive in drives then
Result := Result + Chr( drive + Ord( 'A' ));
end;