全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:4729
推到 Plurk!
推到 Facebook!

ind10 IdTcpServer 与IdTcpClient文件传输Demo

 
zhweizw
一般會員


發表:7
回覆:16
積分:9
註冊:2008-01-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2010-08-04 17:08:48 IP:58.218.xxx.xxx 訂閱
Server端代码:
[code delphi]
unit UntMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, ComCtrls, XPMan, ExtCtrls, StdCtrls, Menus, IdContext,
IdScheduler, IdSchedulerOfThread, IdSchedulerOfThreadDefault, IdBaseComponent,
IdComponent, IdCustomTCPServer, IdTCPServer, ImgList,IdGlobal, UntGlb ,IOUtils,IdThread,
RibbonLunaStyleActnCtrls,ABOUT, ToolWin, PlatformDefaultStyleActnCtrls,
ActnPopup, ExtDlgs ;
type
TForm1 = class(TForm)
trycn1: TTrayIcon;
xpmnfst1: TXPManifest;
stat1: TStatusBar;
grp1: TGroupBox;
grp2: TGroupBox;
mmo1: TMemo;
mm1: TMainMenu;
N1: TMenuItem;
N3: TMenuItem;
N2: TMenuItem;
N4: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
il1: TImageList;
idtcpsrvr1: TIdTCPServer;
idschdlrfthrdflt1: TIdSchedulerOfThreadDefault;
N5: TMenuItem;
BalloonHint1: TBalloonHint;
PopActMemo: TPopupActionBar;
NClear: TMenuItem;
N6: TMenuItem;
NSave: TMenuItem;
PopActBall: TPopupActionBar;
N9: TMenuItem;
N11: TMenuItem;
mniN10: TMenuItem;
mniN11: TMenuItem;
mniN12: TMenuItem;
il3: TImageList;
dlgSave1: TSaveTextFileDialog;
lv1: TListView;
il2: TImageList;
procedure N11Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure WndProc(var Msg:TMessage);override;
procedure N14Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure idtcpsrvr1Execute(AContext: TIdContext);
procedure FormCreate(Sender: TObject);
procedure idtcpsrvr1Connect(AContext: TIdContext);
procedure idtcpsrvr1Disconnect(AContext: TIdContext);
procedure AddList(Acontext:TIdContext);
procedure DelList(Acontext:TIdContext);
procedure UpdSta;
procedure WMUSERMSG(var msg:TMessage); message WM_USERMSG;
procedure WMUSERFILE(var msg:TMessage);message WM_USERFILE;
procedure N5Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure DisConnectAllClient;
procedure N8Click(Sender: TObject);
procedure N9click(Sender:Tobject);
procedure mniN11Click(Sender: TObject);
procedure mniN12Click(Sender: TObject);
procedure trycn1DblClick(Sender: TObject);
procedure PopActMemoPopup(Sender: TObject);
procedure NClearClick(Sender: TObject);
procedure NSaveClick(Sender: TObject);
procedure dlgSave1CanClose(Sender: TObject; var CanClose: Boolean);
procedure FormDestroy(Sender: TObject);
procedure lv1SelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
procedure lv1ItemChecked(Sender: TObject; Item: TListItem);
private
{ Private declarations }
//定义一个私有成员,保存连接对象AContext(ListView控件Items成员没有AdddObject方法,无法保存对象)
FStrings:TStrings;
str:string;
public
{ Public declarations }
end;
//这里声明一个自定义类,在Form.Create方法里面使用
type
TMyContextClass = class(TIdServerContext)
ClientInfo:TClientInfo;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMUSERFILE(var msg: TMessage);
var
FContext:TIdContext;
ClientIP:string;
begin
FContext := TMyContextClass(msg.LParam);
ClientIP := FContext.Binding.PeerIP;
with mmo1.Lines do begin
case msg.WParam of
0: Add(format('【客户端:%s】正在接收文件: %s--%s',[ClientIP,str,DateTimeToStr(Now)]));
1: Add(Format('【客户端:%s】文件: %s 接收完毕--%s',[ClientIP,str,DateTimeToStr(Now)]));
2: Add(Format('【客户端:%s】用户终止文件: %s 传送--%s',[ClientIP,str,DateTimeToStr(Now)]));
end;
end;
end;
procedure TForm1.WMUSERMSG(var msg: TMessage);
begin
if Msg.Msg = WM_USERMSG then
begin
case msg.WParam of
ADD_LIST : AddList(TMyContextClass(msg.LParam));
DEL_LIST : DelList(TMyContextClass(msg.LParam));
end;
stat1.Panels[1].Text := Format('%s%d',[stutext,lv1.Items.Count]);
end;
end;
procedure TForm1.WndProc(var Msg:TMessage);
begin
if ((Msg.Msg = WM_SYSCOMMAND) and (msg.WParam = SC_CLOSE)) or
((Msg.Msg = WM_SYSCOMMAND)and(msg.WParam = SC_MINIMIZE)) then
begin
Msg.Msg := 0;
N11.Click;
end;
inherited;
end;
procedure TForm1.AddList(Acontext: TIdContext);
begin
with lv1.Items.Add do
begin
Caption :=Acontext.Binding.PeerIP;
ImageIndex :=0;
SubItems.Add(TMyContextClass(AContext).ClientInfo.ClientName);
SubItems.Add(DatetimeToStr(Now));
end;
FStrings.AddObject('object',Acontext);
mmo1.Lines.Add(Format('客户端【%s,%s】连接到服务器--%s',[AContext.Binding.PeerIP,TMyContextClass(AContext).ClientInfo.ClientName,DatetimeToStr(Now)]));
end;

