기억력 나쁜 내가 또 까먹고 indy 업데이트 할까봐 급히 메모..
IdFTP.pas 수정하면 됨.
1) TIdFTP = class(TIdExplicitTLSClient)에 프로퍼티 하나 만들고
FUTFMode: boolean;
property UTFMode : boolean read FUTFMode write FUTFMode;
2) 소스 수정
procedure TIdFTP.List(ADest: TStrings; const ASpecifier: string = ''; ADetails: Boolean = True); {do not localize}
var
LDest: TMemoryStream;
LTrans : TIdFTPTransferType;
begin
if ADetails and UseMLIS and FCanUseMLS then begin
ExtListDir(ADest, ASpecifier);
Exit;
end;
LTrans := TransferType;
if LTrans <> ftASCII then begin
Self.TransferType := ftASCII;
end;
try
LDest := TMemoryStream.Create;
try
InternalGet(Trim(iif(ADetails, 'LIST', 'NLST') + ' ' + ASpecifier), LDest); {do not localize}
FreeAndNil(FDirectoryListing);
LDest.Position := 0;
if FUTFMode then
begin
{$IFDEF HAS_TEncoding}
FListResult.LoadFromStream(LDest, IOHandler.DefStringEncoding);
{$ELSE}
FListResult.Text := ReadStringFromStream(LDest, -1, IOHandler.DefStringEncoding);
{$ENDIF}
end
else
begin
{$IFDEF HAS_TEncoding}
FListResult.LoadFromStream(LDest, TEncoding.GetEncoding(949));
{$ELSE}
FListResult.Text := ReadStringFromStream(LDest, -1, TEncoding.GetEncoding(949));
{$ENDIF}
end;
with TIdFTPListResult(FListResult) do begin
FDetails := ADetails;
FUsedMLS := False;
end;
finally
FreeAndNil(LDest);
end;
if ADest <> nil then begin
ADest.Assign(FListResult);
end;
DoOnRetrievedDir;
finally
if LTrans <> ftASCII then begin
TransferType := LTrans;
end;
end;
end;
'삽질 > Delphi' 카테고리의 다른 글
[Delphi] 작업표시줄 시계부분 위치찾기 (0) | 2013.07.30 |
---|---|
[Delphi] 작업표시줄 위치 찾기 (0) | 2013.07.22 |
[Delphi] StringGrid - Mouse move Cell hint (0) | 2012.01.11 |
[Delphi] 문자열의 너비 구하기 (0) | 2012.01.11 |
[Delphi] Socket Error (1) | 2011.08.31 |
댓글