2007-10-03 16:03:28 +00:00
|
|
|
|
unit uConfigurarConexion;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, StdCtrls, uROClient, uROWinInetHttpChannel, uRODynamicRequest,
|
|
|
|
|
|
uRORemoteService, uROBinMessage;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfConfigurarConexion = class(TForm)
|
|
|
|
|
|
bProbar: TButton;
|
|
|
|
|
|
GroupBox1: TGroupBox;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
edtServer: TEdit;
|
|
|
|
|
|
edtPort: TEdit;
|
|
|
|
|
|
bAceptar: TButton;
|
|
|
|
|
|
bCancelar: TButton;
|
|
|
|
|
|
procedure bProbarClick(Sender: TObject);
|
|
|
|
|
|
private
|
|
|
|
|
|
function GetTargetURL: String;
|
|
|
|
|
|
procedure SetTargetURL(const Value: String);
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
|
|
|
|
|
property TargetURL : String read GetTargetURL write SetTargetURL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
fConfigurarConexion: TfConfigurarConexion;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
StrUtils, JclStrings, uDataModuleConexion, uDialogUtils;
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
{ TfConfigurarConexion }
|
|
|
|
|
|
|
|
|
|
|
|
function TfConfigurarConexion.GetTargetURL: String;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := 'http://' + edtServer.Text + ':' + edtPort.Text + '/bin';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfConfigurarConexion.SetTargetURL(const Value: String);
|
|
|
|
|
|
var
|
|
|
|
|
|
s : String;
|
|
|
|
|
|
begin
|
|
|
|
|
|
s := StrAfter('http://', Value);
|
|
|
|
|
|
s := StrBefore(':', s);
|
|
|
|
|
|
edtServer.Text := s;
|
|
|
|
|
|
|
|
|
|
|
|
s := StrAfter(edtServer.Text + ':', Value);
|
|
|
|
|
|
s := StrBefore('/bin', s);
|
2012-06-11 14:31:03 +00:00
|
|
|
|
|
|
|
|
|
|
if s = '' then
|
|
|
|
|
|
s := '8099';
|
|
|
|
|
|
edtPort.Text := s
|
2007-10-03 16:03:28 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfConfigurarConexion.bProbarClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if dmConexion.ProbarConexion(TargetURL) then
|
|
|
|
|
|
ShowInfoMessage('Conexi<78>n v<>lida con el servidor.')
|
|
|
|
|
|
else
|
|
|
|
|
|
ShowErrorMessage('Error de conexi<78>n', 'No se ha podido establecer la conexi<78>n con el servidor.')
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|