procedure TForm1.DelList(Acontext: TIdContext);
var
i:Integer;
begin
// lst1.Items.Delete(lst1.Items.IndexOfObject(Acontext));
i:= FStrings.IndexOfObject(Acontext);
FStrings.Delete(i);
lv1.Items.Delete(i);
mmo1.Lines.Add(Format('客户端【%s,%s】从服务器断开--%s',[AContext.Binding.PeerIP,TMyContextClass(AContext).ClientInfo.ClientName,DatetimeToStr(Now)]));
end;
procedure TForm1.DisConnectAllClient;
var
i:Integer;
begin
for i := 0 to FStrings.Count - 1 do begin
TMyContextClass(FStrings.Objects[i]).Connection.Disconnect;
end;
end;
procedure TForm1.dlgSave1CanClose(Sender: TObject; var CanClose: Boolean);
var
h:Integer;
begin
CanClose := False;
if FileExists(dlgSave1.FileName) then begin
if MessageDlg(Format('文件%s已存在,要替换吗?',[dlgSave1.FileName]),mtInformation,[mbYes,mbNo],0)=mrYes then
begin
DeleteFile(dlgSave1.FileName);
h:=FileCreate(dlgSave1.FileName);
FileClose(h);
CanClose := True;
end;
end else begin
h:=FileCreate(dlgSave1.FileName);
FileClose(h);
CanClose := True;
end;
end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose := False;
DisConnectAllClient;
CanClose := True;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
path:string;
begin
//这里重新赋值 idtcpsrvr1.ContextClass属性。在Context被创建时,将以 TMyContextClass 类来创建。
//TIdListenerThread.LContext := Server.FContextClass.Create(LPeer, LYarn, Server.Contexts);
//详见IdCustomTcPServer.pas单元956行
idtcpsrvr1.ContextClass := TMyContextClass;
FStrings := TStringList.Create;
lv1.Checkboxes := True;
path:=ExtractFilePath(ParamStr(0)) REV;
if not DirectoryExists(path) then TDirectory.CreateDirectory(path);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FStrings.Free;
end;
procedure TForm1.idtcpsrvr1Connect(AContext: TIdContext);
//这里不能直接操作VCL控件,OnConnect,OnDisConnect,OnException,OnExecute都是在线程里面执行
//要采取SendMessage发送消息通知主线程操作VCL的方法才是可取的;
//详见IdCustomTcPServer.pas单元961-964行
begin
// TMyContextClass(AContext).ClientInfo.ClientIP := AContext.Binding.PeerIP;
// SendMessage(Handle,WM_USERMSG,ADD_LIST,LongInt(AContext )); //通知主线更新VCL控件
end;
procedure TForm1.idtcpsrvr1Disconnect(AContext: TIdContext);
begin
SendMessage(Handle,WM_USERMSG ,DEL_LIST,LongInt(AContext)); //通知主线更新VCL控件
end;
procedure TForm1.idtcpsrvr1Execute(AContext: TIdContext);
var
Buf:TDataPack;
BByte:TIdBytes;
path:string;
Files:string;
h,Received:Integer;
begin
//接收文件存入当前程序REV子目录下
path := ExtractFilePath(Application.ExeName) REV '\';
while AContext.Connection.Connected do begin
AContext.Connection.IOHandler.ReadBytes(BByte,SizeOf(buf),False);
BytesToRaw(BByte,buf,SizeOf(Buf));
case Buf.Command of
cmdSetName:
begin
with TMyContextClass(AContext).ClientInfo do begin
ClientName :=Buf.ClientInfo.ClientName;
ClientIP :=Buf.ClientInfo.ClientIP;
end;
SendMessage(Handle,WM_USERMSG,ADD_LIST,LongInt(AContext ));
end;
cmdSendFile:
begin
Files := path Buf.FileName;
case Buf.Flags of
0: begin
str :=buf.FileName;
SendMessage(Handle,WM_USERFILE,0,LongInt(AContext));
if FileExists(files) then DeleteFile(files);
h:=FileCreate(files,fmOpenReadWrite );
end;
1: h:=FileOpen(files,fmOpenReadWrite );
end;
FileSeek(h,0,2);
FileWrite(h,buf.FileData,Buf.ReadBytes);
Received := GetFileSize(h,nil);
FileClose(h);
if Received = Buf.FileSize then SendMessage(Handle,WM_USERFILE,1,LongInt(AContext));
end;
cmdUserbreak:
begin
SendMessage(Handle,WM_USERFILE ,2,LongInt(AContext));
end;
end;
end;
end;
procedure TForm1.lv1ItemChecked(Sender: TObject; Item: TListItem);
begin
if Item.Checked then N5.Enabled := True else N5.Enabled := False;
end;
procedure TForm1.lv1SelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
begin
if Selected then Item.Checked := True else Item.Checked := False;
end;
procedure TForm1.mniN11Click(Sender: TObject);
begin
AboutBox.ShowModal;
end;
procedure TForm1.mniN12Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.N11Click(Sender: TObject);
begin
if Visible then begin
Visible := False;
trycn1.ShowBalloonHint;
end;
end;
procedure TForm1.N14Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.N9Click(Sender: TObject);
begin
if not Visible then Visible := True
else Visible := False;
end;
procedure TForm1.NClearClick(Sender: TObject);
begin
mmo1.ReadOnly := False;
mmo1.Text := '';
mmo1.ReadOnly := True;
end;
procedure TForm1.NSaveClick(Sender: TObject);
const
LogTxt = '------服务器操作日志------' #13 #10;
var
h:THandle;
TxtFileName:string;
n,m:Integer;
tmp:AnsiString;
begin
if mmo1.Text <>'' then begin
if dlgSave1.Execute then begin
tmp:= LogTxt mmo1.Text;
n:= Length(tmp);
TxtFileName := dlgSave1.FileName;
h:= FileOpen(TxtFileName,fmOpenReadWrite);
m:=FileWrite(h,tmp[1],n);
FileClose(h);
if m=n then ShowMessage('日志保持成功')
else ShowMessage('日志保存失败');
end;
end;
end;
procedure TForm1.PopActMemoPopup(Sender: TObject);
begin
if mmo1.Text <>'' then begin
NClear.Enabled := True;
NSave.Enabled := True;
end else begin
NClear.Enabled := False;
NSave.Enabled := False;
end;
end;
procedure TForm1.trycn1DblClick(Sender: TObject);
begin
N9.Click;
end;
procedure TForm1.N2Click(Sender: TObject);
begin
if N2.Checked then idtcpsrvr1.Active := True
else begin
DisConnectAllClient;
idtcpsrvr1.Active := False;
end;
if idtcpsrvr1.Active then begin
stat1.Panels[0].Text := '服务器开启';
mmo1.Lines.Add(Format('服务器开启--%s',[DateTimeToStr(now)]));
end
else begin
stat1.Panels[0].Text :='服务器关闭';
mmo1.Lines.Add(Format('服务器关闭--%s',[DateTimeToStr(now)]));
end;
end;
procedure TForm1.N5Click(Sender: TObject);
var
i:Integer;
begin
for I := 0 to lv1.Items.Count - 1 do begin
if lv1.Items[i].Checked then begin
TMyContextClass(FStrings.Objects[i]).Connection.Disconnect;
end;
end;
end;
procedure TForm1.N7Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.N8Click(Sender: TObject);
begin
AboutBox.ShowModal;
end;
procedure TForm1.UpdSta;
begin
stat1.Panels[1].Text := StuText IntToStr(lv1.Items.Count);
end;
end.

[/code]

[code delphi]
unit About;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls;

type
TAboutBox = class(TForm)
Panel1: TPanel;
ProgramIcon: TImage;
ProductName: TLabel;
Version: TLabel;
Copyright: TLabel;
Comments: TLabel;
OKButton: TButton;
procedure OKButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
AboutBox: TAboutBox;

implementation
{$R *.dfm}
procedure TAboutBox.OKButtonClick(Sender: TObject);
begin
CloseModal;
end;

end.

[/code]

[code delphi]
object AboutBox: TAboutBox
Left = 200
Top = 108
BorderStyle = bsDialog
Caption = #20851#20110
ClientHeight = 213
ClientWidth = 298
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 8
Top = 8
Width = 282
Height = 161
BevelInner = bvRaised
BevelOuter = bvLowered
ParentColor = True
TabOrder = 0
object ProgramIcon: TImage
Left = 8
Top = 8
Width = 65
Height = 57
Picture.Data = {
07544269746D617076020000424D760200000000000076000000280000002000
0000200000000100040000000000000200000000000000000000100000000000
000000000000000080000080000000808000800000008000800080800000C0C0
C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
FF00000000000000000000000000000000000EE8787878EEEEEEE03F30878EEE
EEE00EE8787878EEEEEEE03F30878EEEEEE00EE8787878EEEEEEE03F30878EEE
EEE00EE8787878EEEEEEE03F30878EEEEEE00887787877788888803F3088787E
EEE00788787878878887803F3088887EEEE00788887888878887803F3088887E
EEE00877888887788888703F308887EEEEE00888777778888888037883088888
8EE007777777777777703787883087777EE00888888888888803787FF8830888
888008888888888880378777778830888880077777777788037873F3F3F87808
88E00888888888803787FFFFFFFF8830EEE00887777778800001111111111100
EEE00888888888888899B999B99999EEEEE00888888888888899B9B99BB9B9EE
EEE0088888888888899BB9BB99BB99EEEEE0078888888888899B999B999999EE
EEE0087788888778899B9B9BB9BB99EEEEE00888778778888E9B9B9BB9999EEE
EEE0088888788888EE9B99B9BB9BEEEEEEE00EE8888888EEEEE999B9999EEEEE
EEE00EEEE888EEEEEEEE99BB999EEEEEEEE00EEEEE8EEEEEEEEEE999B9EEEEEE
EEE00EEEEE8EEEEEEEEEEEE999EEEEEEEEE00EEEEE8EEEEEEEEEEEEE99EEEEEE
EEE00EEEEE8EEEEEEEEEEEEE9EEEEEEEEEE00EEEEE8EEEEEEEEEEEEEEEEEEEEE
EEE00EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE00000000000000000000000000000
0000}
Stretch = True
IsControl = True
end
object ProductName: TLabel
Left = 81
Top = 16
Width = 194
Height = 13
Caption = 'Indy10 IdTcpServer && IdTcpClient Demo'
IsControl = True
end
object Version: TLabel
Left = 81
Top = 40
Width = 60
Height = 13
Caption = 'Version V1.0'
IsControl = True
end
object Copyright: TLabel
Left = 8
Top = 80
Width = 98
Height = 13
Caption = 'Copyright 2010-2015'
IsControl = True
end
object Comments: TLabel
Left = 8
Top = 104
Width = 209
Height = 13
AutoSize = False
Caption = 'By '#33945#38754#20154' QQ: 17561129'
IsControl = True
end
end
object OKButton: TButton
Left = 111
Top = 180
Width = 75
Height = 25
Caption = #30830#23450
Default = True
ModalResult = 1
TabOrder = 1
OnClick = OKButtonClick
end
end

[/code]




編輯記錄
zhweizw 重新編輯於 2010-08-04 17:12:47, 註解 無‧
zhweizw 重新編輯於 2010-08-17 16:51:59, 註解 無‧
zhweizw 重新編輯於 2010-08-17 16:55:35, 註解 無‧
zhweizw
一般會員


發表:7
回覆:16
積分:9
註冊:2008-01-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2010-08-17 16:57:44 IP:58.218.xxx.xxx 訂閱

[code delphi]
object Form1: TForm1
Left = 0
Top = 0
ClientHeight = 495
ClientWidth = 494
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Menu = mm1
OldCreateOrder = False
Position = poDesktopCenter
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnDestroy = FormDestroy
DesignSize = (
494
495)
PixelsPerInch = 96
TextHeight = 13
object stat1: TStatusBar
Left = 0
Top = 476
Width = 494
Height = 19
Panels = <
item
Text = #26381#21153#22120#29366#24577
Width = 80
end
item
Text = #23458#25143#31471#36830#25509#25968#65306'0'
Width = 50
end>
end
object grp1: TGroupBox
Left = 8
Top = 2
Width = 480
Height = 176
Anchors = [akLeft, akTop, akRight]
Caption = #23458#25143#31471
TabOrder = 1
DesignSize = (
480
176)
object lv1: TListView
Left = 3
Top = 16
Width = 474
Height = 157
Anchors = [akLeft, akTop, akRight]
Columns = <
item
AutoSize = True
Caption = 'IP'#22320#22336
MinWidth = 100
end
item
Alignment = taCenter
AutoSize = True
Caption = #35745#31639#26426#21517#31216
MinWidth = 100
end
item
Alignment = taCenter
AutoSize = True
Caption = #36830#25509#26102#38388
MinWidth = 100
end>
MultiSelect = True
ReadOnly = True
SmallImages = il2
TabOrder = 0
ViewStyle = vsReport
OnSelectItem = lv1SelectItem
OnItemChecked = lv1ItemChecked
end
end
object grp2: TGroupBox
Left = 8
Top = 184
Width = 479
Height = 284
Anchors = [akLeft, akTop, akRight, akBottom]
Caption = #26085#24535
TabOrder = 2
DesignSize = (
479
284)
object mmo1: TMemo
Left = 3
Top = 16
Width = 473
Height = 265
Hint = #26174#31034#25805#20316#26085#24535
CustomHint = BalloonHint1
Anchors = [akLeft, akTop, akRight, akBottom]
ParentShowHint = False
PopupMenu = PopActMemo
ReadOnly = True
ScrollBars = ssVertical
ShowHint = True
TabOrder = 0
end
end
object trycn1: TTrayIcon
Hint = 'Indy10 Demo By '#33945#38754#20154
BalloonHint = #31995#32479#36827#20837#25176#30424#65292#19981#24433#21709#20351#29992
BalloonTitle = #23567#25552#31034
BalloonFlags = bfInfo
Icons = il1
PopupMenu = PopActBall
Visible = True
OnDblClick = trycn1DblClick
Left = 32
Top = 304
end
object xpmnfst1: TXPManifest
Left = 144
Top = 88
end
object mm1: TMainMenu
Images = il1
Left = 104
Top = 304
object N1: TMenuItem
Caption = #31995#32479
object N2: TMenuItem
AutoCheck = True
Caption = #24320#21551'/'#20851#38381
Hint = #24320#21551#25110#20851#38381#26381#21153
OnClick = N2Click
end
object N4: TMenuItem
Caption = '-'
end
object N5: TMenuItem
Caption = #26029#24320
Enabled = False
ImageIndex = 2
OnClick = N5Click
end
object N7: TMenuItem
Caption = #36864#20986
SubMenuImages = il1
ImageIndex = 1
OnClick = N7Click
end
end
object N3: TMenuItem
Caption = #24110#21161
object N8: TMenuItem
Caption = #20851#20110
ImageIndex = 3
OnClick = N8Click
end
end
end
object il1: TImageList
Left = 72
Top = 304
Bitmap = {
494C010106000A00040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000002000000001002000000000000020
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000EFEEEE1192919175C4C2C1430000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000EBEBEB14BCBCBC4399999966464342D88B4C2BFFA95B30FF654230FEAAAA
AA55FEFEFE010000000000000000000000000000000000000000000000000000
0000E5E1E05FADB3B6F2D7C4C8FFDCC0BEFFD5C9C0FFB9B5B5FFC1C2C788FCFB
FA07000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000F3F3F30CB9B9B9469C9C9C639999
996672727294573B2CFCA8592FFFB06134FFB06134FFB06134FF694532FF5F5F
5FF99A9A9A65EAEAEA1500000000000000000000000000000000F9F6F515C5C0
C5EEBB9281FFAD4835FFB34822FFA43D13FF983601FFAF2303FFB65339FFCED4
D0FFE8DFDE3C0000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000BEBDBD424A4948CD894F
2FFFB36336FFB76739FFB76739FFB76739FFB76739FFB76739FF6D4834FF9A9A
9AFF555555C799999966BABABA450000000000000000FBF9F90FD9D6D8F9A551
43FFC1563BFFBE5431FFC7A59EFFA9400AFF9C3501FFA32D00FFBF2705FFDB28
0CFFDDD8C4FFE8DFDE3C00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000004F3D34F5B56437FFBF6D3EFFC06E
3EFFC06E3EFFC06E3EFFC06E3EFFC06E3EFFC06E3EFFC06E3EFF704934FF7676
76FF8F8F8FFF8787877AB5B5B54AEFEFEF1000000000C4C6C5E0AD5747FFB655
3BFFC15641FFC79D8FFFBCC4C3FF915D55FF834E38FF932B0AFFC32A01FFC42E
02FFDF2E0CFFD4CBC9FFFCFBFA07000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000CF7E4DFFCB7645FFCB7645FFCB76
45FFCB7645FFCB7645FFCB7645FFCB7645FFCB7645FFCB7645FF7A533DFFFFFF
FFFF626262FF7A7A7AFD0000000000000000F4F1F037C2A7A3FFBB583DFFB758
3BFFA65A46FFE0E4DFFFC9C6C8FFB9B6B8FFBBB4B9FFD7D9D9FF85341DFFC728
06FFC32704FFAC4F3DFFC7C4C788000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000D98754FFD57E4BFFD57E4BFFD57E
4BFFD57E4BFFD57E4BFFD57E4BFFD57E4BFFD57E4BFFD57E4BFF7D5038FFDADA
D9FFC3C3C3FF6D6D6DFF5A5A5ADF00000000C4C6C6C4C1847CFFBC5740FFCD58
42FFCB7867FFE2E4DDFFD2D3DAFFAA9182FFBA6041FFCB9D85FFE9F6F0FF9629
0BFFBB2C00FFB12405FFB6B5B6FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000E18E5AFFDE8551FFDE8551FFDE85
51FFDE8551FFDE8551FFDE8551FFDE8551FFDF8955FFD38C5EFFC6C6C6FFFFFF
FFFFFFFFFFFF828282FF929292FEE6E6E619C6C7C7EDCE8C7EFFD18970FFA857
3DFFC7583BFFCD583CFFBC7B73FFE1CABAFFA7492BFFA9460FFF902F06FFA041
1CFF933202FF9C3405FFC7BAB8FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000E8945FFFE58B56FFE89560FFA273
53FFEA9C68FFE58B56FFE89560FF9B6F52FFC7C7C7FFB17655FFFDFDFDFFD28C
62FFF4F4F4FF9090909E0000000000000000CDCBCAFDD19487FFCF8572FFD389
74FFBD694EFFBA5539FFBE553DFFBE5439FFA04828FFAF441CFF9D4218FFA13C
10FF9F390DFFAE410DFFCAB8B2FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000DB986AFD8D7C70B9FCFBFA06CE7F
51FFAD856DFF896B57FFF5F5F5FFD2B29FFFFFFFFFFFF1F1F1FFFFFFFFFFFFFF
FFFFFFFFFFFFB2B2B2F70000000000000000C7C0BFE6C79384FFD0826FFFCC81
6EFFEFB9ABFFB57F75FFC16B56FFBD5844FFE7E4E2FF9D7C70FFA04526FFAE45
28FFAF462AFFBD6544FFCFC5C2FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000009D5D
34FEEFB695FFF0B897FFEBBFA5FFFFFFFFFFFEFEFEFFF3F3F3FFB19F94FFE8E4
E2FFC69B81FFFEFEFEFF0000000000000000C9CDCBACBD8480FFC8846CFFD17E
68FFC1806AFFF4EDECFFD6C8C8FFBDA8A2FFD1CDD0FFDDE2E0FFEDF4F5FFBF8B
82FFD08A77FFD09584FFB3B4B5F2000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000A198
9188F0B898FFEAA57CFFE18B59FFD3AC94FFD1CBC8FFFAFAFAFFF1F1F1FFFFFF
FFFFFEFEFEFFDDDDDDFFCACACA5400000000FBF9F91ADFDDD7FFE29C8FFFC87C
68FFCC7C6AFFC1867FFFDFD6D0FFB9C1C5FFBCC3BFFFD4D1D5FFE2DCD9FFD087
76FFD58F7BFFD3ABA1FFE1DEDD5F000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000FCFB
FB05EEC1A5FFF4F5F5FFF3F0EDFFFFFEFEFFE3DAD9FFAA7F72FF969695FFAFAF
AFFFA1A1A1FE8D8D8DC9F0F0F0190000000000000000D3D1D2BABF9B95FFE098
88FFC67968FFCD7B66FFCD7D6AFFC98173FFCD877BFFD1DED5FFCA8376FFD188
79FFCB938AFFC1C1C1EE00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00009D5D37FE8C4A2DFFA5623DFFBA602BFF9F6039FFA59F9B86F3F3F3150000
0000000000000000000000000000000000000000000000000000D4D4D4E3C69B
95FFE8A195FFCA8473FFC57B6BFFCB7F6CFFCC7F68FFCCA59DFFE19685FFCB93
87FFD9D6D2F9FAF8F71500000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000F9F8F70AB4AFAB6CF8F7F60B000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000CFC9
CBBADFDCD0FFC28276FFD78E7FFFDFA18FFFDD988DFFBB8879FFCFB9B1FFD6D5
D4E0FCFAFA0F0000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000FBF9F81ACBCACCACC8C5C7E6C2CCCAFDC9C4C2EDBFC6C8C4F6F3F3370000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000FF000000FF000000FF000000
FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000
FF000000FF000000FF000000FF000000FF000000000000000000000000000000
00000000000000000000C8C2C055C7C1BE55C6C1BE55C8C2C055000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000FDFDFD02F9F9F90700000000000000000000
00000000000000000000000000000000000000000000D1D1D12EA2A2A25DD0D0
D02FEDEDED12FEFEFE0100000000000000000000000000000000000000000000
000000000000000000000000000000000000FF00000080000000FFFFFF000000
000080000000FFFFFF0080000000800000008000000080000000800000008000
00008000000080000000800000000000FF00000000000000000000000000E4E1
DF386D6565FF3F2A1DFF4E301CFF4E2F1CFF4B2D1AFF492C17FF3B271AFF7B75
75FFEFEDED1C000000000000000000000000000000000000000000000000FDFD
FD02FCFCFC03FBFBFB04FBFBFB04FAFAFA05C6C6C64CCACACA50000000000000
000000000000000000000000000000000000FEFEFE019A5110FF653116FF3A39
38E7545454B18282827DB9B9B946E2E2E21DF7F7F708FEFEFE01000000000000
000000000000000000000000000000000000FF000000FF000000FFFFFF00FFFF
FF00FFFFFF00FFFFFF0080000000800000000000000000000000C0C0C000C0C0
C000C0C0C00000000000800000000000FF000000000000000000DFDBD938402C
21FF4B2F1DFF432A16FF422A18FF412918FF3F2716FF3E2616FF3C2415FF3B23
13FF35251CFFEDEBEA1C00000000000000000000000000000000FBFBFB04D5D3
D3305D5755F0686868FF605D5CFD948F8D7EC9C9C947C9C9C947BBBBBB65B9B9
B947EFEFEF10FEFEFE010000000000000000FEFEFE01B25F13FFC2794EFFD18F
64FFA84109FF7E3008FF4B3326F6414344D16B6B6B949D9D9D62D4D4D42BFBFB
FB0400000000000000000000000000000000FF000000FF000000FFFFFF000000
000000000000FFFFFF0000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
C000C0C0C000C0C0C000800000000000FF0000000000E1DDDA384E3525FF5B3B
26FFFAF9F9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC6BF
BFFF462916FF3D281CFFEDEBEA1C000000000000000000000000AFA7A3667361
5BFFBDB6A7FFCCC198FFBAA872FF66391BFF675351ED6D6D6DD66D6D6DD71919
19FF75757596FCFCFC030000000000000000FEFEFE01CB6B17FFC98760FFFFE2
C4FFFFE1C0FFFFE1BCFFEDB78DFFC5723EFF983501FF663417FF444545CEDDDD
DD2200000000000000000000000000000000FF000000FF000000FFFFFF00FFFF
FF000000000000000000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C0000000
000080808000C0C0C000800000000000FF00000000004F3E36FF624028FF5C3E
28FF75655AFF543825FF62412AFFE4DEDDFF7B6F67FF553723FF503320FF6354
4DFF3F2718FF492C18FF524844FF000000000000000000000000775B4FFFBE8D
5DFFFAEA99FFFFFEE0FFFCE574FFD1932FFFA88676FF5F504CFF535353FF1B1B
1BFF7575759B000000000000000000000000FEFEFE01CB6D1DFFDCA989FFFFE5
CCFFFFE2C4FFFFDEBCFFFFD9B3FFFFD7B1FFFFC272FFE7A36BFF4D382CF0D8D8
D82700000000000000000000000000000000FF000000FF000000FF000000FFFF
FF0000000000C0C0C000C0C0C000C0C0C000C0C0C00000000000808080008080
80008080800000000000800000000000FF00B9B1AFAA65432BFF6A472DFFDDD8
D6FFFFFFFFFF634531FF714D33FFDCD5D3FF7B6E65FF614129FF9D8B81FFFFFF
FFFF5A4D48FF472B19FF462B18FFCFCAC75500000000D4C8C4458A2B17FFF1B8
71FFFFF57EFFFFE480FFFFB71DFFF37800FFC88C65FF784C42FF545454FF1D1D
1DFF7676769B000000000000000000000000ECECEC16CF7427FFE1B69AFFFFE9
D4FFFFE6CCFF4CAFC9FFFFE3BBFFFFD9B3FFFFAD3DFFE5A46FFF483A32EBE3E3
E31C00000000000000000000000000000000FF000000FF000000FF0000000000
0000C0C0C000C0C0C000C0C0C000C0C0C0008080800080808000808080008080
8000C0C0C00080000000800000000000FF005B5251FF704C32FF785B48FFFFFF
FFFF6E5646FF7E5637FF7D5438FFDFD7D4FF7E7169FF6A482EFF654329FFC4B8
B4FFFFFFFFFF3A2415FF4C2E1AFF807A7BFF00000000B8A9A55CB9654AFFF499
6AFFFFBD06FFFFC105FFFFB003FFFE8406FFD67C3FFFA37058FF565656FF1E1E
1EFF7777779B000000000000000000000000E1E1E222CB6E22FFECCDB8FFFFED
DBFFAED0D0FF1FA0CCFFE1D9C5FFFAC37BFFC4BDACFFDC9257FF3B3839E5C3C3
C33CF7F7F708000000000000000000000000FF000000FF000000FF000000C0C0
C000C0C0C000C0C0C000C0C0C000FFFFFF008080800080808000808080008080
80000000000080000000800000000000FF0052443DFF795234FFD4CAC4FFF1F0
F0FF7A5538FF8C603FFF7E583BFFDDD6D4FF7D7268FF66462EFF6C482EFF6140
28FFFFFFFFFF45342CFF4E301CFF5A514EFF00000000F9F6F50BAC3110FFF690
62FFFFB073FFFFF5D2FFFFD389FFFE9C50FFE3975CFF946C56FF575757FF2020
20FF7878789B000000000000000000000000CECECF39CA6C20FFFBEFE3FFB0D6
DCFF3EACCFFFFFE8D3FF44ADCBFFE6CBB0FF797856FFFFD8AEFFE28D39FE8553
26D96F6F6F90B7B7B748EEEEEE11FEFEFE01FF000000FF00000000000000C0C0
C000C0C0C000C0C0C00080808000FFFFFF00FFFFFF0080808000808080008080
80008000000080000000800000000000FF0055463FFF825839FFE2D9D6FFADA4
A1FF8A6041FF966845FFE2DCDAFFFFFFFFFFFFFFFFFFBAB2B2FF65452EFF6945
2CFFFFFFFFFF5C4C43FF4E311EFF5B514EFF0000000000000000D6B08ED6FABD
97FFFFCD88FFFFEC99FFFFE58BFFFFCE88FFF8CBA2FF585857FF585858FF2121
21FF7878789B000000000000000000000000B1B2B35BCC6E21FFFCF3EEFFFCF5
EAFFFFF3E4FFFFF1DBFF049ACCFFFFEACCFFFFDFBDFFD68536FFFBD7B2FFFFE2
BFFFEAA25AFF88592AF157575FACA5A5A55AFF000000FF00000000000000C0C0
C000C0C0C000000000008080800080808000FFFFFF00FFFFFF00C0C0C0008000
00008000000080000000800000000000FF00564841FF8A5E3DFFE2D9D5FFBFB8
B6FF8A6241FFA27149FFFFFFFFFFFFFFFFFFFFFFFFFFF4F2F2FF704D33FF6A47
2EFFFFFFFFFF5D4B42FF523420FF5C5351FF000000000000000000000000D3CD
C7C6FFFDEEFFFFFDDFFFFFFEE8FFF7F3D5FF73706DFF686868FF5A5A5AFF2323
23FF7979799B000000000000000000000000AAABAD62C6600EFFFDFAF9FFFFF9
F3FFFFF6EBFFFFF1E4FF7FC3D4FFDADCD2FFFFE5CCFFD08651FF5E4C38D7D7A4
728DF0B77CFFE7E9F1FF0F48D0FF4F4F7CB0FF000000FF000000FFFFFF00C0C0
C000000000000000000000000000000000000000000000000000FFFFFF00FFFF
FF008000000080000000800000000000FF00736A67E28F6240FFBA9E8DFFFFFF
FFFF6A4E37FFAB774EFFA9764DFF9E6E49FF936645FF885D3DFF7D5538FF785F
52FFFFFFFFFF493121FF543522FF999291C6000000000000000000000000D6D5
D43F2A2A2AFF393836FF2B2A29FF2D2D2DFF787878FF757575FF737373FF2727
27FF7A7A7A9B0000000000000000000000009A9A997FC15805FFFEFEFFFFFFFD
FAFFFFF9F3FFFFF6EAFFFEF1E4FF1EA2CDFFFFE8D4FFD38A57FF3F4244D6E9E9
E91600000000D8D8D73E2B37B2D9E8E8EA17FF000000FF000000FFFFFF00C0C0
C0008080800080808000808080008080800080808000FF000000FFFFFF000000
00008000000080000000800000000000FF00D7CFCA71885F40FF9B6C49FFFCFB
FAFFBDB5B2FF7D5A3FFFA7744DFFA3724AFF986A46FF885E3DFF6A4A33FFF9F8
F9FFB8AFAEFF583926FF4E3220FFE1DDDB38000000000000000000000000CECD
CD3F343434FF343434FF343434FF343434FF898989FF898989FF878787FF3F3F
3FFF7C7C7C9B0000000000000000000000008684839EB94C00FFFFFFFFFFFFFF
FFFFFFFCFAFFFFF8F3FFFFF6EAFF33ACD1FFFAEEDDFFCC7D46FF464749CEEEEE
EE1100000000000000000000000000000000FF000000FF000000FFFFFF00C0C0
C00080808000808080008080800000000000FF000000FF000000FFFFFF00FFFF
FF00FFFFFF0080000000800000000000FF00000000005E534EFF9D6C48FFAD81
62FFFFFFFFFFDFDBDBFF6C5647FF6B4E35FF684B33FF806E63FFFFFFFFFFEAE6
E6FF5B3D28FF5C3C26FF756E6DFF00000000000000000000000000000000CCCC
CC3F3C3C3CFF3C3C3CFF3C3C3CFF3C3C3CFF9A9A9AFF9A9A9AFF9A9A9AFF4C4C
4CFF8989899B000000000000000000000000938F89A4BF5600FFC5825BFFE0C1
B3FFFFFFFFFFFFFFFFFFFFFFFBFFFFFAEEFFFFF2E6FFCE7F42FF494A4CC7EFEF
EF1000000000000000000000000000000000FF000000FF000000000000000000
0000808080008080800000000000FF000000FF000000FF000000FF000000FF00
0000FF00000080000000800000000000FF0000000000000000006D5342FFA06F
49FFA6744FFFE9E0DBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9ABA4FF6847
2EFF644228FF51423BFF0000000000000000000000000000000000000000CDCD
CD40464646FF464646FF464646FF454545FF8A8A8AFFB0B0B0FFADADADFF5C5C
5CFF9292929B000000000000000000000000838178C7C55A00FFC45C00FFC45D
00FFC55D00FFBA5000FFB14B00FFC37A4BFFD2A58BFFC77334FF494A4CC7EFEF
EF1000000000000000000000000000000000FF000000FF000000FF0000000000
000000000000FF000000FF000000FF000000FF000000FF000000FF000000FF00
0000FF000000FF000000800000000000FF000000000000000000000000004F41
3AFF9B6C48FF9D6D47FFBEA290FFFFFFFFFFFFFFFFFF69492FFF765034FF6B48
2EFF504641FF000000000000000000000000000000000000000000000000CDCD
CD40515151FF515151FF515151FF515151FF515151FF4F4F4FFFA8A8A8FF6F6F
6FFF9898989B000000000000000000000000B9B9B956BBB695FFDEC390FFF3BE
74FFE0953FFFCF6F10FFC65B00FFC75E00FFC86000FFCC6100FF515354BBF4F4
F40B00000000000000000000000000000000FF000000FF000000FF000000FF00
0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00
0000FF000000FF000000FF0000000000FF000000000000000000000000000000
0000B5ADAAAA56473EFF7A563AFF775339FF714E36FF684931FF50433DFFB9B3
B1AA00000000000000000000000000000000000000000000000000000000CFCF
CF3F656565F0656565F0656565F0656565F0656565F0656565F0656565F06363
63F097979794000000000000000000000000000000000000000000000000FEFE
FE01CBCCCC3D92949583888A83BF979682EDBEB28AFFD2A663FF8D8E8F7CFBFB
FB0400000000000000000000000000000000424D3E000000000000003E000000
2800000040000000200000000100010000000000000100000000000000000000
000000000000000000000000FFFFFF00FF1FFFFF00000000F007F00F00000000
0003C00700000000800180030000000000008001000000000003000100000000
0001000100000000000000010000000000030001000000000003000100000000
E003000100000000E001000100000000E001800300000000F01FC00300000000
F1FFE00700000000FFFFF01F000000000000FC3FFE7F83FF0000E007E03F003F
0000C003C003000F00008001C003000F00008001C007000F000000008007000F
0000000080070007000000008007000000000000C007000000000000E0070000
00000000E007000800000000E007000F00008001E007000F0000C003E007000F
0000E007E007000F0000F00FE007E00F}
end
object idtcpsrvr1: TIdTCPServer
Bindings = <>
DefaultPort = 22100
OnConnect = idtcpsrvr1Connect
OnDisconnect = idtcpsrvr1Disconnect
Scheduler = idschdlrfthrdflt1
OnExecute = idtcpsrvr1Execute
Left = 176
Top = 88
end
object idschdlrfthrdflt1: TIdSchedulerOfThreadDefault
MaxThreads = 0
Left = 208
Top = 88
end
object BalloonHint1: TBalloonHint
Images = il1
HideAfter = 5000
Left = 240
Top = 88
end
object PopActMemo: TPopupActionBar
Images = il3
OnPopup = PopActMemoPopup
Left = 320
Top = 312
object NClear: TMenuItem
Caption = #28165#31354
ImageIndex = 0
OnClick = NClearClick
end
object N6: TMenuItem
Caption = '-'
end
object NSave: TMenuItem
Caption = #20445#23384'...'
ImageIndex = 1
OnClick = NSaveClick
end
end
object PopActBall: TPopupActionBar
Images = il1
Left = 136
Top = 304
object N9: TMenuItem
Caption = #25171#24320
Default = True
ImageIndex = 4
OnClick = N9Click
end
object N11: TMenuItem
Caption = #38544#34255
ImageIndex = 5
OnClick = N11Click
end
object mniN10: TMenuItem
Caption = '-'
end
object mniN11: TMenuItem
Caption = #20851#20110
ImageIndex = 3
OnClick = mniN11Click
end
object mniN12: TMenuItem
Caption = #36864#20986
ImageIndex = 1
OnClick = mniN12Click
end
end
object il3: TImageList
Left = 368
Top = 312
Bitmap = {
494C010102000500040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000001000000001002000000000000010
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000FCFCFC03E1E1E11EA9A39E61978D857AACA9A659D5D5D52AF3F3F30C0000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000F9F9F9089292926D7978
788B7978788B7978788B7978788B7978788B7978788B7978788B7978788B7978
788B7A79798AB0B0B04FFEFEFE01000000000000000000000000FEFEFE01BCB8
B54A7D4509FAD1AC3BFCEAC641FEE5BD37FFE0B32CFED6A520FD93671FE7B2B2
B24DF5F5F50A0000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000B5B5B54DD7D2D0FFD0CB
C8FFCFCAC7FFCDC8C5FFCCC7C4FFCAC5C2FFC9C3C0FFC6C1BDFFC4BEBAFFC4BD
BAFFBDB7B2FFCAC5C3FCEDEDED160000000000000000FDFDFD02826449B6D1AE
41FCEFD04DFFEBC742FFE6BE38FFE2B638FFDCAB26FFD5A017FFCE960FFFC88D
07FE837E7689EEEEEE1100000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000A9A8A87ED5D1D0FFD4D0
CEFFD3CFCDFFD1CDCBFFD0CBC9FFCFCAC7FFCFCAC8FFCCC6C4FF849078FF4F60
48FFC0BBB7FFC9C4C1FFECECEB2000000000000000008F7B6996E2C34DFCEFD1
4DFFE5C44DFFFAEED7FFFCEFE1FFF5DECAFFF7D9BFFFFDD8B5FFD5974FFFC185
01FFBA7D01FE86827B84F6F6F609000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000ABAAAA7DE2DFDDFFE1DD
DCFFE0DCDAFFE0DCDCFFA9B499FF415F1BFF213700FF30582BFFD6D2CFFFD5D0
CEFFD2CECBFFD9D4D2FFEEEEEE2000000000EFEEEE11B1852CFBF5D653FFDBC0
5BFFE5D8D1FFC7BEB9FFC3BAB6FFC0B5AFFFB9A9A1FFBCA398FFCAA18DFFB17E
5FFFB47500FFAB6C01FEBBBBBB44000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000ABABAB7DEAE8E7FFEAE8
E6FFE5E3E1FF759954FF578F2BFF296500FF235700FFC6C8BDFFE3DFDEFFE0DE
DCFFDFDDDBFFE4E1DFFFF0F0EF2000000000826348B7F6D855FEF5D350FFD3D0
CEFFCEAE48FFD6A92CFFA19470FFB0965DFFB97F0AFF826A47FFBBA89FFFB996
85FF865B2CFFA36400FF7B6443BCF6F6F6090000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000ADACAC7DF1EFEEFFEDEC
EAFF7A8F45FF639629FF437411FF43870DFF739A53FFC5CABBFFECEBEAFFEBEA
E9FFEBE9E7FFEEECEBFFF1F1F120000000008A550FFCEECC48FFA59765FFDADE
E0FFC7A440FFCD9B20FFC28D14FFB29861FFB17402FFA76800FFBBB4B0FFBBA6
9CFFA48271FF9A5B00FF905303FCDEDEDE210000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000AEADAD7DF2F1F1FF8272
2CFF8B963FFF728129FF749A36FF608E27FF557B24FFF3F3F2FFF3F2F2FFF3F2
F1FFF2F1F0FFF5F4F3FFF1F1F12000000000B38726FCE7C13BFF9B9D9CFFDEE5
E8FFC09937FFC59015FFB9800BFFA76E07FFA96A00FFA16100FF7F6D56FFC0B5
AFFFB69A8DFF884F04FF894A00FFC9C9C9360000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000AEAFAF7D9E702EFFAB90
37FFA29236FF9D9B41FF8D973FFF748431FF6B7537FFF9F8F8FFF8F8F8FFF8F7
F7FFF8F7F7FFFAF9F9FFF2F2F22000000000BD8F27FCE2B731FFA4A9AAFFE1E8
ECFFB98E2FFFA77F2DFFB17302FFA96900FFA16100FFA36619FF8F4F00FFBDB8
B5FFBAA69CFF7D4808FF7F4200FFC5C5C53A0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000A49C937FC18201FFCC9A
03FFB48D1BFFB5982FFF978032FF877839FFD8D5C8FFFCFBFBFFFBFBFBFFFBFB
FBFFFBFBFBFFFDFDFDFFF2F2F22000000000A37018FADDAF27FF949691FFE4EB
EEFFB18326FFA4792CFFCCA66AFFA16000FF995900FFCCCECCFF884900FF7865
55FFB8A8A0FF7C4201FF773B01FED5D5D52A0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000FBFAF906974D03FCD49100FFB97F
00FFD89800FFC79619FF895713FFE7E0D5FFF2EFECFFFEFEFEFFFEFEFEFFFEFE
FEFFFEFDFDFFFEFEFEFFF2F2F220000000008875609FD8A61DFFAE8B2FFFD7DC
DEFFBD7E02FFB67300FFE5E5E5FFA76000FF9E5700FFBBB9B4FF8D4800FF8541
00FF7A6D67FF783C00FF6D390EF1EFEFEF100000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000875742BDA76F2CE7D0961AFFCD8E
00FFD39000FFCA8A1AFF774012FFFEFEFEFFFEFEFEFFFEFEFEFFFEFEFEFFFEFE
FEFFFEFEFEFFFEFEFEFFF3F3F32000000000E3E3E31CCF9913FECC930CFFA6A9
A9FFEEF2F4FFF5F7F8FFF8FAFAFFF6FAFCFFF1F7FAFFECF3F7FFE0E5E8FFC0BE
BDFF6E3F10FF703400FF918C8976FEFEFE010000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A5938281C57C2CFFB6752CFFCB86
21FFC77F04FFB96A00FFDEC8B5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFF3F3F31E00000000FEFEFE019B958B74C68A05FFBE81
00FFA9ACACFFEAEFF1FFECF1F3FFEAF0F3FFE7EEF1FFE2E9ECFFCCCFD1FF6C4A
27FF703400FF673611EEE8E8E817000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A0623CDAAC5F35FF9D5930FFB66B
36FFB06114FFB37238FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFDFDFD060000000000000000F5F5F50A93866B94B87A
00FFB17200FF906A2AFF9FA2A2FFB5BCBEFFABB1B3FF827769FF7B4105FF7135
00FF693107F8D2D2D22D00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000C0ABA065934020FF8E4115FF9C4B
26FF6A290EF7D9D3CE5DDBD7D35DDEDBD95DE0DFDE5DE0E0E05DE0E0E05DE0E0
E05DDFDFDF5DFBFBFB0E00000000000000000000000000000000F5F5F50AA6A3
9E61A76903FC9F6000FF965800FF8D4F00FF834600FF7C4000FF713501FE6E4D
35CADBDBDB24FEFEFE0100000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000825342C17B2A0FFF8249
35D3F9F7F60B0000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000FEFE
FE01E6E6E619ACAAA857826B4DB27B5428D7765634CB8A7F7689CFCFCF30F6F6
F609000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000100000000100010000000000800000000000000000000000
000000000000000000000000FFFFFF00FFFFF01F000000008001C00700000000
8001800300000000800180010000000080010001000000008001000000000000
8001000000000000800100000000000080010000000000008001000000000000
0001000000000000000100000000000000010001000000000001800300000000
0003C0030000000087FFE00F00000000}
end
object dlgSave1: TSaveTextFileDialog
Filter = #25991#26412#25991#20214'(*.TXT)|*.txt'
OnCanClose = dlgSave1CanClose
Left = 280
Top = 312
end
object il2: TImageList
Left = 272
Top = 88
Bitmap = {
494C010101000500040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000001000000001002000000000000010
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF
FF00808080000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF
FF00C0C0C0008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF
FF00C0C0C000C0C0C00000000000808080000000000000000000000000000000
0000C0C0C000C0C0C00080808000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000FF000000FF000000FF00
000000008000C0C0C00000000000808080000000000000000000000000000000
000000000000C0C0C00080808000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000FF000000FF000000FF00
000080000000000080000000000080808000C0C0C000C0C0C000C0C0C000C0C0
C000C0C0C000C0C0C00080808000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000FF000000FF000000FF00
0000800000008000000000000000808080008080800080808000808080008080
8000808080008080800080808000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000080808000FFFFFF00FFFFFF00FFFF
FF00C0C0C0008000000000000000808080008080800080808000808080000080
0000808080000000000080808000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000C0C0C000C0C0C000C0C0C0008080
8000FFFFFF00FFFFFF0000000000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF
FF00C0C0C0008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000080808000C0C0C000C0C0C0008080
8000FFFFFF00FFFFFF0000000000FF000000FF000000FF000000FF0000008000
0000C0C0C0008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000080808000000000000000
0000808080008080800000000000FF000000FF000000FF000000FF0000008000
0000C0C0C0008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000008080
8000C0C0C000FF000000FF000000FF000000FF000000FF000000FF0000008000
0000C0C0C0008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000008080
8000C0C0C000FF000000FF000000FF000000FF000000FF000000FF0000008000
0000C0C0C0008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000008080
8000C0C0C0000000000000000000000000000000000000000000000000008000
0000C0C0C0008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000008080
8000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
C000C0C0C0008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000080808000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
C000C0C0C0008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000100000000100010000000000800000000000000000000000
000000000000000000000000FFFFFF008F8300000000000087C3000000000000
8003000000000000800100000000000080000000000000008000000000000000
8000000000000000000000000000000000030000000000000003000000000000
8003000000000000C003000000000000E003000000000000E003000000000000
E003000000000000F003000000000000}
end
end.
[/code]

