硬盘浏览程序,保存成网页格式便可使用

2019-06-03 14:49:49王振洲

   att+="[<a href='' onclick="addfav();return false;">收藏</a>]";
   document.getElementById("openfol").innerHTML=att;
   getdata="";
   openfromfav=0;
  }catch(errorinf){alert(errorinf.description+"nn请不要随便改变数据文件*.ini文件中的内容.");}
}
function upfile()
{
   var rootpath="";
   rootpath=currentdrive;
   if(!rootpath.match(/^[a-z]:$/i))
     {
        rootpath=rootpath.replace(/[^]*$/,"");
        if(rootpath.match(/^[a-z]:$/i)){rootpath+="";}
        folderactive(rootpath);
     }
   else
     alert("驱动器根目录.");
}
function flashdrive()
{
  folderactive(currentdrive);
}
function openfav()
{
   lastfav="";
   var outstr="",i=0;
   for(i;i<favcounter;i++)
    {
      outstr+="<a id='fav"+i+"' href='' onclick="openfromfav=1;folderactive(favorite["+i+"]);"
      outstr+="favactive(this.id);return false;" target='_blank'>"+favorite[i].replace(/^.+/,"")+"</a><br>";
    }
   document.getElementById("showfavorite").innerHTML=outstr;
   document.getElementById("delfav").value="";
}
function favactive(favid)
{
   var i=parseInt(favid.match(/d/));
   if(lastfav!="")
      document.getElementById(lastfav).style.backgroundColor="#CCCCCC";
   lastfav=favid;
   document.getElementById("delfav").value=favorite[i];
   document.getElementById(lastfav).style.backgroundColor="#FFFFDD";
   document.getElementById("showorhide").focus();
}
function addfav()
{
try
{
   if(currentdrive.match(/^[a-z]:$/i))
     {
       alert("只能收藏文件夹.");
       return false;
     }
   var i=0;
   for(i=0;i<favcounter;i++)
     {
       if(favorite[i]==currentdrive)
         {
            alert("常用文件夹中已经存在该文件夹.");
            return false;