荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: Peter (小飞侠), 信区: Program
标  题: DELPHI使用技巧(5)
发信站: BBS 荔园晨风站 (Thu Jan 21 22:31:36 1999), 转信


技巧5:获取当前程序的目录。

    你可以使用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 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.1.3]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店