代码如下:请高人帮忙...
function getapplicationpath(showresult:boolean):string ;
result:=paramstr(0);
result:=extractfilepath(result);
if showresult then
showmessage('程序的路径是:'+result);
end;
procedure showresult(info:string);
begin
showmessage('程序的路径是:'+info);
procedure TForm1.Button1Click(Sender: TObject);
var
s:string;
begin
s:=getapplicationpath(false);
info(s);
end;procedure TForm1.Button2Click(Sender: TObject);
begin
getapplicationpath(true);
end;end;
function getapplicationpath(showresult:boolean):string ;
result:=paramstr(0);
result:=extractfilepath(result);
if showresult then
showmessage('程序的路径是:'+result);
end;
procedure showresult(info:string);
begin
showmessage('程序的路径是:'+info);
procedure TForm1.Button1Click(Sender: TObject);
var
s:string;
begin
s:=getapplicationpath(false);
info(s);
end;procedure TForm1.Button2Click(Sender: TObject);
begin
getapplicationpath(true);
end;end;
解决方案 »
- DELPHI中如何对ARRAY进行过滤
- 如何对html代码进行格式化,得到我需要的内容?
- 谁能给我一个能在服务程序下强制关机2000/XP的代码?
- 哪位大哥大姐知道VC写的DLL,用Delphi来调用有什么讲究吗?
- 关于在Linux下开发Delphi的问题(在线等)
- intraweb 里用application.messageBox() 提示信息怎么么在服务端???
- 求助:做过或会做脚踏开关的朋友帮忙啊
- 问一个小小问题:在SQL SERVER中的存储过程中,是不是表变量不能定义成output输出变量?如能,应如何定义?
- 〓〓〓〓 如果一行输入大于250个字符,请问如何换行 〓〓〓〓
- 新手上路,送分题。。。。
- 关于 DELPHI的ActionList~~~~~
- MYSQL的Blob字段的内容过长时无法完全保存成文件
begin
result:=ExtractFilePath(Application.FileName);
if ShowResultthen
showmessage('程序的路径是:'+result);
end;
begin
result:=paramstr(0);
result:=extractfilepath(result);
if showresult then
showmessage('程序的路径是:'+result);
end;procedure showresult(info:string);
begin
showmessage('程序的路径是:'+info);
end;procedure TForm1.btn1Click(Sender: TObject);
var
s:string;
begin
s:=getapplicationpath(false);
showresult(s);
end;procedure TForm1.btn2Click(Sender: TObject);
begin
getapplicationpath(true);
end;