发信人: redfox (Z掉了几乎所有的版...), 信区: BorlandDev
标  题: Delphi编程 -- 3.3 获取当前程序的目录
发信站: 哈工大紫丁香 (2000年09月01日13:50:53 星期五), 站内信件

获取当前程序的目录。 

你可以使用APPLICATION对象中的EXENAME属性
functionGetExePath:String;
varLastBackSlashPos,Index:Integer;
begin
Result:ΚApplication.ExeName;
forIndex:Κ1tolength(Result)do
ifResult[Index]Κ′ι′then
LastBackSlashPos:ΚIndex;
{subtract1sothatthelastbackslashisnotincluded}
Result[0]:Κchr(LastBackSlashPos-1);
end;

 

--
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.227.107]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.596毫秒