📄 explore2006.asp
字号:
<% @ language="vbscript" %>
<%
'on error resume next
'server.scripttimeout = 9999
response.expires=0
response.buffer=true
folder = request("folder")
if right(folder,1)="\" and left(right(folder,2),1)<>":" then folder = left(folder,len(folder)-1)
mypage = request.servervariables("script_name")
dim fso,ob_stream
set fso = server.CreateObject("scripting.filesystemobject")
set ob_stream = server.CreateObject ("adodb.stream")
set hm = new functionAll
set mm = new menu
act = request("act")
if act = "open" or act = "edit" then
call showfile()
elseif act = "menu" then
call showmenu()
elseif act = "system" then
call showsystem()
elseif act="task" then
call showtask()
end if
if folder="" then
Set fo = fso.GetFolder(Server.MapPath("/"))
'folder = server.MapPath("/")
else
set fo = fso.getfolder(folder)
end if
class functionAll
public WebName,WebUrl,SysName,SysVersion
private sub Class_Initialize ''''' 类的初始化
WebName="LONGERFACE.COM"
WebUrl="http://www.longerface.com/"
SysName="WanExplorer"
SysVersion="V1.02"
end sub
function superfolder(folder) ''''' 求出上级目录地址,如根目录为空
if left(right(folder,2),1)<>":" then
superfolder = left(folder,instrrev(folder,"\"))
else
superfolder = ""
end if
end function
public function javapath(tempath) '''''' 在script里将“\” 变成“\\”
tempath = trim(tempath)
javapath = replace(tempath,"\","\\")
end function
function backpath(tempath) '''''' 在script里将“\\” 变成“\”
tempath = trim(tempath)
backpath = replace(tempath,"\\","\")
end function
public function CopyRight '''' 版权函数
response.write "<div align=""center"" style=""cursor:default;"" onclick=""window.open('"&WebUrl&"','_blank');"" title="""&SysName&" "&SysVersion&" Copyright (C) "&WebName&" All rights reserved.""><font style=""font-size:8pt;color:#666666;font-family:arial;"">CopyRight © <b><font color=336699>"&name8(WebName)&"</font><font color=993300>."&name3(WebName)&"</font></b> <!--All rights reserved.--></font></div>"
end function
function location(nowFolder) ''' 网络路径
location = "\\"&request.ServerVariables("LOCAL_ADDR")
if not isempty(Request.ServerVariables("SERVER_PORT")) and Request.ServerVariables("SERVER_PORT")<>80 then location = location + ":"&Request.ServerVariables("SERVER_PORT")
location = location + "\"&nowfolder
end function
function nameAll(namestr)''''' 函数,取文件全名
if instr(namestr,"\")=0 then
nameAll = namestr
else
nameAll = right(namestr,instr(strreverse(namestr),"\")-1)
end if
end function
function name8(namein)'''''''' 函数,取文件主名
if instr(nameAll(namein),".")=0 then
name8 = mid(nameAll(namein),1,len(nameAll(namein)))
else
name8 = left(nameAll(namein),instr(nameAll(namein),".")-1)
end if
end function
function name3(namein)'''''''' 函数,取文件扩展名
if instr(nameAll(namein),".")=0 then
name3=""
else
name3 = right(nameAll(namein),instr(strreverse(nameAll(namein)),".")-1)
end if
end function
function fileimage(namein)''''' 函数,取得文件类型图片
ext = lcase(name3(namein))
fileimage = "<font style='font-size:30pt;font-family:Wingdings 2;'>/</font>"
if ext="txt" or ext = "log" then fileimage = "<font style='font-size:30pt;font-family:Wingdings;'>3</font>"
if ext="htm" or ext="html" then fileimage = "<font style='font-size:30pt;font-family:Wingdings;'>]</font>"
if ext="asp" or ext="php" or ext="jsp" or ext="java" or ext="vbs" then fileimage = "<font style='font-size:30pt;font-family:Wingdings;'>2</font>"
if ext="mdb" or ext="dbf" or ext="mdf" then fileimage = "<font style='font-size:25pt;font-family:Wingdings;'>4</font>"
if ext="exe" or ext="com" then fileimage = "<font style='font-size:25pt;font-family:Wingdings 2;'>4</font>"
if ext="mp3" or ext="wma" or ext="wav" then fileimage = "<font style='font-size:25pt;font-family:Webdings;'>"&chr(14)&"</font>"
if ext="doc" then fileimage = "<font style='font-size:30pt;font-family:Wingdings 2;'>2</font>"
if ext="ini" then fileimage = "<font style='font-size:27pt;font-family:Wingdings;'>></font>"
if ext="dll" then fileimage = "<font style='font-size:25pt;font-family:Webdings;'>"&chr(96)&"</font>"
if ext="url" then fileimage = "<font style='font-size:25pt;font-family:Webdings;'>'</font>"
if ext="msi" then fileimage = "<font style='font-size:25pt;font-family:webdings;'>e</font>"
if ext="chm" or ext="hlp" then fileimage = "<font style='font-size:20pt;font-family:Webdings;'>s</font>"
if ext="jpg" or ext="gif" or ext="jpge" or ext="bmp" then fileimage = "<font style='font-size:25pt;font-family:webdings;'>N</font>"
end function
function folderimage(namein)''''' 函数,取得文件夹图片
folderimage = "<font style='font-size:25pt;font-family:Wingdings;'>0</font>"
if lcase(nameAll(namein))="recycled" or lcase(nameAll(namein))="recycler" then folderimage = "<font style='font-size:30pt;font-family:Wingdings 2;'>3</font>"
end function
function diskimage(num)'''''' 函数,取得了盘符图片
select case cint(num)
Case 1 : diskimage = "<font style='font-size:20pt;font-family:Wingdings;'><</font>" '1可移动磁盘
Case 2 : diskimage = "<font style='font-size:33pt;font-family:Wingdings;'>;</font>" '2本地硬盘
Case 3 : diskimage = "<font style='font-size:25pt;font-family:Wingdings 2;'>9</font>" '3网络磁盘
Case 4 : diskimage = "<font style='font-size:25pt;font-family:Wingdings 2;'>8</font>" '4CD-ROM
Case 5 : diskimage = "<font style='font-size:25pt;font-family:Wingdings;'>"&chr(128)&"</font>" '5RAM 磁盘
Case else : diskimage = "<font style='font-size:25pt;font-family:webdings;'>i</font>" '0未知
end Select
end function
public sub savefile(txtpath,txtname,inputtxt,intype) ''''''''''''''' 写入文件过程 ''''''''''''
if trim(txtname) = empty then txtname = "新建 文本文档.txt"
if inputtxt = empty then inputtxt = ""
if right(txtpath,1)<>"\" then txtpath = txtpath & "\"
filepath = txtpath & txtname
if cint(intype)<>8 and cint(intype)<>2 then intype = 2
if not fso.fileexists(filepath) then
set txt = fso.opentextfile(filepath,8,true)
txt.writeline inputtxt
exit sub
end if
set txt = fso.opentextfile(filepath,cint(intype))'改为8是追加2是覆盖
txt.writeline inputtxt
end sub
function diskpath(newfolder) '''''''''''''''''' 取盘符
diskpath = left(trim(newfolder),2)
end function
end class
class menu
public function isdisk(folder) '''''''''''''''''' 是否是根盘符
if len(trim(folder))>3 then
isdisk=false
else
isdisk=true
end if
end function
public function righthere(hereType,herePath,hereName) ''''''''' 查看文件夹或文件是否存在
if right(herePath,1)<>"\" then herePath = herePath & "\"
mypath = herePath & hereName
if hereType = "file" then
if fso.fileExists(mypath) then
righthere = true
else
righthere = false
end if
elseif hereType = "folder" then
if fso.folderexists(mypath) then
righthere = true
else
righthere = false
end if
else
righthere = false
end if
end function
function filename(tempname) ''''''''''''''''''' 显示文件类型名
tempname = ucase(tempname)
filename = tempname
if tempname = "EXE" then filename = "应用程序"
if tempname = "BAT" then filename = "Windows 批处理"
if tempname = "TXT" then filename = "文本"
if tempname = "HTML" or tempname = "HTM" then filename = "HTML Document"
if tempname = "DOC" then filename = "Microsoft Word 文档"
if tempname = "JPG" or tempname = "GIF" or tempname = "PNG" or tempname = "JPGE" or tempname = "BMP" then filename = tempname & "图像"
if tempname = "MP3" or tempname = "WMA" then filename = tempname & "音频"
if tempname = "INI" then filename = "配置设置"
if tempname = "AVI" or tempname = "RMVB" or tempname = "MPEG" then filename = tempname & "视频"
if tempname = "DLL" then filename = "应用程序扩展"
if tempname = "MSC" then filename = "Microsoft 通用管理文档"
if tempname = "INF" then filename = "安装信息"
if tempname = "MSI" then filename = "Windows Installer 软件包"
filename = filename & "文件"
end function
function formatsize(mysize) '''''''''''''''''''' 计算出文件大小
if mysize>=(1024*1024*1024) then
formatsize=formatnumber(mysize/(1024*1024*1024),2) & " GB"
elseif mysize>=(1024*1024) then
formatsize=formatnumber(mysize/(1024*1024),2) & " MB"
elseif mysize>=1024 then
formatsize=formatnumber(mysize/1024,2) & " KB"
else
formatsize=mysize & "B"
end if
end Function
public function specialCharacter(tempChar) ''''''''''''''' 检查特殊字符 /\:*?"<>| chr(34)是"
if instr(tempChar,"/")<>0 or _
instr(tempChar,"\")<>0 or _
instr(tempChar,":")<>0 or _
instr(tempChar,"*")<>0 or _
instr(tempChar,"?")<>0 or _
instr(tempChar,chr(34))<>0 or _
instr(tempChar,"<")<>0 or _
instr(tempChar,">")<>0 or _
instr(tempChar,"|")<>0 or _
len(tempChar)<1 _
then
response.write "<font size=2>命名时不能使用特殊字符:<br>"&vbcrlf&"<font color=red>/ \ : * ? "&chr(34)&" < > | </font>"&vbcrlf&"<br>请改用其它名称。</font>"
response.write "<br><br>"&vbcrlf&"<input type=button value=后退 onclick='javascript:history.back();'>"
response.end
end if
end function
function dtype(num) '''''''''''''''''''''''''' 磁盘类型
select Case num
Case 0: dtype = "未知"
Case 1: dtype = "可移动磁盘"
Case 2: dtype = "本地硬盘"
Case 3: dtype = "网络磁盘"
Case 4: dtype = "CD 驱动器"
Case 5: dtype = "RAM 磁盘"
end Select
end Function
end class
%>
<%
''''' ---------------------------------- 图层显示图标 ---------------------------------
sub showImage(imgId,imgTop,imgLeft,imgName,imgImage,imgLink,imgType,imgDoubleClick)
%>
<div id="image<%=imgId%>" style="position:absolute; width:80px; height:80px; z-index:1; left: <%=imgLeft%>px; top: <%=imgTop%>px;"
onmousedown="imageNum=<%=imgId%>;down=true;divleft=event.clientX-parseInt(image<%=imgId%>.style.left);divtop=event.clientY-parseInt(image<%=imgId%>.style.top)"onmouseup="down=false">
<table width="80" height="60" border="0" cellpadding="0" cellspacing="2" style="word-wrap:break-word;word-break:break-all;table-layout:fixed;cursor:default;">
<tr>
<td height="40">
<div align="center"
<%if not(imgDoubleClick="") then response.write "onDblClick=""doubleClick('"&imgDoubleClick&"','"&hm.javapath(imgLink)&"');"""%>
onclick="oneClick('<%=imgType%>','<%=imgname%>','<%=hm.javapath(folder&"\"&imgname)%>','<%=hm.javapath(folder&"\"&imgname)%>');">
<font style="color:#333333;"><%=imgImage%></font></div></td>
</tr>
<tr>
<td><div align="center"><a href="<%if imgType="file" then : response.write "javascript:doubleClick('"&imgDoubleClick&"','"&hm.javapath(imgLink)&"');" :else:response.write imgLink:end if%>"><font style="font-size:9pt;color:#333333;"><%=imgName%></font></a></div></td>
</tr>
</table>
</div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -