时间:2021-05-18
硬盘浏览程序,保存成网页格式便可使用,放到随意一个盘,不要放桌面就可以了
复制代码 代码如下:
<html>
<head>
<scriptlanguage="javascript"type="text/javascript">
varerrorinf=newError();
varfso,fdrive,ffolder,ffile;
vargetdata="",selfpath="",drvpath="",favpath="";
vardrive=newArray(),favorite=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";
if(!fso.FileExists(drvpath))
{
fdrive=fso.Drives;
getdata=newEnumerator(fdrive);
for(;!getdata.atEnd();getdata.moveNext())
if(getdata.item().DriveType==2)
{
drive[counter]=getdata.item().DriveLetter;
writestr+=drive[counter]+"$";
counter++;
}
ffile=fso.CreateTextFile(drvpath,true);
writestr=writestr.replace(/\$$/,"");
ffile.WriteLine(writestr+"\r");
ffile.Close();
}
else
{
ffile=fso.OpenTextFile(drvpath,1);
getdata=ffile.ReadAll().replace(/\'|\"|\\|\/|\:|\s+/g,"");
getdata=getdata.replace(/^\$+|\$+$/,"");
getdata=getdata.replace(/\$\$+/,"$");
drive=getdata.split("$");
ffile.Close();
}
for(i=0;i<drive.length;i++)
outstr+="[<ahref=''id='drive"+drive[i]+"'onClick=\"driveactive(drive["+i+"]);returnfalse;\">本地磁盘:"+drive[i]+"</a>]";
outstr+="显示隐藏内容<inputstyle='height:15px;border:none;'type='checkbox'id='showorhide'onClick='hidestate=this.checked;flashdrive();'>"
document.getElementById("drives").innerHTML=outstr;
getdata="";outstr="";
favpath=selfpath+"\\favinf.ini";
if(fso.FileExists(favpath))
{
ffile=fso.OpenTextFile(favpath,1);
if(!ffile.AtEndOfStream)
{
getdata=ffile.ReadAll().replace(/\"|\s+/g,"");
getdata=getdata.replace(/^\|+|\|+$/,"");
getdata=getdata.replace(/\|\|+/,"|");
favorite=getdata.split("|");
}
ffile.Close();
if(favorite[0]=="")
favcounter=0;
else
favcounter=favorite.length;
}
else
{
ffile=fso.CreateTextFile(favpath,true);
ffile.Close();
favcounter=0;
}
openfav();
driveactive("C");
getdata="";
}catch(errorinf){alert(errorinf.description+"\n\n请不要随便改变数据文件*.ini文件中的内容.");}
}
functiondriveactive(driveval)
{
try{
if(lastdrive==("drive"+driveval)&¤tdrive.match(/^[a-z]\:\\$/i))
{
document.getElementById("showorhide").focus();
returnfalse;
}
if(lastdrive=="")lastdrive="driveC";
document.getElementById(lastdrive).style.backgroundColor="#CCCCCC";
lastdrive="drive"+driveval;
document.getElementById(lastdrive).style.backgroundColor="#FFFFDD";
varatt="",drv,totalsize,freespace,usespace,outstr="",pathstr="",attribu=0,subfolfil="",fcount=0;
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=newEnumerator(ffolder);
outstr="<divclass='showcon'>文件夹:[<ahref=''onclick=\"returnunfurlorfold('folshow',this);\">隐藏</a>]<divid='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><ahref=''onClick=\"folderactive(ppath["+ppathcounter+"]);"
outstr+="returnfalse;\">"+getdata.item().Name+"</a></div>";
ppathcounter++;
}
}
subfolfil="找到"+fcount+"个文件夹,";
fcount=0;
ffile=fso.GetFolder(pathstr).Files;
getdata=newEnumerator(ffile);
outstr+="</div></div><divclass='showcon'>文  件:[<ahref=''onclick=\"returnunfurlorfold('filshow',this);\">隐藏</a>]<divid='filshow'>";
for(;!getdata.atEnd();getdata.moveNext())
{
attribu=getdata.item().Attributes;
if(hidestate||attribu==0||attribu==1||attribu==32||attribu==33)
{
fcount++;
outstr+="<div><ahref=\""+currentdrive+"\"target='_blank'>"+getdata.item().Name+"</a></div>";
}
}
outstr+="</div></div>";
subfolfil+=fcount+"个文件.";
document.getElementById("showcontent").innerHTML=outstr;
document.getElementById("currentdrive").innerText=currentdrive;
document.getElementById("showdriveatt").innerText=att;
att="文件夹名称:\n\n文件夹大小:\n创建时间:\n\n修改时间:\n\n访问时间:\n\n";
document.getElementById("showfolderatt").innerText=att;
document.getElementById("subfolfil").innerText=subfolfil;
att="[<ahref=\""+currentdrive+"\"target='_blank'>打开</a>]";
att+="[<ahref=''onclick=\"addfav();returnfalse;\">收藏</a>]";
document.getElementById("openfol").innerHTML=att;
document.getElementById("showorhide").focus();
getdata="";
}catch(errorinf){alert(errorinf.description+"\n\n请不要随便改变数据文件*.ini文件中的内容.");}
}
functionfolderactive(folderval)
{
try
{
varatt="",fol="",totalsize=0,sizesign="";
openfolder(folderval);
if(!folderval.match(/^[a-z]\:\\$/i))
{
fol=fso.GetFolder(folderval);
totalsize=fol.Size/Math.pow(2,30);
totalsize>1?sizesign="GB":(totalsize=totalsize*Math.pow(2,10),sizesign="MB");
(totalsize<1&&sizesign=="MB")?(totalsize=totalsize*Math.pow(2,10),sizesign="KB"):{}
totalsize=Math.round((totalsize)*100)/100+sizesign;
att+="文件夹名称:\n"+fol.Name+"\n文件夹大小:"+totalsize+"\n创建时间:\n";
att+=fol.DateCreated+"\n修改时间:\n"+fol.DateLastModified+"\n访问时间:\n"+fol.DateLastAccessed;
document.getElementById("showfolderatt").innerText=att+"\n";
}
}catch(errorinf){alert(errorinf.description+"\n\n请不要随便改变数据文件*.ini文件中的内容.");}
}
functionopenfolder(currfolder)
{
try
{
varsign=0,outstr="",attribu=0,subfolfil="",fcount=0;
if(currfolder==""){alert("没有选择文件夹.");returnfalse;}
currentdrive=currfolder;
ffolder=fso.GetFolder(currfolder).SubFolders;
getdata=newEnumerator(ffolder);
outstr="<divclass='showcon'>文件夹:[<ahref=''onclick=\"returnunfurlorfold('folshow',this);\">隐藏</a>]<divid='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]=currfolder.replace(/\\+$/i,"")+"\\"+getdata.item().name;
outstr+="<div><ahref=''onClick=\"folderactive(ppath["+ppathcounter+"]);"
outstr+="returnfalse;\">"+getdata.item().Name+"</a></div>";
ppathcounter++;
}
}
subfolfil="找到"+fcount+"个文件夹,";
fcount=0;
ffile=fso.GetFolder(currfolder).Files;
getdata=newEnumerator(ffile);
outstr+="</div></div></div><divclass='showcon'>文  件:[<ahref=''onclick=\"returnunfurlorfold('filshow',this);\">隐藏</a>]<divid='filshow'>";
for(;!getdata.atEnd();getdata.moveNext())
{
attribu=getdata.item().Attributes;
if(hidestate||attribu==0||attribu==1||attribu==32||attribu==33)
{
fcount++;
if(openfromfav==0)
outstr+="<div><ahref=\""+currentdrive+"\"target='_blank'>"+getdata.item().Name+"</a></div>";
else
outstr+="<div><ahref=\""+currentdrive+"\\"+getdata.item().Name+"\"target='_blank'>"+getdata.item().Name+"</a></div>";
}
}
outstr+="</div></div>";
subfolfil+=fcount+"个文件.";
document.getElementById("showcontent").innerHTML=outstr;
document.getElementById("currentdrive").innerText=currentdrive;
att="文件夹名称:\n\n文件夹大小:\n创建时间:\n\n修改时间:\n\n访问时间:";
document.getElementById("showfolderatt").innerText=att;
document.getElementById("subfolfil").innerText=subfolfil;
att="[<ahref=\""+currentdrive+"\"target='_blank'>打开</a>]";
att+="[<ahref=''onclick=\"addfav();returnfalse;\">收藏</a>]";
document.getElementById("openfol").innerHTML=att;
getdata="";
openfromfav=0;
}catch(errorinf){alert(errorinf.description+"\n\n请不要随便改变数据文件*.ini文件中的内容.");}
}
functionupfile()
{
varrootpath="";
rootpath=currentdrive;
if(!rootpath.match(/^[a-z]\:\\$/i))
{
rootpath=rootpath.replace(/\\[^\\]*$/,"");
if(rootpath.match(/^[a-z]\:$/i)){rootpath+="\\";}
folderactive(rootpath);
}
else
alert("驱动器根目录.");
}
functionflashdrive()
{
folderactive(currentdrive);
}
functionopenfav()
{
lastfav="";
varoutstr="",i=0;
for(i;i<favcounter;i++)
{
outstr+="<aid='fav"+i+"'href=''onclick=\"openfromfav=1;folderactive(favorite["+i+"]);"
outstr+="favactive(this.id);returnfalse;\"target='_blank'>"+favorite[i].replace(/^.+\\/,"")+"</a><br>";
}
document.getElementById("showfavorite").innerHTML=outstr;
document.getElementById("delfav").value="";
}
functionfavactive(favid)
{
vari=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();
}
functionaddfav()
{
try
{
if(currentdrive.match(/^[a-z]\:\\$/i))
{
alert("只能收藏文件夹.");
returnfalse;
}
vari=0;
for(i=0;i<favcounter;i++)
{
if(favorite[i]==currentdrive)
{
alert("常用文件夹中已经存在该文件夹.");
returnfalse;
}
}
if(fso.FileExists(favpath))
{
ffile=fso.OpenTextFile(favpath,8);
}
else
{
ffile=fso.CreateTextFile(favpath,true);
}
ffile.Write("|"+currentdrive);
ffile.Close();
favorite[favcounter]=currentdrive;
favcounter++;
openfav();
alert("添加成功.");
}catch(errorinf){alert(errorinf.description+"\n\n请不要随便删除数据文件*.ini文件.");}
}
functiondelfav()
{
try
{
vardelpath=document.getElementById("delfav").value;
vari=lastfav.match(/\d/),j=parseInt(i);
varnewfav="";
document.getElementById("showorhide").focus();
if(delpath=="")
{
alert("没有选择常用文件夹.");
returnfalse;
}
if(confirm("确定删除常用文件夹(并非从硬盘删除):\n"+delpath+"\n?"))
{
favcounter--;
for(j;j<favcounter;j++)
favorite[j]=favorite[j+1];
for(j=0;j<favcounter;j++)
newfav+=favorite[j]+"|";
ffile=fso.OpenTextFile(favpath,2);
newfav=newfav.replace(/^\||\|$/,"");
ffile.WriteLine(newfav);
ffile.Close();
openfav();
document.getElementById("delfav").value="";
alert("删除成功.");
}
}catch(errorinf){document.getElementById("delfav").value="";alert(errorinf.description+"\n\n请不要随便删除数据文件*.ini文件.");}
}
functionunfurlorfold(objid,obj)
{
if(obj.innerText=="隐藏")
{
obj.innerText="显示";
document.getElementById(objid).style.display="none";
}
else
{
obj.innerText="隐藏";
document.getElementById(objid).style.display="";
}
document.getElementById("showorhide").focus();
returnfalse;
}
</script>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<title>FileLookThroughAdminV1.0</title>
<styletype="text/css">
<!--
body{
background-color:#EEEEEE;}
div.main{
background-color:#CCCCCC;
width:100%;
padding:6px10px10px;}
h1{font-size:36px;
font-family:"华文彩云";
color:#0000FF;}
hr{
width:95%;
text-align:left;}
table.tableclass{
table-layout:fixed;
word-wrap:break-word;
width:100%;
font-size:12px;
background-color:#EEEEEE;}
table.tableclasstd{
background-color:#CCCCCC;}
#drive{}
td.drvinf{
vertical-align:top;
padding:5px;}
td.folderfile{
height:430px;
vertical-align:top;}
td.folderfilediv.showcon{
width:100%;}
td.folderfilediv.showcondivdiv{
padding:1px0px;
width:49%;
float:left;}
a:link{text-decoration:none;
color:#0000FF;}
a:active{text-decoration:none;
color:#0000FF;}
a:visited{text-decoration:none;
color:#0000FF;}
a:hover{
text-decoration:underline;
color:#FF0000;
background-color:#FFFFDD;}
.button{
border:none;
height:20px;
width:50px;
background-color:#CCCCCC;}
td.fav{
vertical-align:top;
padding:5px;}
-->
</style>
</head>
<bodyonLoad="javascript:initdoc();status='FileLookThroughAdminV1.0';">
<divclass="main">
<h1>FileLookThroughAdmin</h1>
<divstyle="margin-top:-36px;"><hr></div>
<divstyle="margin-top:-14px;position:relative;left:5%;"><hr></div>
<div>
<tableclass="tableclass">
<tralign="center">
<tdwidth="18%">收藏夹</td>
<tdwidth="60%">文件夹及文件</td>
<td>相关信息</td>
</tr>
<tr>
<tdalign="center">
HardDrives>>
</td>
<tdcolspan="2">
<divid="drives"></div>
</td>
</tr>
<tr>
<tdalign="center">
Tag>>
</td>
<tdalign="center"colspan="2">
DisplayContent
</td>
</tr>
<tr>
<tdalign="center">
CurrentPath>>
</td>
<tdcolspan="2">
<divid="currentdrive"></div>
</td>
</tr>
<tr>
<tdclass="fav">
<div>常用文件夹:</div>
<divid="showfavorite"></div>
</td>
<tdrowspan="2"class="folderfile">
<divonclick="upfile();"style="height:15px;cursor:pointer;padding-top:5px;"align="center"
onmouseover="this.style.backgroundColor='#FFFFDD';"
onmouseout="this.style.backgroundColor='#CCCCCC';">
上一级目录</div>
<divid="showcontent"style="padding-left:5px;"></div>
</td>
<tdrowspan="2"class="drvinf">
<fontcolor="#FF0000">当前驱动器信息:</font>
<divid="showdriveatt"></div>
<fontcolor="#FF0000">当前文件夹信息:</font>
<spanid="openfol"></span>
<divid="showfolderatt"></div>
<divid="subfolfil"style="color:#FF0000;"></div>
</td>
</tr>
<tr>
<tdclass="fav">
<div>删除常用文件夹:</div><br>
<divalign="center">
P:<inputid="delfav"type="text"style="border:none;"readonly><br><br>
[<ahref=""onClick="delfav();returnfalse;">执行删除</a>]
</div>
</td>
</tr>
</table>
</div>
</div>
<div>
<fontstyle="font-size:12px;cursor:default;"color="#666666"onmouseover="this.color='#FF0000'"onmouseout="this.color='#666666'">
Design:sgw.LKing(∮LKing♂)[FS:Ecjtu2006|QQ:28857496|E-Mail:sgw.lking@gmail.com][@06.11]
</font>
</div>
</body>
</html>
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
本文实例主要实现了网页照相机程序的功能。C#实现将网页保存成图片格式,简单实现网页拍照,主要是基于ActiveX组件的网页快照类,AcitveX必须实现IVie
看到好的网页总会保存下一来,而且会使用mht格式保存网页,但用此法保存的网页,用浏览器打开有时会显示出错,例如内容变成了英文和数字,该怎么解决这个问题呢?下面我
可以将多个网页保存在一个文件中;可以将网页保存成MHT、WORD格式;可以解决不能“拷贝”的网页的内容获取;可以一次性保存网页中的所有图
Chrome是一款非常受欢迎的浏览器,在使用浏览器的时候经常需要将整个网页进行截图,360浏览器可以直接将网页保存网页保存为图片,但是对于Chrome浏览器来说
网站是网页的存储位置,用于维护网页的正常运行,使网民能够正常浏览和操作网页内容。用户通过浏览器访问网站。网站将用户请求的页面解析成浏览器可以理解的格式后,通过H