驱动器类型的识别

ether 2000-12-28 04:44:00
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
d: Char;
s: String;
begin
for d:='A' to 'Z' do
begin
s := d + ': ';
case GetDriveType(PChar(d + ':.')) of
// 0: s := s + 'The drive type cannot be determined.';
// 1: s := s + 'The root directory does not exist.';
DRIVE_REMOVABLE: s := s + 'The drive can be removed from the drive.';
DRIVE_FIXED: s := s + 'The disk cannot be removed from the drive.';
DRIVE_REMOTE: s := s + 'The drive is a remote (network) drive.';
DRIVE_CDROM: s := s + 'The drive is a CD-ROM drive.';
DRIVE_RAMDISK: s := s + 'The drive is a RAM disk.';
else
// s := s + 'Unknown!!!!!!';
end;
if Length(s)>3 then
Memo1.Lines.Add(s);
end;
end;

end.
...全文
124 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
The_east_key 2000-12-29
  • 打赏
  • 举报
回复
建议您访问www.etechbase.net/tech,里面有很多资料,也许可以解决您的问题。
访问http://168.168.18.11:81/etechbase/advsearch.php将您的问题输入查询内容框,选择不同的精确程度,即可以找到你所需要的答案。效果还是可以的。

828

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