提供改注册表的方法:<br>以下程序在窗口创建时读入播放器路径参数到Edit1,修改Edit1后点击Button1写入注册表<br><br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls,Registry;<br><br>type<br> TForm1 = class(TForm)<br> Edit1: TEdit;<br> Button1: TButton;<br> procedure FormCreate(Sender: TObject);<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>var<br>reg :TRegistry;<br>begin<br>Reg:=TRegistry.Create;<br> with reg do<br> try<br> begin<br> RootKey := HKEY_CLASSES_ROOT;<br> OpenKey('/AudioCD/shell/play/command',false);<br> Edit1.Text:=ReadString('');<br> end<br> finally<br> Closekey;<br> Free;<br> end;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>reg :TRegistry;<br>begin<br>Reg:=TRegistry.Create;<br> with Reg do<br> try<br> begin<br> RootKey := HKEY_CLASSES_ROOT;<br> OpenKey('/AudioCD/shell/play/command',false);<br> WriteString('',Edit1.Text);<br> end<br> finally<br> CloseKey;<br> Free;<br> end;<br>end;<br>end.<br>