'2015/09'에 해당되는 글 2건

  1. 2015.09.14 FTP 파일 전송
  2. 2015.09.08 클래스명 string으로 해당 클래스 호출하기
2015. 9. 14. 11:54

function TForm1.PutFileFtpSvr(srcfile, destfile: String): Boolean;

begin

   result := true;


   If IdFTP1.Connected Then IdFTP1.Disconnect;

   IdFTP1.Host := 'localhost';

   IdFTP1.Port := StrToInt('21');

   IdFTP1.Username := 'newkie';

   IdFTP1.Password := 'newkie';

   Try

      IdFTP1.Connect;

      IdFTP1.ChangeDir('/qcdata/app001');

      IdFTP1.TransferType := ftBinary;

      IdFTP1.Passive := True;

      IdFTP1.Put(srcfile, destfile);

      Except On E: Exception Do

      Begin

         IdFTP1.Disconnect;

         showMessage('FTP err' + E.ToString);

         result := false;

         Exit;

      End;

   End;

End;


윈도우즈에서는 IdFTP1.Passive := True; 이 없어도 되던데


모바일에서는 해당 라인이 있어야 파일 전송 성공.


이유는 모름...

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

연말정산간소화  (0) 2016.08.29
델파이 푸시  (0) 2015.10.15
클래스명 string으로 해당 클래스 호출하기  (0) 2015.09.08
Posted by newkie
2015. 9. 8. 13:47

var

fnm: String;

i: Integer;

tmpForm: TCommonCustomForm;

begin

tmpForm := nil;

for i :=0 to Screen.FormCount -1 do

begin

if Screen.Forms[i].Name = fnm then

begin

tmpForm := Screen.Forms[i];

break;

end;

end;

if tmpForm <> nil then

begin

tmpForm.Show;

end

else

begin

showMessage('No Class');

end;

end;

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

연말정산간소화  (0) 2016.08.29
델파이 푸시  (0) 2015.10.15
FTP 파일 전송  (0) 2015.09.14
Posted by newkie