Q&A

  • [재질문]누가 좀 봐 주시면 안되나요...NMFTP관련..[재질문]
소스 밑부분에 내용이 있으니깐 조언 좀 부탁드립니다...

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

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 do

begin

for i := 0 to (ListBox1.Items.Count-1)

begin

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

NMFTP1.Delete(ListBox1.Items.Strings[i]); <===이부분이 에러가 납니다...그럼 Delete함수는 어디에 넣어 주어야 합니까?

그리고 Delete함수에 이렇게ListBox1.Items.Strings[i] 표시 하면 안됩니까?

DbTry;

except begin

StatusBar1.SimpleText := 'Downloading~';

end;

end;

end;



procedure TForm1.DbTry;

begin

for i := 0 to (ListBox1.Items.Count-1) do <==== 이부분도 좀 맞는지 갈켜 주세요!! 이렇게 loop돌리면 되나요??

위에서 에러가 나니깐 이부분이 어찌 되는지....??? ㅡ.ㅡ;;

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

/////디비에 텍스트 파일 라인별로 읽어서리 작업을 합니다..////

end;

end;



end.

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

모르는 부분을 화살표로 해놨습니다... 꼭 고수님들 좀 봐주세요!!!!

초보에게 등불이~~!!



1  COMMENTS
  • Profile
    홍성락 2001.11.01 23:10
    델초짜임다...... wrote:

    > 소스 밑부분에 내용이 있으니깐 조언 좀 부탁드립니다...

    > ==================================================================================

    > 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 do

    > begin

    > for i := 0 to (ListBox1.Items.Count-1)

    > begin

    > NMFTP1.Download(ListBox1.Items.Strings[i], 'C:A'+ ListBox1.Items.Strings[i]);

    > NMFTP1.Delete(ListBox1.Items.Strings[i]); <===이부분이 에러가 납니다...그럼 Delete함수는 어디에 넣어 주어야 합니까?

    > 그리고 Delete함수에 이렇게ListBox1.Items.Strings[i] 표시 하면 안됩니까?

    > DbTry;

    > except begin

    > StatusBar1.SimpleText := 'Downloading~';

    > end;

    > end;

    > end;

    >

    > procedure TForm1.DbTry;

    > begin

    > for i := 0 to (ListBox1.Items.Count-1) do <==== 이부분도 좀 맞는지 갈켜 주세요!! 이렇게 loop돌리면 되나요??

    > 위에서 에러가 나니깐 이부분이 어찌 되는지....??? ㅡ.ㅡ;;

    > 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

    > /////디비에 텍스트 파일 라인별로 읽어서리 작업을 합니다..////

    > end;

    > end;

    >

    > end.

    > ==================================================================================

    > 모르는 부분을 화살표로 해놨습니다... 꼭 고수님들 좀 봐주세요!!!!

    > 초보에게 등불이~~!!

    //////////////////////////////////////////////////////////////////////////////////

    그냥 조금 궁금하고 도와주고싶어도 잘몰라 몇가지 말씀드릴까함니다.

    1번 문제는 타이머가 30초 간격으로 실행하게하셨는데요

    ListBox1에 지운 파일명도 지워야 할것 같구요

    DbTry함수내 또 ListBox1내용을 검토하던데

    이함수 인자를 만들어 호출하시죠.

    procedure TForm1.DbTry(ii : integer);