请问怎么才能在这里不用配置constring的路径就能读取config。ini文件呢?或则有什么其他方法---呵呵新手 ( 积分: 10 )

  • 主题发起人 主题发起人 xddouble
  • 开始时间 开始时间
X

xddouble

Unregistered / Unconfirmed
GUEST, unregistred user!
**********************
procedure Tmainform.FormCreate(Sender: TObject);
var linkstring:string;
begin
constring:=tinifile.Create('d:/销售软件/config.ini');
linkstring:=constring.ReadString('server','linkstring','网络部');
dmaster1.Connection:=trim('Provider=SQLOLEDB.1;Password=xsb;Persist Security Info=True;User ID=xsb;Initial Catalog=xsb;Data Source='+linkstring);
dmaster1.Connected:=true;
mainform.FormStyle:=fsnormal;
landform:=Tlandform.Create(self);
landform.ShowModal;
mainform.FormStyle:=fsmdiform;
end;
************************************
 
**********************
procedure Tmainform.FormCreate(Sender: TObject);
var linkstring:string;
begin
constring:=tinifile.Create('d:/销售软件/config.ini');
linkstring:=constring.ReadString('server','linkstring','网络部');
dmaster1.Connection:=trim('Provider=SQLOLEDB.1;Password=xsb;Persist Security Info=True;User ID=xsb;Initial Catalog=xsb;Data Source='+linkstring);
dmaster1.Connected:=true;
mainform.FormStyle:=fsnormal;
landform:=Tlandform.Create(self);
landform.ShowModal;
mainform.FormStyle:=fsmdiform;
end;
************************************
 
后退
顶部