All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
delphi获取当前目录

Writer: aaa Article type: Programming skills(编程技巧) Time: 2014/7/19 0:13:17 Browse times: 299 Comment times: 0

delphi获取当前目录


Head photo

Go homepage
Upload pictures
Write articles

delphi获取当前目录|GetCurrentDirectory()函数

获取当前目录
要获取当前目录的位置,即应用程序的执行目录,可以调用Win32 的GetCurrentDirectory()函数。
该函数的用法与GetSystemDirectory()、GetWindowsDirectory()相似,所不同的是,参数的顺序刚好相反。下面的示例代码演示了GetCurrentDirectory()的用法。
procedure TForm1.Button1Click(Sender: TObject);
var
CurrDir:String;
begin
SetLength(CurrDir,144);
if GetCurrentDirectory(144,(PChar(CurrDir)))<>0 then
begin
SetLength(CurrDir,Length(PChar(CurrDir)));
Edit1.Text:=CurrDir;
end
else
RaiseLastWin32Error;
end;





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.