临时保存

WMI(Windows?Management Instrumentation ) 非常强大,它可以以数据库的形式查询你的电脑的软件和硬件,在它的数据库里面,时刻保存着最新的软件信息和硬件信息,因此你可以用WMI来检测CUP主频、温度,读取WINDOWS的进程.........

uses
  FileCtrl;

procedure TForm1.Button1Click(Sender: TObject);
var
  Dir: string;
begin
  if SelectDirectory('选择备份文件存放目录', 'C:Windows', Dir, [sdNewFolder, sdShowEdit, sdShowShares,
          sdNewUI, sdShowFiles, sdValidateDir]) then
    if Dir <> '' then
      MessageBox(Handle, PChar(Dir), '', MB_OK);
end;

1.把编译出来的文件requireAdmin.res放到项目同目录下

2.打开Project菜单下的View Source菜单项,然后在
code{$R *.res}
下面添加一行
code{$R requireAdmin.res}

3.重新编译即可.

原文地址:https://www.cnblogs.com/o594cql/p/4689012.html