免费获取
|
论文天下网
|
原创毕业论文
|
论文范文
|
论文下载
|
计算机论文
|
论文降重
|
毕业论文
|
外文翻译
|
免费论文
|
开题报告
|
心得体会
|
全站搜索
当前位置:
论文天下网
->
免费论文
->
计算机论文
分布式多层数据库系统的应用(三)
或者应用服务器IP地址)和应用服务器的端口号,这些配置信息将用来连接应用服务器。如果连接成功,输入的配置信息将被写入到注册表中,以后程序启动时,读取注册表配置信息,就可而已连接应用服务器程序了。程序的具体实现部分如程序清单如下所示。
procedure BitBtn1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
procedure WriteToReg(const bappHost,bappIp,aPort:string);
{ Private declarations }
public
{ Public declarations }
end;
var
fm_SerConfig: Tfm_SerConfig; Connected: boolean= false; //代表是否连接成功
implementation
uses netlist, data;
{$R *.dfm}
procedure Tfm_SerConfig.BitBtn1Click(Sender: TObject);
begin
if ((Edt_host.Text='') or (Edt_host.Text=null))
and((Edt_ip.Text='') or (Edt_host.Text=null)) then
begin
application.MessageBox('请输入服务器和IP','输入错误',
mb_iconinformation + mb_defbutton1);
exit;
end;
try
strtoint(edt_Port.text);
except
Application.MessageBox('请输入正确的端口号', '输入错误..', mb_iconinformation + mb_defbutton1);
exit;
end;
statusbar1.Panels[0].Text:='正在连接服务器,pleale wait';
statusbar1.Refresh;
screen.Cursor:=crHourGlass;
fm_data.Socket.Connected:=false;
fm_data.Socket.Host:=edt_host.Text;
fm_data.Socket.Address:=edt_ip.Text;
fm_data.Socket.Port:=strtoint(edt_port.Text);
try
screen.Cursor:=crdefault;
fm_data.Socket.Connected:=true;
application.MessageBox('连接成功','图书管理系统', mb_iconinformation + mb_defbutton1);
connected:=true;
except
screen.Cursor:=crdefault;
application.MessageBox('连接失败','图书管理系统',mb_iconinformation+mb_defbutton1);
connected:=false;
end;
//连接成功向注册表里写入应用服务器配置信息
WriteToReg(edt_Host.Text, edt_IP.Text, edt_Port.Text);
close;
end;
//利用可视化窗体来选择计算机
procedure Tfm_SerConfig.Button1Click(Sender: TObject);
begin
edt_ip.Clear;
edt_host.Text:= NetExecute(TFm_NetList);
end;
//把信息写入注册表
procedure Tfm_SerConfig.WriteToReg(const bappHost,bappIp,aPort:string);
var
reg:Tregistry;
begin
reg:=Tregistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
if not reg.OpenKey('\Software\pz',false) then //如果可以创建目录
begin
reg.CreateKey('\Software\pz');
reg.OpenKey('\Software\pz',false);
end;
reg.WriteString('host',bapph
首页
上一页
1
2
3
4
5
6
7
下一页
尾页
3
/8/8
相关论文
上一篇
:
delphi医嘱管理系统[开题报告+论..
下一篇
:
商品销售管理系统论文
推荐论文
本专业最新论文
Tags:
分布式
多层
数据库
系统
应用
【
返回顶部
】
相关栏目
自动化相关
计算机论文
工程管理论文
法律论文
医学论文
人力资源
电子专业
电气工程
英语论文
行政管理
电子商务
社科文学
教育论文
物流专业
金融专业
财务管理
会计专业
化学化工材料科学
电子通信
环境科学
经济类
机械模具类
报告,总结,申请书
其他专业论文