📄 uanetworksetting.pas
字号:
{******************************************************************************************}
{ }
{ Universal Agent on demond SDK }
{ }
{ }
{ COPYRIGHT }
{ ========= }
{ The UA SDK (software) is Copyright (C) 2001-2003, by vinson zeng(曾胡龙). }
{ All rights reserved. }
{ The authors - vinson zeng (曾胡龙), }
{ exclusively own all copyrights to the Advanced Application }
{ Controls (AppControls) and all other products distributed by Utilmind Solutions(R). }
{ }
{ LIABILITY DISCLAIMER }
{ ==================== }
{ THIS SOFTWARE IS DISTRIBUTED "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE }
{ OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. }
{ YOU USE IT AT YOUR OWN RISK. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS, }
{ DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.}
{ }
{ RESTRICTIONS }
{ ============ }
{ You may not attempt to reverse compile, modify, }
{ translate or disassemble the software in whole or in part. }
{ You may not remove or modify any copyright notice or the method by which }
{ it may be invoked. }
{******************************************************************************************}
unit uaNetworkSetting;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls, Spin,UAServiceAdapter;
type
TNetworkSettingForm = class(TForm)
PageControl_: TPageControl;
ts_Network: TTabSheet;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
cb_En: TCheckBox;
rg_Compress: TRadioGroup;
edt_AppServerIP: TEdit;
edt_AppServerPort: TEdit;
sedt_Timout: TSpinEdit;
sedt_tryconnections: TSpinEdit;
btn_Ok: TButton;
btn_Test: TButton;
btn_Cancel: TButton;
Image1: TImage;
cb_LocateNet: TCheckBox;
Label10: TLabel;
edt_ServerName: TEdit;
procedure btn_OkClick(Sender: TObject);
procedure btn_CancelClick(Sender: TObject);
procedure btn_TestClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
FUAServiceAdapter:TUAServiceAdapter;
FPassed:Boolean;
constructor Create(AOwner: TComponent); override;
end;
var
NetworkSettingForm: TNetworkSettingForm;
implementation
{$R *.dfm}
procedure TNetworkSettingForm.btn_OkClick(Sender: TObject);
begin
ModalResult := mrOk;
end;
procedure TNetworkSettingForm.btn_CancelClick(Sender: TObject);
begin
ModalResult := mrCancel;
end;
procedure TNetworkSettingForm.btn_TestClick(Sender: TObject);
var
sErrorMsg:string;
begin
with FUAServiceAdapter do
begin
try
try
Address := trim(edt_AppServerIP.Text);
Port := StrToInt(trim(edt_AppServerPort.Text));
TryConnectTimes := StrToInt(trim(sedt_tryconnections.Text));
WaitTimes := StrToInt(trim(sedt_Timout.Text));
Server := 'JTServiceSrv.JtService';
Connected := true;
FPassed := Connected ;
except
on E:Exception do
begin
sErrorMsg := E.Message;
FPassed := false;
end;
end;
finally
// {$ifdef uadebug}
if Connected then
Connected := false;
// {$endif}
end;
end;
if FPassed then
Showmessage('网络连接测试成功!')
else
Showmessage('网络连接测试失败!'+#13#10 + '[ Native Error Information Is: '+sErrorMsg +']');
end;
constructor TNetworkSettingForm.Create(AOwner: TComponent);
begin
inherited;
if AOwner is TUAServiceAdapter then
FUAServiceAdapter := TUAServiceAdapter(AOwner);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -