?? rdservermain.pas.~5~
字號:
unit rdServerMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ComCtrls, ToolWin, IdBaseComponent, IdComponent,
IdTCPServer, StdCtrls;
type
TForm1 = class(TForm)
ToolBar1: TToolBar;
ScrollBox1: TScrollBox;
Image1: TImage;
ToolButton1: TToolButton;
IdTCPServer1: TIdTCPServer;
Memo1: TMemo;
procedure IdTCPServer1Disconnect(AThread: TIdPeerThread);
procedure IdTCPServer1Connect(AThread: TIdPeerThread);
procedure ToolButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ToolButton1Click(Sender: TObject);
begin
IdTCPServer1.DefaultPort := 1111;
try
IdTCPServer1.Active := True;
except
end;
end;
procedure TForm1.IdTCPServer1Connect(AThread: TIdPeerThread);
begin
with AThread.Connection.Socket.Binding do
begin
Memo1.Lines.Add(Format('%s: %d 已經登陸!',[PeerIP,PeerPort]))
end;
end;
procedure TForm1.IdTCPServer1Disconnect(AThread: TIdPeerThread);
begin
with AThread.Connection.Socket.Binding do
begin
Memo1.Lines.Add(Format('%s: %d 退出!',[PeerIP,PeerPort]))
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -