안녕하십니까.
파일받는 프로그램인데요.
파일을 받을때 ProgressBar를 표시하고 싶은데 어케해야할지 답답하네요.
procedure TForm1.TServerExecute(AThread: TIdPeerThread);
var
Cmd, DateX, SDir : string;
FStream : TFileStream;
Buff : array[0..BuffSize - 1] of Char;
CopySize : Integer;
begin
SDir := Edit3.Text;
try
CopySize := 0;
AThread.Connection.ReadBuffer(Rec, Sizeof(Rec));
if(FileExists(SDir + Trim(Rec.MyString))) then DeleteFile(SDir + Trim(Rec.MyString));
FStream := TFileStream.Create(SDir + Trim(Rec.MyString), fmCreate);
while True do
begin
AThread.Connection.ReadStream(FStream, -1, True);
FStream.Destroy;
Break;
end;
except
FStream.Destroy;
AThread.Connection.Destroy;
end;
end;