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

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

   drv=fso.GetDrive(driveval);
   totalsize=Math.round((drv.TotalSize/Math.pow(2,30))*100)/100;
   freespace=Math.round((drv.FreeSpace/Math.pow(2,30))*100)/100;
   usespace=Math.round((totalsize-freespace)*100)/100;
   totalsize>1 ? totalsize+="GB":totalsize=totalsize*Math.pow(2,10)+"MB";
   freespace>1 ? freespace+="GB":freespace=freespace*Math.pow(2,10)+"MB";
   usespace>1 ? usespace+="GB":usespace=usespace*Math.pow(2,10)+"MB";
   att+="本地磁盘:"+driveval+"n文件系统:"+drv.FileSystem+"n磁盘大小:"+totalsize+"n已用空间:"+usespace+"n可用空间:"+freespace+"n";
   outstr="";
   currentdrive=pathstr=driveval+":";
   ffolder=fso.GetFolder(pathstr+"").SubFolders;
   getdata=new Enumerator(ffolder);
   outstr="<div class='showcon'>文件夹:[<a href='' onclick="return unfurlorfold('folshow',this);">隐藏</a>]<div id='folshow'>";
   ppathcounter=0;
   for(;!getdata.atEnd();getdata.moveNext())
    {
     attribu=getdata.item().Attributes;
     if(hidestate||attribu==16||attribu==17||attribu==48||attribu==49)
      {
        fcount++;
        ppath[ppathcounter]=driveval+":"+getdata.item().name;
        outstr+="<div><a href='' onClick="folderactive(ppath["+ppathcounter+"]);"
        outstr+="return false;">"+getdata.item().Name+"</a></div>";
        ppathcounter++;
      }
    }
   subfolfil="找到"+fcount+"个文件夹,";
   fcount=0;
   ffile=fso.GetFolder(pathstr).Files;
   getdata=new Enumerator(ffile);
   outstr+="</div></div><div class='showcon'>文  件:[<a href='' onclick="return unfurlorfold('filshow',this);">隐藏</a>]<div id='filshow'>";
   for(;!getdata.atEnd();getdata.moveNext())
    {
     attribu=getdata.item().Attributes;
     if(hidestate||attribu==0||attribu==1||attribu==32||attribu==33)
      {
        fcount++;
        outstr+="<div><a href=""+currentdrive+"" target='_blank'>"+getdata.item().Name+"</a></div>";