유돌이

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Notice

2008. 12. 24. 17:59 델파이

//[함수 구현 부분]

 

function DownloadFile(SourceFile, DestFile: string): Boolean;
begin
  try
  Result := UrlDownloadToFile(nil, PChar(SourceFile), PChar(DestFile), 0, nil) = 0;
  except
  Result := False;
  end;
end;

// [함수 호출 부분~]

 

// 다운로드할 URL 경로
SourceFile = 'http://.../SB_DB.txt';
// 저장할 파일의 경로
DestFile = 'c:\SB_DB.txt';

if DownloadFile(SourceFile, DestFile) then begin
    ShowMessage('Download succesful!');
    ShellExecute(Application.Handle, PChar('open'), PChar(DestFile),
    PChar(''), nil, SW_NORMAL)
  end else begin
    ShowMessage('Error while downloading ' + SourceFile)
  end;

'델파이' 카테고리의 다른 글

키보드 이벤트[keybd_event  (0) 2008.12.24
레지스트리 값 읽고 쓰기  (0) 2008.12.24
TWebBrowser 에서 텍스트 형태 바꾸기  (0) 2008.12.24
델파이 자료형~!  (0) 2008.12.24
문자열 관련 함수  (0) 2008.12.24
posted by 유돌이