如果将变量保存在程序文件(EXE、DLL)中 意思也就是说一个变量Str在安装的时候初始化为空串,在使用中可以对变量Str变量进行赋值,然后存储在Exe或DLL文件中,以后再使用Str变量的值就是赋值过的变量,请大家帮我一把很急!!!!!!问题解决再送200分 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没想到什么好的办法。为什么不用配置文件ini程序启动时读入,退出时写配置文件. 用INI文件或写入注册表比较好 搂上理解得不错 你要想放在 运行程序本身 死了这条心吧 蠕虫并不是对文件进行了修改他是检测文件运行时自动启动自己 这牵扯地层地址的跳转 如果直接对程序修改的话(debug调试除外)会造成程序不能运行用ini 或者其他文件 可以 运行时生成自身的备份,并修改备份中相应的数据,数据在文件中的偏移只能你自己去定位了,运行结束后删除原来的文件,并把备份文件改成原来的文件名!可以用批处理文件来完成这个任务 BatchFileName := ExtractFilePath(ParamStr(0)) + '_changeme.bat'; AssignFile(BatchFile, BatchFileName); Rewrite(BatchFile); Writeln(BatchFile, ':try'); Writeln(BatchFile, 'del "' + ParamStr(0) + '"'); Writeln(BatchFile, 'ren "' + ExtractFilePath(ParamStr(0)) + '_backfile.dat" "' + ParamStr(0) + '"'); Writeln(BatchFile, 'if exist "' + ParamStr(0) + '"' + ' goto try'); Writeln(BatchFile, 'del %0'); CloseFile(BatchFile); FillChar(StartUpInfo, SizeOf(StartUpInfo), $00); StartUpInfo.dwFlags := STARTF_USESHOWWINDOW; StartUpInfo.wShowWindow := SW_HIDE; if CreateProcess(nil, PChar(BatchFileName), nil, nil, False, IDLE_PRIORITY_CLASS, nil, nil, StartUpInfo, ProcessInfo) then begin CloseHandle(ProcessInfo.hThread); CloseHandle(ProcessInfo.hProcess); end; 学习……收藏……!在程序运行时修改自身,如果可行的话,那就不用配置INI文件或注册表了。如果记录程序的运行次数更好。 COM 挂接IE事件 如何让MDI窗体下的相同子窗体不重复开启 delphi怎么读写二进制文件? 批量动态创建控件出错(请高手指点) BMP转成JPG后...的问题. 高手们!帮我看一个有关FastReport的问题吧! 请教在输入用户名及密码进行登录过程SQL服务器的时候,如何出现提示"正在登录"? 有关启动的时候 如果将form隐藏 关于使用ACM进行GSM录音的问题---我解决啦! delphi5中使用的有关堆栈的函数有什么? 有關WIN32控件的問題。高手進來 in 如何判断'*'是否在一字符串str1中出现两次?
为什么不用配置文件ini
程序启动时读入,退出时写配置文件.
他是检测文件运行时自动启动自己 这牵扯地层地址的跳转 如果直接对程序修改的话(debug调试除外)会造成程序不能运行用ini 或者其他文件 可以
可以用批处理文件来完成这个任务 BatchFileName := ExtractFilePath(ParamStr(0)) + '_changeme.bat'; AssignFile(BatchFile, BatchFileName);
Rewrite(BatchFile); Writeln(BatchFile, ':try');
Writeln(BatchFile, 'del "' + ParamStr(0) + '"');
Writeln(BatchFile, 'ren "' + ExtractFilePath(ParamStr(0)) + '_backfile.dat" "' + ParamStr(0) + '"'); Writeln(BatchFile,
'if exist "' + ParamStr(0) + '"' + ' goto try');
Writeln(BatchFile, 'del %0');
CloseFile(BatchFile); FillChar(StartUpInfo, SizeOf(StartUpInfo), $00);
StartUpInfo.dwFlags := STARTF_USESHOWWINDOW;
StartUpInfo.wShowWindow := SW_HIDE; if CreateProcess(nil, PChar(BatchFileName), nil, nil,
False, IDLE_PRIORITY_CLASS, nil, nil, StartUpInfo,
ProcessInfo) then
begin
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
end;
在程序运行时修改自身,如果可行的话,那就不用配置INI文件或注册表了。如果记录程序的运行次数更好。