更改IE,用什么函数? ( 积分: 100 )

  • 主题发起人 主题发起人 泊杨林
  • 开始时间 开始时间

泊杨林

Unregistered / Unconfirmed
GUEST, unregistred user!
在使用IE时,经常被修改了主页,那么如何修改为默认页,或者自己设置主页呢?<br>还有一个就是如何清除IE地址栏,希望高手给源码,谢谢了
 
在使用IE时,经常被修改了主页,那么如何修改为默认页,或者自己设置主页呢?<br>还有一个就是如何清除IE地址栏,希望高手给源码,谢谢了
 
uses Registry;<br>var<br> &nbsp;Reg:TRegistry;<br> &nbsp;webs:TStrings;<br> &nbsp;I: Integer;<br>begin<br> &nbsp;Reg:=TRegistry.Create;<br> &nbsp;webs:=TStringList.Create;<br><br> &nbsp;Reg.RootKey:=HKEY_CURRENT_USER;<br>//清除IE地址栏<br> &nbsp;Reg.OpenKey('Software/Microsoft/Internet Explorer/TypedURLs',True);<br> &nbsp;Reg.GetKeyNames(webs);<br> &nbsp;I:=0;<br> &nbsp;while I&lt;webs.Count do<br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp;Reg.DeleteKey(webs);<br> &nbsp; &nbsp; &nbsp;I:=I+1;<br> &nbsp; &nbsp;end;<br> &nbsp;Reg.CloseKey;<br>//修改为默认页<br> &nbsp;Reg.OpenKey('Software/Microsoft/Internet Explorer/Main',True);<br> &nbsp;Reg.WriteString('Local Page','C:/WINDOWS/SYSTEM/blank.htm');<br> &nbsp;Reg.WriteString('Start Page','about:blank');<br> &nbsp;Reg.CloseKey;<br><br> &nbsp;Reg.Free;
 
uses Registry;<br>var<br> &nbsp;Reg:TRegistry;<br> &nbsp;webs:TStrings;<br> &nbsp;I: Integer;<br>begin<br> &nbsp;Reg:=TRegistry.Create;<br> &nbsp;webs:=TStringList.Create;<br> &nbsp;Reg.RootKey:=HKEY_CURRENT_USER;<br> &nbsp;//删除IE地址栏记录<br> &nbsp;if not Reg.OpenKey('Software/Microsoft/Internet Explorer/TypedURLs',false) then<br> &nbsp;showmessage('');<br> &nbsp;Reg.GetValueNames(webs);<br> &nbsp;I:=0;<br> &nbsp;while I&lt;webs.Count do<br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp;//showmessage(webs);<br> &nbsp; &nbsp; &nbsp;Reg.DeleteValue(webs);<br> &nbsp; &nbsp; &nbsp;I:=I+1;<br> &nbsp; &nbsp;end;<br> &nbsp;Reg.CloseKey;<br> &nbsp;//修改为空白页<br> &nbsp;Reg.OpenKey('Software/Microsoft/Internet Explorer/Main',True);<br> &nbsp;Reg.WriteString('Local Page','C:/WINDOWS/SYSTEM/blank.htm');<br> &nbsp;Reg.WriteString('Start Page','about:blank');<br> &nbsp;Reg.CloseKey;<br> &nbsp;Reg.Free;<br>end;
 
根据调试,我用上面的代码实现了,调试一次成功,谢谢你提供的帮助!<br>能再请问下高手吗?<br>C:/Documents and Settings/Local Settings/History<br>这里面的历史记录怎么删除,能给点指导吗?
 
后退
顶部