硬盘浏览程序,保存成网页格式便可使用_javascript技巧_脚本之家

硬盘浏览程序,保存成网页格式便可使用,放到随意一个盘,不要放桌面就可以了复制代码 代码如下:

varerrorinf=newError(); varfso,fdrive,ffolder,ffile;
vargetdata=””,selfpath=””,drvpath=””,favpath=””; vardrive=newArray;
varcurrentdrive=””; varhidestate=false; varlastdrive=””,lastfav=””;
varppath=newError(),ppathcounter=0,favcounter=0; varopenfromfav=0;
functioninitdoc() { try { varoutstr=””,counter=0,i=0,writestr=””;
fso=newActiveXObject(“Scripting.FileSystemObject”);
selfpath=fso.GetParentFolderName(location.pathname.replace;
drvpath=selfpath+”\\drvinf.ini”; /*Gettheharddrivesonthecomputer.*/
if(!fso.FileExists { fdrive=fso.Drives; getdata=newEnumerator;
for;getdata.moveNext.DriveType==2) {
drive[counter]=getdata.item().DriveLetter;
writestr+=drive[counter]+”$”; counter++; } ffile=fso.CreateTextFile;
writestr=writestr.replace; ffile.WriteLine; ffile.Close(); } else {
ffile=fso.OpenTextFile;
getdata=ffile.ReadAll().replace(/\’|\”|\\|\/|\:|\s+/g,””);
getdata=getdata.replace; getdata=getdata.replace; drive=getdata.split; }
for(i=0;i本地磁盘:”+drive[i]+”]”; outstr+=”显示隐藏内容”
document.getElementById.innerHTML=outstr; getdata=””;outstr=””;
/*Gettheexistitem.*/ favpath=selfpath+”\\favinf.ini”;
if(fso.FileExists { ffile=fso.OpenTextFile; if {
getdata=ffile.ReadAll().replace; getdata=getdata.replace;
getdata=getdata.replace; favorite=getdata.split; if favcounter=0; else
favcounter=favorite.length; } else { ffile=fso.CreateTextFile;
ffile.Close(); favcounter=0; } openfav; getdata=””;
}catch{alert(errorinf.description+”\n\n请不要随便改变数据文件*.ini文件中的内容.”);}
} functiondriveactive { try{ if(lastdrive==&&currentdrive.match {
document.getElementById; returnfalse; } iflastdrive=”driveC”;
document.getElementById.style.backgroundColor=”#CCCCCC”;
lastdrive=”drive”+driveval;
document.getElementById.style.backgroundColor=”#FFFFDD”;
varatt=””,drv,totalsize,freespace,usespace,outstr=””,pathstr=””,attribu=0,subfolfil=””,fcount=0;
drv=fso.GetDrive; totalsize=Math.round((drv.TotalSize/Math.pow/100;
freespace=Math.round((drv.FreeSpace/Math.pow/100;
usespace=Math.round*100)/100;
totalsize>1?totalsize+=”GB”:totalsize=totalsize*Math.pow+”MB”;
freespace>1?freespace+=”GB”:freespace=freespace*Math.pow+”MB”;
usespace>1?usespace+=”GB”:usespace=usespace*Math.pow+”MB”;
att+=”本地磁盘:”+driveval+”\n文件系统:”+drv.FileSystem+”\n磁盘大小:”+totalsize+”\n已用空间:”+usespace+”\n可用空间:”+freespace+”\n”;
outstr=””; currentdrive=pathstr=driveval+”:\\”;
ffolder=fso.GetFolder.SubFolders; getdata=newEnumerator;
outstr=”文件夹:[隐藏]”; ppathcounter=0; for;getdata.moveNext {
attribu=getdata.item().Attributes;
if(hidestate||attribu==16||attribu==17||attribu==48||attribu==49) {
fcount++; ppath[ppathcounter]=driveval+”:\\”+getdata.item().name;
outstr+=”

“+getdata.item().Name+”

“; ppathcounter++; } } subfolfil=”找到”+fcount+”个文件夹,”; fcount=0;
ffile=fso.GetFolder.Files; getdata=newEnumerator;
outstr+=”文&nbsp件:[隐藏]”; for;getdata.moveNext {
attribu=getdata.item().Attributes;
if(hidestate||attribu==0||attribu==1||attribu==32||attribu==33) {
fcount++; outstr+=”

“+getdata.item().Name+”

“; } } outstr+=””; subfolfil+=fcount+”个文件.”;
document.getElementById.innerHTML=outstr;
document.getElementById.innerText=currentdrive;
document.getElementById.innerText=att;
att=”文件夹名称:\n\n文件夹大小:\n创建时间:\n\n修改时间:\n\n访问时间:\n\n”;
document.getElementById.innerText=att;
document.getElementById.innerText=subfolfil; att=”[打开]”;
att+=”[收藏]”; document.getElementById.innerHTML=att;
document.getElementById; getdata=””;
}catch{alert(errorinf.description+”\n\n请不要随便改变数据文件*.ini文件中的内容.”);}
} functionfolderactive { try { varatt=””,fol=””,totalsize=0,sizesign=””;
openfolder; if(!folderval.match { fol=fso.GetFolder;
totalsize=fol.Size/Math.pow;
totalsize>1?sizesign=”GB”:(totalsize=totalsize*Math.pow;
(totalsize<1&&sizesign==”MB”)?(totalsize=totalsize*Math.pow:{}
totalsize=Math.round/100+sizesign;
att+=”文件夹名称:\n”+fol.Name+”\n文件夹大小:”+totalsize+”\n创建时间:\n”;
att+=fol.DateCreated+”\n修改时间:\n”+fol.DateLastModified+”\n访问时间:\n”+fol.DateLastAccessed;
document.getElementById.innerText=att+”\n”; }
}catch{alert(errorinf.description+”\n\n请不要随便改变数据文件*.ini文件中的内容.”);}
} functionopenfolder { try {
varsign=0,outstr=””,attribu=0,subfolfil=””,fcount=0;
if{alert;returnfalse;} currentdrive=currfolder;
ffolder=fso.GetFolder.SubFolders; getdata=newEnumerator;
outstr=”文件夹:[隐藏]”; ppathcounter=0; for;getdata.moveNext {
attribu=getdata.item().Attributes;
if(hidestate||attribu==16||attribu==17||attribu==48||attribu==49) {
fcount++;
ppath[ppathcounter]=currfolder.replace+”\\”+getdata.item().name;
outstr+=”

“+getdata.item().Name+”

“; ppathcounter++; } } subfolfil=”找到”+fcount+”个文件夹,”; fcount=0;
ffile=fso.GetFolder.Files; getdata=newEnumerator;
outstr+=”文&nbsp件:[隐藏]”; for;getdata.moveNext {
attribu=getdata.item().Attributes;
if(hidestate||attribu==0||attribu==1||attribu==32||attribu==33) {
fcount++; if outstr+=”

“+getdata.item().Name+”

“; else outstr+=”

“+getdata.item().Name+”

“; } } outstr+=””; subfolfil+=fcount+”个文件.”;
document.getElementById.innerHTML=outstr;
document.getElementById.innerText=currentdrive;
att=”文件夹名称:\n\n文件夹大小:\n创建时间:\n\n修改时间:\n\n访问时间:”;
document.getElementById.innerText=att;
document.getElementById.innerText=subfolfil; att=”[打开]”;
att+=”[收藏]”; document.getElementById.innerHTML=att; getdata=””;
openfromfav=0;
}catch{alert(errorinf.description+”\n\n请不要随便改变数据文件*.ini文件中的内容.”);}
} functionupfile() { varrootpath=””; rootpath=currentdrive;
if(!rootpath.match { rootpath=rootpath.replace;
if(rootpath.match{rootpath+=”\\”;} folderactive; } else alert; }
functionflashdrive() { folderactive; } functionopenfav() { lastfav=””;
varoutstr=””,i=0; for { outstr+=””+favorite[i].replace+”
“; } document.getElementById.innerHTML=outstr;
document.getElementById.value=””; } functionfavactive { vari=parseInt;
if document.getElementById.style.backgroundColor=”#CCCCCC”;
lastfav=favid; document.getElementById.value=favorite[i];
document.getElementById.style.backgroundColor=”#FFFFDD”;
document.getElementById; } functionaddfav() { try {
if(currentdrive.match { alert; returnfalse; } vari=0; for {
if(favorite[i]==currentdrive) { alert; returnfalse; } }
if(fso.FileExists { ffile=fso.OpenTextFile; } else {
ffile=fso.CreateTextFile; } ffile.Write; ffile.Close();
favorite[favcounter]=currentdrive; favcounter++; openfav;
}catch{alert(errorinf.description+”\n\n请不要随便删除数据文件*.ini文件.”);}
} functiondelfav() { try { vardelpath=document.getElementById.value;
vari=lastfav.match; varnewfav=””; document.getElementById; if { alert;
returnfalse; } if(confirm:\n”+delpath+”\n?”)) { favcounter–; for
favorite[j]=favorite[j+1]; for newfav+=favorite[j]+”|”;
ffile=fso.OpenTextFile; newfav=newfav.replace; ffile.WriteLine;
ffile.Close; document.getElementById.value=””; alert; }
}catch{document.getElementById.value=””;alert(errorinf.description+”\n\n请不要随便删除数据文件*.ini文件.”);}
} functionunfurlorfold { if { obj.innerText=”显示”;
document.getElementById.style.display=”none”; } else {
obj.innerText=”隐藏”; document.getElementById.style.display=””; }
document.getElementById; returnfalse; }

FileLookThroughAdminV1.0

FileLookThroughAdmin



收藏夹 文件夹及文件

相关信息

HardDrives>>

Tag>> DisplayContent

CurrentPath>>

常用文件夹:

上一级目录 当前驱动器信息:

当前文件夹信息:

删除常用文件夹:

P:

[执行删除]

Design:sgw.LKing[FS:Ecjtu2006|QQ:28857496|E-Mail:sgw.lking@gmail.com][@06.11]

发表评论

电子邮件地址不会被公开。 必填项已用*标注