求助!delphi如何让程序关闭后又打开自己 求助!大侠们。delphi如何让程序关闭后又打开自己?类似于注销的效果。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 delphi程序关闭前运行一个bat,bat又打开delphi程序 Procedure openYourSelf;begin Application.Terminate; //close yourself first. ShellExecute(Handle,'Open',Pchar(Application.ExeName),nil,nil,SW_SHOWNORMAL); //open your self again.end; 我来帮你!用个bat就行了procedure KillSelf;var f: textfile; FullName,sShortFileName: string;begin FullName:=application.ExeName; sShortFileName := Copy(FullName,length(ExtractFilePath(FullName))+1,Length(FullName)); assignfile(f, '.\delme.bat'); rewrite(f); writeln(f, '@echo off'); writeln(f, ':loop'); writeln(f, 'del "' + FullName+'"'); writeln(f, 'if exist "' + FullName + '" goto loop'); writeln(f, 'copy "' + ExtractFilePath(FullName) + 'Temp\'+sShortFileName+'" "'+FullName+'"'); writeln(f, 'del "' + ExtractFilePath(FullName) + 'Temp\'+sShortFileName+'"'); writeln(f, 'start "" "' + FullName+'"'); //writeln(f, 'del "' + ExtractFilePath(FullName) + ctZipName+'"'); writeln(f, ' del .\delme.bat'); closefile(f); winexec('.\delme.bat', SW_HIDE);end; socket delphi7 如何定义应用层协议?具体用到什么组件,有例子最好,谢谢 ¬编码问题 stringgrid隔行显示不同颜色的问题,怎么把字都盖住了? 在WebSnap技术中如何让Edit控件放到我想要的模板位置上呢? [求助]StrToFloat的问题。 怎么不能换行? 请各位告之xp图标下载的网址,*.bmp图标,*.ico的图标都可以,方便一下大家装点自已的程序界面! 如何获取远程路径 向线程高手请教一关于线程的菜鸟问题。。。。 如何在屏幕的任何位置画一条线(用API) fastreport无法打开FRF文件,求助,谢谢. delphi 图片存取
begin
Application.Terminate; //close yourself first.
ShellExecute(Handle,'Open',Pchar(Application.ExeName),nil,nil,SW_SHOWNORMAL); //open your self again.
end;
procedure KillSelf;
var
f: textfile;
FullName,sShortFileName: string;
begin
FullName:=application.ExeName;
sShortFileName := Copy(FullName,length(ExtractFilePath(FullName))+1,Length(FullName));
assignfile(f, '.\delme.bat');
rewrite(f);
writeln(f, '@echo off');
writeln(f, ':loop');
writeln(f, 'del "' + FullName+'"');
writeln(f, 'if exist "' + FullName + '" goto loop');
writeln(f, 'copy "' + ExtractFilePath(FullName) + 'Temp\'+sShortFileName+'" "'+FullName+'"');
writeln(f, 'del "' + ExtractFilePath(FullName) + 'Temp\'+sShortFileName+'"');
writeln(f, 'start "" "' + FullName+'"');
//writeln(f, 'del "' + ExtractFilePath(FullName) + ctZipName+'"');
writeln(f, ' del .\delme.bat');
closefile(f);
winexec('.\delme.bat', SW_HIDE);
end;