J
jiichen
Unregistered / Unconfirmed
GUEST, unregistred user!
s:=AgentComboBox1.Text;
tr:=TRegistry.Create;
try
// write System User Agent
tr.RootKey:=HKEY_CURRENT_USER;
if tr.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Internet Settings',false) then
begin
tr.WriteString('User Agent',s);
tr.Closekey;
end;
tr.RootKey := HKEY_USERS;
if tr.OpenKey('.DEFAULT/Software/Microsoft/Windows/CurrentVersion/Internet Settings', FALSE) then
begin
tr.WriteString('User Agent',s);
tr.CloseKey;
end;
webBrowser.UserAgent:=s;
InternetSetOption(nil, INTERNET_OPTION_SETTINGS_CHANGED, nil, 0);
finally
tr.Free;
end;
以上代碼無效,有人知道要如何改嗎?
或者是 INTERNET_OPTION_USER_AGENT 要如何使用?
OS: Win2000
tr:=TRegistry.Create;
try
// write System User Agent
tr.RootKey:=HKEY_CURRENT_USER;
if tr.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Internet Settings',false) then
begin
tr.WriteString('User Agent',s);
tr.Closekey;
end;
tr.RootKey := HKEY_USERS;
if tr.OpenKey('.DEFAULT/Software/Microsoft/Windows/CurrentVersion/Internet Settings', FALSE) then
begin
tr.WriteString('User Agent',s);
tr.CloseKey;
end;
webBrowser.UserAgent:=s;
InternetSetOption(nil, INTERNET_OPTION_SETTINGS_CHANGED, nil, 0);
finally
tr.Free;
end;
以上代碼無效,有人知道要如何改嗎?
或者是 INTERNET_OPTION_USER_AGENT 要如何使用?
OS: Win2000