如何Install Shield Express做数据库程序客户端安装程序? 建议采用Delphi6的InstallShield,在D6目录下的MergeModals文件夹中有许多一打包的安装包,使得Delphi6的应用发布变得易如反掌。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 uses Registry;function RestoreRegistry( ASalaryReg: TRegistry): Boolean;var WinPath: PChar; // Windows directory AppPath: PChar; // Application directory BackupDirPath: string;// backup directory path ReckoningDay: integer; // reckoning daybegin try Result := FALSE; WinPath := NIL; AppPath := NIL; try //1. 创建主建(SalaryManager) //1. Create the main key if (ASalaryReg.CreateKey(SalaryHKey)) then ASalaryReg.OpenKey(SalaryHKey, FALSE); //2. 恢复Windows系统路径,(WindowsDirectory) //2. Get the system path. WinPath := StrAlloc(255); GetSystemDirectory(WinPath, 255); ASalaryReg.WriteString('DriverDirectory', StrPas(WinPath)); //3. 恢复应用程序路径,(InstallPath) //3. Get the application path AppPath := StrAlloc(255); GetCurrentDirectory(255, AppPath); ASalaryReg.WriteString('InstallPath', StrPas(AppPath)); //4. 恢复Program键 //4. Restore 'Program' key ASalaryReg.WriteString('Program', StrPas(AppPath)+'\SalaryMng.exe'); //5. 恢复CurrentYear键 //5. Restore 'CurrentYear' key ASalaryReg.WriteString('CurrentYear', CurrentYear); //6. 恢复CurrentMonth键 //6. Restore 'CurrentMonth' key ASalaryReg.WriteString('CurrentMonth', CurrentMonth); //7. 恢复DataPath键 //7. Restore 'DataPath' key ASalaryReg.WriteString('DataPath', StrPas(AppPath)+'\Data'); //8. 恢复ErrorLoginTimes键 //8. Restore 'ErrorLoginTimes' key ASalaryReg.WriteInteger('ErrorLoginTimes', 0); //9. 恢复BackupDir键 //9. Restore 'BackupDir' key BackupDirPath := InputBox('备份目录路径', '请输入备份目录路径', StrPas(AppPath)+'\Backup'); if BackupDirPath = '' then ASalaryReg.WriteString('BackupDir', StrPas(AppPath)+'\Backup') else ASalaryReg.WriteString('BackupDir', BackupDirPath); //10. 恢复结帐日期键 //10. Restore the 'ReckoningDay' key ReckoningDay := StrToInt(InputBox('输入', '请输入结帐日期', '27')); if (1<=ReckoningDay) AND (ReckoningDay<31) then ASalaryReg.WriteInteger('ReckoningDay', ReckoningDay) else begin MessageBox(0, PChar('结帐日期'), PChar('无效的日期数值'#10#13'将以默认的27号写入注册表'+ '你可以使用系统的''结帐日期来修改''.'), MB_OK OR MB_ICONERROR ); ASalaryReg.WriteInteger('ReckoningDay', 27); end;//if ASalaryReg.CloseKey; Result := TRUE; finally StrDispose(WinPath); StrDispose(AppPath); end;//try..finally except on E: ERegistryException do begin MessageDlg('注册表恢复操作错误!', mtError, [mbOk], 0); end; end;//try..exceptend;//RestroreRegistry 用BDE不行吗,非要ODBC吗,要是我的话,我会做成三层的,发布相当简单,你说呢 Delphi 定界符? Msxml2.XMLHTTP 捕获它的异常 dephi 调试过程看内存???? 打开mdi子窗体时发生错误,急需解决,在线等待 INSERT出错,找不出,帮帮忙............. DBGridEh中加入下拉框已做好,如何才能使用户只能从下拉表中选取而不能输入? 如何控制添加的记录写回或不写回到表里去? RMreport中如何做主从明细报表? 设计报表时,QuickRep的概念问题?谢谢回答. 需用您的帮助—软件测试(有偿)--2 讨论,哪一类的程序员最有前钱途?? 我快疯了———— 关于 CGI 问题
Registry;function RestoreRegistry( ASalaryReg: TRegistry): Boolean;
var
WinPath: PChar; // Windows directory
AppPath: PChar; // Application directory
BackupDirPath: string;// backup directory path
ReckoningDay: integer; // reckoning day
begin try
Result := FALSE;
WinPath := NIL;
AppPath := NIL;
try
//1. 创建主建(SalaryManager)
//1. Create the main key
if (ASalaryReg.CreateKey(SalaryHKey)) then
ASalaryReg.OpenKey(SalaryHKey, FALSE); //2. 恢复Windows系统路径,(WindowsDirectory)
//2. Get the system path.
WinPath := StrAlloc(255);
GetSystemDirectory(WinPath, 255);
ASalaryReg.WriteString('DriverDirectory', StrPas(WinPath)); //3. 恢复应用程序路径,(InstallPath)
//3. Get the application path
AppPath := StrAlloc(255);
GetCurrentDirectory(255, AppPath);
ASalaryReg.WriteString('InstallPath', StrPas(AppPath)); //4. 恢复Program键
//4. Restore 'Program' key
ASalaryReg.WriteString('Program', StrPas(AppPath)+'\SalaryMng.exe'); //5. 恢复CurrentYear键
//5. Restore 'CurrentYear' key
ASalaryReg.WriteString('CurrentYear', CurrentYear); //6. 恢复CurrentMonth键
//6. Restore 'CurrentMonth' key
ASalaryReg.WriteString('CurrentMonth', CurrentMonth); //7. 恢复DataPath键
//7. Restore 'DataPath' key
ASalaryReg.WriteString('DataPath', StrPas(AppPath)+'\Data'); //8. 恢复ErrorLoginTimes键
//8. Restore 'ErrorLoginTimes' key
ASalaryReg.WriteInteger('ErrorLoginTimes', 0); //9. 恢复BackupDir键
//9. Restore 'BackupDir' key
BackupDirPath := InputBox('备份目录路径', '请输入备份目录路径',
StrPas(AppPath)+'\Backup');
if BackupDirPath = '' then
ASalaryReg.WriteString('BackupDir', StrPas(AppPath)+'\Backup')
else
ASalaryReg.WriteString('BackupDir', BackupDirPath); //10. 恢复结帐日期键
//10. Restore the 'ReckoningDay' key
ReckoningDay := StrToInt(InputBox('输入', '请输入结帐日期', '27'));
if (1<=ReckoningDay) AND (ReckoningDay<31) then
ASalaryReg.WriteInteger('ReckoningDay', ReckoningDay)
else begin
MessageBox(0, PChar('结帐日期'), PChar('无效的日期数值'#10#13'将以默认的27号写入注册表'+
'你可以使用系统的''结帐日期来修改''.'), MB_OK OR MB_ICONERROR );
ASalaryReg.WriteInteger('ReckoningDay', 27);
end;//if ASalaryReg.CloseKey;
Result := TRUE; finally
StrDispose(WinPath);
StrDispose(AppPath);
end;//try..finally
except
on E: ERegistryException do begin
MessageDlg('注册表恢复操作错误!', mtError, [mbOk], 0);
end; end;//try..exceptend;//RestroreRegistry