|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
Windows本身的所有问题都会一成不变的也累加到了它的身上。安全性、稳定性、跨平台性都会因为与NT的捆绑而显现出来;写了一个三层静态读取文件夹的下拉菜单的例子,供人人参考!
<%
失掉文件夹路径。注重设置文件名字
urlpath=server.mappath("ook")
setfsoBrowse=CreateObject("Scripting.FileSystemObject")
设置文件夹路径
ifRequest("path")=""then
lpath=urlpath&""
else
lpath=Request("path")&""
endif
%>
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<metahttp-equiv=PRAGMACONTENT=NO-CACHE>
<title>中国国际航空公司</title>
<linkrel="stylesheet"href="news.CSS">
<scriptlanguage="JavaScript1.2">
NS4=(document.layers)?1:0;
IE4=(document.all)?1:0;
ver4=(NS4||IE4)?1:0;
if(ver4){
with(document){
write("<STYLETYPE=text/css>");
if(NS4){
write(".parent{position:absolute;visibility:visible}");
write(".child{position:absolute;visibility:visible}");
write(".regular{position:absolute;visibility:visible}")
}
else{
write(".child{display:none}")
}
write("</STYLE>");
}
}
functiongetIndex(el){
ind=null;
for(i=0;i<document.layers.length;i++){
whichEl=document.layers[i];
if(whichEl.id==el){
ind=i;
break;
}
}
returnind;
}
functionarrange(){
nextY=document.layers[firstInd].pageY+document.layers[firstInd].document.height;
for(i=firstInd+1;i<document.layers.length;i++){
whichEl=document.layers[i];
if(whichEl.visibility!="hide"){
whichEl.pageY=nextY;
nextY+=whichEl.document.height;
}
}
}
functioninitIt(){
if(!ver4)return;
if(NS4){
for(i=0;i<document.layers.length;i++){
whichEl=document.layers[i];
if(whichEl.id.indexOf("Child")!=-1)whichEl.visibility="hide";
}
arrange();
}
else{
divColl=document.all.tags("DIV");
for(i=0;i<divColl.length;i++){
whichEl=divColl(i);
if(whichEl.className=="child")whichEl.style.display="none";
}
}
}
functionexpandIt(el){
if(!ver4)return;
if(IE4){
whichEl=eval(el+"Child");
if(whichEl.style.display=="none"){
whichEl.style.display="block";
}
else{
whichEl.style.display="none";
}
}
else{
whichEl=eval("document."+el+"Child");
if(whichEl.visibility=="hide"){
whichEl.visibility="show";
}
else{
whichEl.visibility="hide";
}
arrange();
}
}
onload=initIt;
</script>
</head>
<bodybgcolor="#ffffff"topmargin="0"leftmargin="0">
<tablewidth="248"border="0"cellspacing="0"cellpadding="0"align="left">
<tr>
<td>
<%
处置第一层文件目次
dimtheFolder,theSubFolders
iffsoBrowse.FolderExists(lpath)then
SettheFolder=fsoBrowse.GetFolder(lpath)
SettheSubFolders=theFolder.SubFolders
轮回输入第一层文件
i=1
ForEachxIntheSubFolders
k="KB"&i
Parent=k&"Parent"
i=i+1
%>
<divid="<%=Parent%>"class="parent"><ahref="#"><ahref="#"><%=y.Name%></a><br>
<%
处置第三层文件
twopath=onepath&y.Name&""
iffsoBrowse.FolderExists(twopath)then
SetgtheFolder=fsoBrowse.GetFolder(twopath)
SetgtheSubFolders=gtheFolder.SubFolders
Child=k&"Child"
%>
<divid="<%=Child%>"class="child">
<%
轮回输入第三层文件
ForEachzIngtheSubFolders
%>
<imgsrc="http://edu.cnzz.cn/NewsInfo/filebox.gif"width="19"height="13"><%=z.Name%><br>
<%
Next
%>
</div>
<%
endif
%>
<%
Next
%>
</div>
<%
endif
%>
<%
Next
endif
%>
</td>
</tr>
</table>
</body>
</html>
ASP脚本是采用明文(plaintext)方式来编写的。 |
|