Delphi获取程序自身路径
Delphi 提供了分析文件名的多个函数,如果你需要从文件名中得到路径名,可用下面的两个函数,这两个函数有一点点微小的差别:
ExtractFilePath(FileName:String) 该函数返回路径名,其结尾字符总是“\”
ExtractFileDir(FileName:String) 该函数同样返回路径名,但不包括结尾的字符“\”,除非返回的路径是根目录。
样例代码:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(ExtractFileDir(Application.Exename)); // 如: c:\temp
ShowMessage(ExtractFilePath(Application.Exename)); // 如: c:\temp\
end;

/bbs/UploadFile/2005-3/2005320191459674.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www./bbs/UploadFile/2005-3/2005320191459674.gif');}" onmousewheel="return imgzoom(this);" alt="" />