代码文件:
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  万一  阅读(3235)  评论(2编辑  收藏  举报