使用 TRegistry 类[2]: 读取 IE 浏览器的 Start Page

使用 TRegistry 类[2]: 读取 IE 浏览器的 Start Page


代码文件:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses Registry;

procedure TForm1.Button1Click(Sender: TObject);
var
  reg: TRegistry;
  s: string;
begin
  reg := TRegistry.Create;
  reg.RootKey := HKEY_CURRENT_USER;
  reg.OpenKey('Software\Microsoft\Internet Explorer\Main', False); {参数2为True时,会创建缺失}
  //reg.OpenKeyReadOnly('Software\Microsoft\Internet Explorer\Main'); {只读打开}
  s := reg.ReadString('Start Page');
  ShowMessage(s); {http://del.cnblogs.com/}
  reg.CloseKey;
  reg.Free;
end;

end.
posted on 2008-08-23 22:18  万一  阅读(3043)  评论(2)  编辑  收藏
上一篇:谁动了我的Token | TW洞见


下一篇:python函数