Q&A

  • [초특급질문]FileListBox에서 파일을 읽고 다운로드 해야 하는데..
==================================================================================

procedure TForm1.StartUp;

begin

NMFTP1.Host := 'hostip';

NMFTP1.Port := 21;

NMFTP1.Timeout := 0;

NMFTP1.UserID := 'userid';

NMFTP1.Password := 'pw';

try

NMFTP1.Connect;



except

On E:Exception do

if E.message='something'

then writeln('poo');

end;

//NMFTP1.List;

NMFTP1.Nlist;

//NMFTP1.Download((to_date + IntToStr(cnt)+'.txt'), ('C:A' + (to_date + IntToStr(cnt))+ '.txt'));

end;



procedure TForm1.NMFTP1ListItem(Listing: String);

begin

FileListBox1.Items.Add(Listing);

end;



procedure TForm1.TimerInterfaceTimer(Sender: TObject);

var

license,name: String;

//cnt: Integer;

begin

//cnt := 0;

TimerInterface.Enabled :=false;

TimerInterface.Interval := 30000; //30초 단위

Increase;

TimerInterface.Enabled :=True;

end;//procedure TForm1.TimerInterfaceTimer(Sender: TObject);



procedure TForm1.Increase; -------------------------|

var |

i: Integer; |

begin | 이부분에서

With ListBox1 | 이렇게하면

begin | ListBox에 있는 파일들을

for i := 0 to (ListBox1.Items.Count-1) | FTP의서버폴더에서

begin | 텍스트파일을

NMFTP1.Download(ListBox1.Items.Strings[i], 'C:A'+ ListBox1.Items.Strings[i]); | 다운을 받아

DbTry; | 작업이 수행

except begin | 되는지

StatusBar1.SimpleText := 'Downloading~'; | 궁금합니다.

end; | 잘 안되네요...^^;

end; |

end; ---- ---------------------------------------------|



procedure TForm1.DbTry;

begin

If FileExists('C:A' + ListBox1.Items.Strings[i]) = True Then

begin

AssignFile(Reader,'C:A' + ListBox1.Items.Strings[i]);

Reset(Reader);

Readln(Reader,S);

end

//Showmessage('연결이 되었으니 작업을 합니다.');

end;



end.

==================================================================================

다운받으면 그 파일을 차례대로 읽어와서 디비에 넣는건데요!!

파일을 디비에 넣는건 잘 되는데요!!

FileListBox에있는 파일을 차례로 다운을 받을려고 하는데 계속 안되고 있네요!!

고수님들 좀 갈켜 주세요!!

FileListBox의 내용을 배열로 선언해서리 다운로드 받고 싶은데....잘 안되요!!

좀 구해 주세요!!! 살려 주세요!!! 헬~~푸!!!

0  COMMENTS