B
bbcock
Unregistered / Unconfirmed
GUEST, unregistred user!
如何把FTP上传这个事件写在线程里?如果一次传多个文件怎么办?
这个上传用的是WIN32 INTERNET API
procedure TForm1.btnUploadClick(Sender: TObject);
var
RemoteFile: String ;
LocalFile: String ;
sFile: String ;
FTPPath: String ;
i: integer ;
blnReturn: boolean ;
dwInternetFlags: DWORD ;
begin
if (hConnect <> nil) then
begin
FTPPath := GetFTPDirectory(hConnect) ;
SFILE(要上传的文件名)
LocalFile := localDir + sFile ;
RemoteFile := FTPPath + sFile ;
StatusBar1.Panels[0].Text := 'Uploading' ;
blnReturn := FtpPutFile(hConnect,
pchar(LocalFile),
pchar(RemoteFile),
dwInternetFlags,
$0) ;
end ;
end ;
end;
这个上传用的是WIN32 INTERNET API
procedure TForm1.btnUploadClick(Sender: TObject);
var
RemoteFile: String ;
LocalFile: String ;
sFile: String ;
FTPPath: String ;
i: integer ;
blnReturn: boolean ;
dwInternetFlags: DWORD ;
begin
if (hConnect <> nil) then
begin
FTPPath := GetFTPDirectory(hConnect) ;
SFILE(要上传的文件名)
LocalFile := localDir + sFile ;
RemoteFile := FTPPath + sFile ;
StatusBar1.Panels[0].Text := 'Uploading' ;
blnReturn := FtpPutFile(hConnect,
pchar(LocalFile),
pchar(RemoteFile),
dwInternetFlags,
$0) ;
end ;
end ;
end;