ftp em listbox
caros amigos estou precisando de ajuda para fazer o programa de ftp em um listbox ou memo eu fiço um usando um edit para enviar e outro para recebe so que agora tenho que faze-lo em listbox ou memo so que eu não me lembro como fazer para o NMFTP receber os arquivo que eu selecionar no listbox ou memo, ou melho dizendo não estou lembrando de nada...srrsrsr se alguem ajudar eu agradeço... estou usando os compomentes da paleta SASTNET..
MUITO OBRIGADO..
MUITO OBRIGADO..
Emerson1
Curtidas 0
Respostas
Emerson1
25/11/2005
:( alguem tem alguma ajuda.......muito obrigado
GOSTEI 0
Emerson1
25/11/2005
:shock: e ja vi que ftp são poucos a pessoas que sabe...mas mesmo assim valeu pessoal.......emerson
GOSTEI 0
Emerson1
25/11/2005
depois de muito sura eu consegui achar ....se alguem precisar vai ai a dica
*****
procedure TFrmftp.BitBtn1Click(Sender: TObject);
begin
//para enviar
IF ListBox2.ItemIndex >= 0 then BEGIN
RemoteFile:= ListBox2.Items.Strings[ListBox2.ItemIndex];
LocalFile := ´C:\´ + RemoteFile;
NMFTP1.Upload(LocalFile, RemoteFile);
BitBtn8.Enabled := True;
END
ELSE BEGIN
Application.MessageBox (´NENHUM ARQUIVO SELECIONADO..!´,´EMERSON´, MB_OK + MB_ICONINFORMATION);
//para receber
procedure TFrmftp.BitBtn10Click(Sender: TObject);
begin
IF ListBox1.ItemIndex >= 0 then BEGIN
remoteFile2:= ListBox1.Items.Strings[ListBox1.ItemIndex];
localfile2 := ´C:\´+ RemoteFile2;
NMFTP1.Download(remotefile2,localfile2);
BitBtn8.Enabled := True;
END
ELSE BEGIN
Application.MessageBox (´NENHUM ARQUIVO SELECIONADO..!´,´EMERSON´, MB_OK + MB_ICONINFORMATION);
END;
//cria as variaveis remoteFile2,localfile2,remoteFile,localfile: string
espero ajudar alguem ......agora vou tenta descobrir como faço para envia ou receber mais de um arquivo no listbox(itemindex)..
*****
procedure TFrmftp.BitBtn1Click(Sender: TObject);
begin
//para enviar
IF ListBox2.ItemIndex >= 0 then BEGIN
RemoteFile:= ListBox2.Items.Strings[ListBox2.ItemIndex];
LocalFile := ´C:\´ + RemoteFile;
NMFTP1.Upload(LocalFile, RemoteFile);
BitBtn8.Enabled := True;
END
ELSE BEGIN
Application.MessageBox (´NENHUM ARQUIVO SELECIONADO..!´,´EMERSON´, MB_OK + MB_ICONINFORMATION);
//para receber
procedure TFrmftp.BitBtn10Click(Sender: TObject);
begin
IF ListBox1.ItemIndex >= 0 then BEGIN
remoteFile2:= ListBox1.Items.Strings[ListBox1.ItemIndex];
localfile2 := ´C:\´+ RemoteFile2;
NMFTP1.Download(remotefile2,localfile2);
BitBtn8.Enabled := True;
END
ELSE BEGIN
Application.MessageBox (´NENHUM ARQUIVO SELECIONADO..!´,´EMERSON´, MB_OK + MB_ICONINFORMATION);
END;
//cria as variaveis remoteFile2,localfile2,remoteFile,localfile: string
espero ajudar alguem ......agora vou tenta descobrir como faço para envia ou receber mais de um arquivo no listbox(itemindex)..
GOSTEI 0
Kitsystem
25/11/2005
No Indy tem um exemplo pronto de FTP, qq coisa de uma olhada no site do fabricante, mas é praticamente o mesmo que vc fez
GOSTEI 0