Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[6822] [감사] AMECS님감사합니다/저도 값을 구했습니다.
hk4801 [ ] 745 읽음    1999-11-21 01:04
감사합니다. 올리자 마자 답변이 올라왔더군요.

글을 읽어보니... 정말 친절하게 써주셨더군요..

친절에 감사드립니다.


저도 답을 구해서 글을 올립니다..
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.


+ -

관련 글 리스트
6822 [감사] AMECS님감사합니다/저도 값을 구했습니다. hk4801 745 1999/11/21
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.