发信人: mendy.bbs@bbs.nju.edu.cn (孟迪), 信区: cnprogram
标 题: How to tell what kind of drive is used
发信站: nju_bbs (Sun Apr 19 09:20:17 1998)
转信站: Lilac!ustcnews!nju_bbs
发信人: njhe (he要破产), 信区: RAD
标 题: How to tell what kind of drive is used.
发信站: '3m紫金飞鸿m' (Mon Mar 9 18:08:48 1998) , 站内信件
Product: Delphi
Version: All
Platform: Windows/Win32
When dealing with multiple drives, it is helpful to know
whether a drive is associated with a is attached to a letter
(A, B, C, etc), and what its type is. This code uses the API
GetDriveType function to do that.
function ShowDriveType(DriveLetter: char): string;
var
i: word;
begin
if DriveLetter in ['A'..'Z'] then {Make it lower case.}
DriveLetter := chr(ord(DriveLetter) + $20);
i := GetDriveType(ord(DriveLetter) - ord('a'));
case i of
DRIVE_REMOVABLE: result := 'floppy';
DRIVE_FIXED: result := 'hard disk';
DRIVE_REMOTE: result := 'network drive';
else result := 'does not exist';
end;
end;
--
不惜一切代价,达到修炼的真义。
遇神阻则弑神,遇佛阻则弑佛。
m;31m※ 来源:·紫金飞鸿 bbs.njupt.edu.cn·[FROM: 202.119.236.104]m
--
※ 来源:.南大小百合信息交换站 bbs.nju.edu.cn.[FROM: a507yjh.nju.edu]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.124毫秒