我改代理服务器的代码如下:请指教!
var
registerTemp : TRegistry;
begin
time_sum:=time_sum+1;
if downhtmlc<>0 then begin
downhtmlc:=downhtmlc+1;
end;
if (time_refresh<>0) and ((time_sum mod time_refresh)=0)
then begin
if bb_go.Enabled then begin
//改代理服务器
with registerTemp do begin
try
registerTemp := TRegistry.Create;
//建立一个Registry实例
RootKey:=HKEY_CURRENT_USER
//设置根键值为HKEY_CURRENT_USER
if OpenKey('/Software/Microsoft/Windows/CurrentVersion/Internet Settings',false) then begin
writebool('ProxyEnable',cb_proxy.Checked);
writestring('ProxyServer','');
end;
finally
CloseKey;
Free;
end;
end;
if cb_proxy.Checked and (lb_proxy.Items.Count>0) then begin
with registerTemp do begin
try
registerTemp := TRegistry.Create;
//建立一个Registry实例
RootKey:=HKEY_CURRENT_USER
//设置根键值为HKEY_CURRENT_USER
if OpenKey('/Software/Microsoft/Windows/CurrentVersion/Internet Settings',false) then begin
writestring('ProxyServer',lb_proxy.Items.Strings[pos_proxy]);
sb_main.Panels[2].Text:=lb_proxy.Items.Strings[pos_proxy];
//移到下一个代理的位置
pos_proxy:=(pos_proxy+1) mod lb_proxy.Items.Count;
sendmessage(0,wm_notify,0,0);
end;
finally
CloseKey;
Free;
end;
end;
end;
wb_main.Navigate('www.delphibbs.com');
end;
end;
end;