我有这样的系统,如果你要找我(我的MSN:wangbarry@taihsing.com.cn)
var
reg:TRegistry;
NumSec: SmallInt;
StartTime: TDateTime;
LABEL Systemsetup;
begin
//开始运行
S_RegTree:='/Software/SytySoft/THINKSHOP';
//延时
numsec:=1;
//延时1秒
StartTime :=now;
repeat
application.ProcessMessages ;
until Now > StartTime + NumSec * (1/24/60/60);
Systemsetup: //重新设置时的入口
reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CURRENT_USER;
try
if (Reg.OpenKey(S_RegTree,False))=False then
begin
// 如果注册表中没有信息则创建初始化信息
//打开注册窗口
Application.CreateForm(TFrm_setup, Frm_setup);
with Frm_setupdo
begin
sb_stop.Visible :=true;
Caption :=Caption +'(初始化设置)';
showmodal;
free;
end;
end;
Reg.OpenKey(S_RegTree,True);
S_name:=reg.ReadString('Coname');
S_username:=reg.ReadString('username');
S_cotel:=reg.ReadString('Cotel');
S_address:=reg.ReadString('address');
S_autosave:=reg.Readstring('autosave');
S_savedays:=reg.Readstring('savedays');
if Reg.ReadString('Countdate')='1' then
try
I_countdate:=reg.ReadInteger('Dateday');
except
I_countdate:=0;
end
else
I_countdate:=0;
HWSHOPDATA:=reg.ReadString('Datapath');
if HWSHOPDATA='【系统默认】' then
begin
HWSHOPDATA:=ExtractFileDir(Application.ExeName);
if (StrLen(PChar(HWSHOPDATA)) <> 3) then
HWSHOPDATA:=HWSHOPDATA+'/DATA/'
else
HWSHOPDATA:=HWSHOPDATA+'DATA/';
end;
if (trim(s_name)='') then
begin
reg.DeleteKey(S_RegTree);
reg.CloseKey ;
reg.Free ;
halt;
end;
finally
Reg.CloseKey;
Reg.Free;
end;