55 lines
1.3 KiB
ObjectPascal
55 lines
1.3 KiB
ObjectPascal
|
|
unit fServerForm;
|
||
|
|
|
||
|
|
interface
|
||
|
|
|
||
|
|
uses
|
||
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
|
||
|
|
uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer,
|
||
|
|
uROBinMessage, uROIndyHTTPServer, uROIndyTCPServer, ComCtrls, Mask,
|
||
|
|
uROZeroConf;
|
||
|
|
|
||
|
|
type
|
||
|
|
TServerForm = class(TForm)
|
||
|
|
RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton;
|
||
|
|
ROMessage: TROBinMessage;
|
||
|
|
ROServer: TROIndyHTTPServer;
|
||
|
|
Label1: TLabel;
|
||
|
|
edWhoAmI: TEdit;
|
||
|
|
btStart: TButton;
|
||
|
|
ROZeroConfRegistration1: TROZeroConfRegistration;
|
||
|
|
procedure btStartClick(Sender: TObject);
|
||
|
|
private
|
||
|
|
{ Private declarations }
|
||
|
|
function GetWhoAmI: TCaption;
|
||
|
|
public
|
||
|
|
{ Public declarations }
|
||
|
|
property WhoAmI: TCaption read GetWhoAmI;
|
||
|
|
end;
|
||
|
|
|
||
|
|
var
|
||
|
|
ServerForm: TServerForm;
|
||
|
|
|
||
|
|
implementation
|
||
|
|
|
||
|
|
{$R *.dfm}
|
||
|
|
|
||
|
|
procedure TServerForm.btStartClick(Sender: TObject);
|
||
|
|
begin
|
||
|
|
if not ROServer.Active then begin
|
||
|
|
ROServer.Port := 0;
|
||
|
|
ROServer.Active := true;
|
||
|
|
btStart.Caption := 'Stop server';
|
||
|
|
end
|
||
|
|
else begin
|
||
|
|
ROServer.Active := false;
|
||
|
|
btStart.Caption := 'Start server';
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
|
||
|
|
function TServerForm.GetWhoAmI: TCaption;
|
||
|
|
begin
|
||
|
|
result := ServerForm.edWhoAmI.Text;
|
||
|
|
end;
|
||
|
|
|
||
|
|
end.
|