Componentes.Terceros.RemObj.../internal/6.0.43.801/1/RemObjects Samples/RemObjects SDK for Delphi/BonjourDiscovery/fServerForm.pas
2010-01-29 16:17:43 +00:00

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.