K
kntrue
Unregistered / Unconfirmed
GUEST, unregistred user!
dbConfig.ini 与单元文件一个目录,delphi6.0
--内容:
[UserInfo]
UserName=kntrue
UserPwd=123456
代码:
implementation
uses iniFiles;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
iniFile :TIniFile;
userName :string;
userPwd :string;
begin
if not fileExists('dbConfig.ini') then
begin
application.MessageBox('缺少配置文件,请于管理员联系!','提示',mb_ok);
exit;
end;
iniFile :=TiniFile.create('dbConfig.ini');
userName :=iniFile.readString('UserInfo','UserName','error1');
userPwd :=iniFile.readString('UserInfo','UserPwd','error2');
edit1.Text :=userName;
edit2.Text :=userPwd;
iniFile.free;
end;
问题:两个文本框中得到的是error1,error2,请执教错误在那里????
谢谢
--内容:
[UserInfo]
UserName=kntrue
UserPwd=123456
代码:
implementation
uses iniFiles;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
iniFile :TIniFile;
userName :string;
userPwd :string;
begin
if not fileExists('dbConfig.ini') then
begin
application.MessageBox('缺少配置文件,请于管理员联系!','提示',mb_ok);
exit;
end;
iniFile :=TiniFile.create('dbConfig.ini');
userName :=iniFile.readString('UserInfo','UserName','error1');
userPwd :=iniFile.readString('UserInfo','UserPwd','error2');
edit1.Text :=userName;
edit2.Text :=userPwd;
iniFile.free;
end;
问题:两个文本框中得到的是error1,error2,请执教错误在那里????
谢谢