procedure inifile (filename : string);
var
f:system.text;
s_ini: tinifile;
begin
s_ini:=nil;
try
try
if not FileExists(filename) then
begin
system.assign(f,filename);
system.rewrite(f);
system.Writeln(f,'//《证卡管理录系统--前台受理》配置文件//');
system.Writeln(f,'');
system.Writeln(f,'[data_set]');
system.writeln(f,'Provider=Microsoft.Jet.OLEDB.4.0');
system.writeln(f,'Password=""');
system.writeln(f,'Data Source=//Hrserver2/STATION/table/Certificate.mdb');
system.writeln(f,'Persist Security Info=True');
system.close (f);
end;
s_ini:=tinifile.create(filename);
Provider :=s_ini.readstring('data_set','Provider','Microsoft.Jet.OLEDB.4.0');
Password :=s_ini.readstring('data_set','Password','""');
Data_Source :=s_ini.readstring('data_set','Data Source','//Hrserver2/STATION/table/Certificate.mdb');
Persist_Security_Info:=s_ini.readstring('data_set','Persist Security_Info','True');
finally
s_ini.free;
end;
except
on e:efopenerrordo
Application.MessageBox(pchar(e.message),'错误信息', mb_oK + mb_iconexclamation);
else
Application.MessageBox('系统配制 .ini 文件操作失败 !' ,'错误信息', mb_oK + mb_iconexclamation);
end;
end;