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

 
delphi获取System目录

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

delphi获取System目录


Head photo

Go homepage
Upload pictures
Write articles

delphi获取System目录|GetSystemDirectory函数

获取System 目录
获取System 目录只需要用一个Win32 函数就能够实现,此函数为GetSystemDirectory,它的原型如下:
UINT GetSystemDirectory(
LPTSTR lpBuffer, //变量
UINT uSize //变量大小
);
(1)新建一个项目,向窗体上添加一个Edit 组件和一个Button 组件,并设置Button 组件的Caption 属性为“获得”。
(2)为“获得”按钮编写代码。
procedure TForm1.Button1Click(Sender: TObject);
var
MySysPath:PChar;
begin
GetMem(MySysPath,255);
GetSystemDirectory(MySysPath,255); //取得系统目录
Edit1.Text:=MySysPath;
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.