Unit1.cpp
上传用户:lhxd_sz
上传日期:2014-10-02
资源大小:38814k
文件大小:1k
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- AnsiString root;
- int nn;
- root=Edit1->Text;
- nn=GetDriveType(root.c_str());
- switch(nn)
- {
- case 0:
- ShowMessage("无法检测到该驱动器");
- break;
- case 1:
- ShowMessage("根目录不存在");
- break;
- case DRIVE_REMOVABLE:
- ShowMessage("可移动盘");
- break;
- case DRIVE_FIXED:
- ShowMessage("固定盘");
- break;
- case DRIVE_REMOTE:
- ShowMessage("远程网络盘");
- break;
- case DRIVE_CDROM:
- ShowMessage("CD_ROM");
- break;
- case DRIVE_RAMDISK:
- ShowMessage("RAM盘");
- break;
- default:
- break;
- }
-
- }
- //---------------------------------------------------------------------------
-