감사합니다. 올리자 마자 답변이 올라왔더군요.
글을 읽어보니... 정말 친절하게 써주셨더군요..
친절에 감사드립니다.
저도 답을 구해서 글을 올립니다..
var
// 드라이브정보 변수
drv : String;
dType : Integer;
SectPerCls, BytesPerCls, FreeCls, TotCls : DWord;
procedure TForm1.Button1Click(Sender: TObject);
var x : Boolean;
begin
drv := Edit1.Text;
// 드라이브타입 정보얻기
dType := GetDriveType(Pchar(drv));
case dType of
0 : TypeLabel.Caption := 'Unable to Determine';
1 : TypeLabel.Caption := 'Does not exist';
DRIVE_REMOVABLE : TypeLabel.Caption := 'Removable Drive (Floppy)';
DRIVE_FIXED : TypeLabel.Caption := 'Fixed Disk';
DRIVE_REMOTE : TypeLabel.Caption := 'Remote or Network Drive';
DRIVE_CDROM : TypeLabel.Caption := 'CD-ROM Drive';
DRIVE_RAMDISK : TypeLabel.Caption := 'RAM Drive';
end;
// 선택된 드라이브의 총용량, 남은용량계산
GetDiskFreeSpace(PChar(drv), SectPerCls, BytesPerCls, FreeCls, TotCls);
TSpace.Caption := FormatFloat('0.00', (SectPerCls * BytesPerCls *
TotCls)/1000000) + ' MB';
FSpace.Caption := FormatFloat('0.00', (SectPerCls * BytesPerCls *
FreeCls)/1000000) + ' MB';
end;
procedure TForm1.Button2Click(Sender: TObject);
var x : cardinal;
begin
x := GetFreeSpace(0);
ShowMessage('현재 하드디스크의 여유공간은 ' + intTostr(x) + ' Bytes 입니다.');
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Application.Terminate; // close;
end;
end.
|