編輯記錄
zhweizw 重新編輯於 2010-08-17 17:00:20, 註解 無‧
zhweizw
一般會員


發表:7
回覆:16
積分:9
註冊:2008-01-12

發送簡訊給我
#3 引用回覆 回覆 發表時間:2010-08-17 16:59:22 IP:58.218.xxx.xxx 訂閱

[code delphi]
unit UntClt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
StdCtrls,UntGlb,IdGlobal, ExtCtrls, ImgList ;

type
TForm1 = class(TForm)
btn1: TButton;
chk1: TCheckBox;
idtcpclnt1: TIdTCPClient;
stat1: TStatusBar;
tmr1: TTimer;
BalloonHint1: TBalloonHint;
il1: TImageList;
edt1: TEdit;
lbl1: TLabel;
dlgOpen1: TOpenDialog;
btn2: TButton;
btn3: TButton;
btn4: TButton;
btn5: TButton;
grp1: TGroupBox;
lst1: TListBox;
procedure btn1Click(Sender: TObject);
procedure chk1Click(Sender: TObject);
procedure idtcpclnt1Disconnected(Sender: TObject);
procedure btn2Click(Sender: TObject);
procedure tmr1Timer(Sender: TObject);
procedure idtcpclnt1Connected(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure btn5Click(Sender: TObject);
procedure btn3Click(Sender: TObject);
procedure btn4Click(Sender: TObject);
private
{ Private declarations }
ComputerName:string;

public
{ Public declarations }
UserBreakAll:Boolean;
end;
var
Form1: TForm1;
implementation
uses Untprogress;
{$R *.dfm}

procedure TForm1.btn1Click(Sender: TObject);
begin
close;
end;

procedure TForm1.btn2Click(Sender: TObject);
var
i:Integer;
begin
if dlgOpen1.Execute(Handle) then begin
for I := 0 to dlgOpen1.Files.Count - 1 do
lst1.Items.add(dlgOpen1.Files[i]);
end;
grp1.Caption := GroupText format('(%s个)',[IntToStr(lst1.Count)]);
end;

procedure TForm1.btn3Click(Sender: TObject);
begin
lst1.Clear;
grp1.Caption := GroupText format('(%d个)',[0]);
end;

procedure TForm1.btn4Click(Sender: TObject);
begin
lst1.DeleteSelected;
grp1.Caption := GroupText format('(%s个)',[IntToStr(lst1.Count)]);
end;

procedure TForm1.btn5Click(Sender: TObject);
var
FileName:string;
buf:TDataPack;
bbuf:TIdBytes;
i,j,SendTimes,RemainLen,h,FileLen,Sent:Integer;

begin
if idtcpclnt1.Connected then begin
if lst1.Count >0 then begin
UserBreakAll := False;
Sent :=0;
frmProgress.Show;
for I := 0 to lst1.Count - 1 do begin
if UserBreakAll then Break;
FileName := lst1.Items[i];
frmProgress.lbl1.Caption := FileName;
frmProgress.pb1.Position :=0;
Application.ProcessMessages;
h:= FileOpen(FileName,fmOpenRead);
if h>0 then begin
FileLen := GetFileSize(h,nil);
SendTimes := FileLen div SEND_BUF;
RemainLen := FileLen mod SEND_BUF;
frmProgress.pb1.Max := FileLen;
buf.Command :=cmdSendFile;
buf.FileName := ExtractFileName(FileName);
buf.FileSize := FileLen;
buf.Flags :=0;//新建
for j := 1 to SendTimes do begin
if UserBreakAll then Break;
if not idtcpclnt1.Connected then Break;
FileRead(h,buf.FileData,SEND_BUF);
buf.ReadBytes := SEND_BUF;
bbuf := RawToBytes(buf,SizeOf(buf));
idtcpclnt1.IOHandler.Write(bbuf);
buf.Flags := 1;//续传
frmProgress.pb1.Position :=j*send_buf;
Application.ProcessMessages;
end;
if RemainLen >0 then begin
if not idtcpclnt1.Connected then Break;
FileRead(h,buf.FileData,RemainLen);
buf.ReadBytes := RemainLen ;
bbuf := RawToBytes(buf,SizeOf(buf));
idtcpclnt1.IOHandler.Write(bbuf);
frmProgress.pb1.Position := FileLen;
Application.ProcessMessages;
end;
FileClose(h);
if (not UserBreakAll) then
inc(sent);
end;
end;
frmProgress.Close;
ShowMessage(Format('%d个文件发送成功',[sent]));
if idtcpclnt1.Connected and UserBreakAll then begin
bbuf :=nil;
buf.Command := cmdUserbreak ;
bbuf := RawToBytes(buf,SizeOf(buf));
idtcpclnt1.IOHandler.Write(bbuf);
end;
end else ShowMessage('请选择待发送的文件');
end else ShowMessage('未连接服务器');
end;

procedure TForm1.chk1Click(Sender: TObject);
begin
if not tmr1.Enabled then tmr1.Enabled:= True ;
idtcpclnt1.Host :=edt1.Text;
if chk1.Checked then
begin
try
Application.ProcessMessages;
idtcpclnt1.Connect;
except
end;
if idtcpclnt1.Connected then stat1.Panels[1].Text := '已链接到服务器';
end else idtcpclnt1.Disconnect;
chk1.Checked := idtcpclnt1.Connected ;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
n:Cardinal;
Name:array[0..MAX_COMPUTERNAME_LENGTH] of Char ;
begin
n:=MAX_COMPUTERNAME_LENGTH 1;
GetComputerName(name,n);
ComputerName := string(Name);
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
// if Assigned(Datathread) then FreeAndNil(Datathread);

end;
procedure TForm1.idtcpclnt1Connected(Sender: TObject);
var
bbuf:TIdBytes;
buf:TDataPack;
begin
buf.ClientInfo.ClientName :=ComputerName;
bbuf :=RawToBytes(buf,SizeOf(buf));
idtcpclnt1.IOHandler.Write(bbuf);
end;

procedure TForm1.idtcpclnt1Disconnected(Sender: TObject);
begin
stat1.Panels[1].Text := '已从服务器断开';
chk1.Checked := False;
end;

procedure TForm1.tmr1Timer(Sender: TObject);
begin
if not idtcpclnt1.Connected then idtcpclnt1.OnDisconnected(nil);

end;
end.[/code]

zhweizw
一般會員


發表:7
回覆:16
積分:9
註冊:2008-01-12

發送簡訊給我
#4 引用回覆 回覆 發表時間:2010-08-17 17:01:27 IP:58.218.xxx.xxx 訂閱

[code delphi]
unit Untprogress;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;

type
TfrmProgress = class(TForm)
btn2: TButton;
pb1: TProgressBar;
lbl1: TLabel;
procedure btn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
frmProgress: TfrmProgress;

implementation
uses
UntClt;
{$R *.dfm}

procedure TfrmProgress.btn2Click(Sender: TObject);
begin
UntClt.Form1.UserBreakall := True;
end;

end.
[/code]

zhweizw
一般會員


發表:7
回覆:16
積分:9
註冊:2008-01-12

發送簡訊給我
#5 引用回覆 回覆 發表時間:2010-08-17 17:01:58 IP:58.218.xxx.xxx 訂閱

[code delphi]
unit UntGlb;
interface
uses
Messages,Windows, SysUtils,Classes ;

const
StuText = '客户端连接数:';
GroupText='发送文件列表';
WM_USERMSG = WM_USER 1002;
WM_USERFILE= WM_USER 1003;
ADD_LIST = 0;
DEL_LIST =1;
UPD_STA =2;


SEND_BUF = 1024*20;
REV = 'REV';
type
TCommand = (cmdSetName,cmdSendFile,cmdUserbreak);
TClientInfo = packed record
ClientName:string[50];
ClientIP:string[15];
ClientID:string[10];
Flags:Integer;
end;
TDataPack = packed record
Flags : Integer;
FileSize : Integer;
ReadBytes : Integer;
Command : TCommand;
ClientInfo : TClientInfo;
FileName : string[255];
FileData : array[0..SEND_BUF -1] of Byte;
end;
implementation
end.

[/code]
Hero
一般會員


發表:3
回覆:10
積分:12
註冊:2002-07-11

發送簡訊給我
#6 引用回覆 回覆 發表時間:2010-08-20 09:58:06 IP:111.82.xxx.xxx 訂閱
在TIdTCPServer的OnConnect, OnDisconnect, OnExecute event內呼叫TWinControl.Handle這個動作並不是Thread Safe的
也就是SendMessage(Handle, .........) 有可能會發生問題,這個我自己就遇過
建議採用TIdNotify方式來處理(我有找到一篇是說TIdSync也可能會有問題,所以我就沒試過在這使用TIdSync)
https://forums.embarcadero.com/thread.jspa?messageID=187441𭰱
zhweizw
一般會員


發表:7
回覆:16
積分:9
註冊:2008-01-12

發送簡訊給我
#7 引用回覆 回覆 發表時間:2010-08-24 10:53:48 IP:58.218.xxx.xxx 訂閱
谢谢Hero大大指导~小弟学习了
===================引 用 Hero 文 章===================
在TIdTCPServer的OnConnect, OnDisconnect, OnExecute event內呼叫TWinControl.Handle這個動作並不是Thread Safe的
也就是SendMessage(Handle, .........) 有可能會發生問題,這個我自己就遇過
建議採用TIdNotify方式來處理(我有找到一篇是說TIdSync也可能會有問題,所以我就沒試過在這使用TIdSync)
系統時間:2024-11-23 16:04:24
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!