⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lbbs_pic v1.02.asp

📁 乐学LBBS无限级目录图片直读系统 v1.09 build 20080719 很好用的大家试试看
💻 ASP
📖 第 1 页 / 共 4 页
字号:
		exit for
	elseif c>Int(c_MaxPerPage)*(CurrentPage-1) then
	strFileType=lcase(mid(theFile.Name,instrrev(theFile.Name,".")+1))
	If instr(LCase(c_PicType),strFileType)>0 Then
%>
    <td>
      <table width="100%" height="100%" border="0" cellpadding="0">
        <tr>
          <td align="center" width="<%=c_picwidth%>" height="<%=c_picheight+10%>" class="style1">
            <%
			  	response.write "<a href='" & UploadDir & theFile.Name & "' target='_blank'><img src='" & UploadDir & theFile.Name & "' alt='[文件]"&theFile.Name&Chr(10)&"[大小]"&round(theFile.size/1024)&"K "&Chr(10)&"[类型]"&theFile.type&"' border='0'  onmouseover=""this.style.cursor='hand';""    onload='javascript:DrawImage(this);'  width="&c_picwidth&" height="&c_picheight&"></a>"
		  %>
          </td>
        </tr>
<%If Session("lbbs_pic_UserName")=c_admin_name And Session("lbbs_pic_password")=c_admin_password Then
%>
        <tr>
          <td><input name="FileName" type="checkbox" id="FileName" value="<%=theFile.Name%>" onclick="unselectall()">选中  <a href="<%=JoinChar(c_strFileName)%>Action=Del&FileName=<%=theFile.Name%>" onclick="return confirm('你真的要删除吗!')">单个删除</a></td>
        </tr>
<%End if%>
      </table>
    </td>
<%
Else
FileCount=FileCount-1
End if
		FileCount=FileCount+1
		if FileCount mod c_Page=0 then response.write "</td><tr class='tdbg'>"
		TotalSize_Page=TotalSize_Page+theFile.Size
	end If
Next
%>
  </tr>
</table>
<%If Session("lbbs_pic_UserName")=c_admin_name And Session("lbbs_pic_password")=c_admin_password Then
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="200" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
      选中本页显示的所有文件</td>
    <td><input name="Action" type="hidden" id="Action" value="Del">
      <input name="UploadDir" type="hidden" id="UploadDir" value="<%=left(UploadDir,len(UploadDir)-1)%>">
              <input type="submit" name="Submit" value="删除选中的文件">
              <!--<input type="submit" name="Submit2" value="删除当前目录所有文件" onClick="document.myform.Action.value='DelAll';">-->
              </td>
  </tr>
</table>
<%end if%>
</td></tr></table>
<%
end sub
'------------------------------------------------

'-----------------------------------------
'管理员登录
Sub adminlogin()
%>
<form method="POST" action="?action=logincheck" name="F1">
	<table border="0" width="100%" class="border">
		<tr>
			<td width="220" align="right"> </td>
			<td><span lang="zh-cn"><b>管理登录</b></span> <A  class='style4' HREF="<%=strFileName%>">[回首页]</A></td>
		</tr>
		<tr>
			<td width="220" align="right"> </td>
			<td> </td>
		</tr>
		<tr>
			<td width="220" align="right"><span lang="zh-cn">用户名:</span></td>
			<td height="21"><input type="text" name="username" size="20" value=""></td>
		</tr>
		<tr>
			<td width="220" align="right">密  码:</td>
			<td><input type="password" name="password" size="20"></td>
		</tr>
		<tr>
			<td width="220" align="right"> </td>
			<td><input type="submit" value="提交" name="B1">&nbsp; <input type="reset" value="重置" name="B2"></td>
		</tr>
	</table>
</form>
<%
End Sub
'----------------------------------------
 
'----------------------------------------
'登录
sub logincheck()
If trim(Request.form("username"))<>c_admin_name Then
	Response.write "<script language='javascript'>alert('管理用户名不正确!');history.go(-1);</script>"
    response.End
Exit Sub    
End If
If md5(trim(Request.form("password")))<>c_admin_password Then
	Response.write "<script language='javascript'>alert('密码不正确!');history.go(-1);</script>"
    response.End
Exit Sub    
End If
Session("lbbs_pic_UserName")=trim(Request("username"))
Session("lbbs_pic_password")=md5(trim(Request("password")))
response.redirect ("?action=admin")
response.end
End sub
'----------------------------------------

'----------------------------------------
'退出登录
sub adminlogout()
Session("lbbs_pic_UserName")=""
Session("lbbs_pic_password")=""
response.redirect (strFileName)
response.end
End sub
'----------------------------------------

'----------------------------------------
'登录检测
Sub admincheck()
If Session("lbbs_pic_UserName")<>c_admin_name or Session("lbbs_pic_password")<>c_admin_password Then
	Response.write "<script language='javascript'>location.href='?action=login';</script>"
    response.End
    Exit Sub 
End If
End Sub
'---------------------------------------

'---------------------------------------
'删除单个文件或选中文件
sub DelFiles()
 Call admincheck() '登录检测
	dim whichfile,arrFileName,i,UploadDir2
	whichfile=trim(Request("FileName"))
	if whichfile="" then exit sub
	if instr(whichfile,",")>0 then
		arrFileName=split(whichfile,",")
		for iij=0 to ubound(arrFileName)
			if left(trim(arrFileName(iij)),3)<>"../" and left(trim(arrFileName(iij)),1)<>"/" then
				whichfile=server.MapPath(UploadDir  & trim(arrFileName(iij)))
				set thisfile=fso.GetFile(whichfile)
				thisfile.Delete True
			end if
		next
	else
		if left(whichfile,3)<>"../" and left(whichfile,1)<>"/" then
			Set thisfile = fso.GetFile(server.MapPath(UploadDir & whichfile))
			thisfile.Delete True
		end if
	end if
	Response.Write("<script>alert(""所选文件删除成功"");location.href='"&c_strFileName&"';</script>")
end sub

'删除所有文件
sub DelAll()

 Call admincheck() '登录检测
	Set theFolder=fso.GetFolder(TruePath)
	For Each theFile In theFolder.Files
		theFile.Delete True
	next
	Response.Write("<script>alert(""本目录所有文件删除成功"");location.href='"&c_strFileName&"';</script>")
end Sub
'---------------------------------------

'---------------------------------------
'管理设置
Sub admin()
 Call admincheck() '登录检测
%>
<form method="POST" action="?action=adminsave" name="F" onSubmit="return check()">
	<table border="0" width="100%" class="border">
		<tr>
			<td width="220" align="right"> </td>
			<td><span lang="zh-cn"><b>参数设置</b></span> <A  class='style4' HREF="<%=strFileName%>">[回首页]</A> </td>
		</tr>
		<tr>
			<td width="220" align="right"> </td>
			<td> </td>
		</tr>
		<tr>
			<td width="220" align="right"><span lang="zh-cn">登录用户名 :</span></td>
			<td height="21"><input type="text" name="username" size="20" value="<%=c_admin_name%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">登录密码  :</td>
			<td><input type="password" name="password" size="20"> 留空表示不作修改。</td>
		</tr>
		<tr>
			<td width="220" align="right">再次确认密码:</td>
			<td><input type="password" name="password_again" size="20"></td>
		</tr>
		<tr>
			<td width="220" align="right">网站首页链接名称:</td>
			<td><input type="text" name="HomeName" size="30" value="<%=c_HomeName%>">(空值则不显示)</td>
		</tr>
		<tr>
			<td width="220" align="right">网站首页链接地址:</td>
			<td><input type="text" name="HomeUrl" size="30" value="<%=c_HomeUrl%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">标题名:</td>
			<td><input type="text" name="title" size="30" value="<%=c_title%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">图片所在文件夹:</td>
			<td><input type="text" name="UploadDirg" size="30" value="<%=c_UploadDirg%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">图片类型  :</td>
			<td><input type="text" name="PicType" size="30" value="<%=c_PicType%>">(使用|将图片格式分开)</td>
		</tr>
		<tr>
			<td width="220" align="right">左则当前目录下文件:</td>
			<td><INPUT TYPE="radio" value="是" NAME="filelb" <%If c_filelb="YES" Then response.write"checked"%>>显示 <INPUT TYPE="radio" value="否" NAME="filelb" <%If c_filelb<>"YES" Then response.write"checked"%>>不显示 </td>
		</tr>
		<tr>
			<td width="220" align="right">定义功能:</td>
			<td><INPUT TYPE="radio" value="是" NAME="cook" <%If c_cook="YES" Then response.write"checked"%>>显示 <INPUT TYPE="radio" value="否" NAME="cook" <%If c_cook<>"YES" Then response.write"checked"%>>不显示</td>
		</tr>
		<tr>
			<td width="220" align="right">每页显示图片数:</td>
			<td><input type="text" name="MaxPerPage" size="5" value="<%=con_MaxPerPage%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">每行显示图片数:</td>
			<td><input type="text" name="Page" size="5" value="<%=con_Page%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">图片缩图宽度:</td>
			<td><input type="text" name="picwidth" size="5" value="<%=con_picwidth%>"></td>
		</tr>
		<tr>
			<td width="220" align="right">图片缩图高度:</td>
			<td><input type="text" name="picheight" size="5" value="<%=con_picheight%>"></td>
		</tr>
		<tr>
			<td width="220" align="right"></td>
			<td> </td>
		</tr>
		<tr>
			<td width="220" align="right"> </td>
			<td><input type="submit" value="提交" name="B1">&nbsp; <input type="reset" value="重置" name="B2"></td>
		</tr>
	</table>
</form>
<script>
function check()
{
	if (document.F.password.value!="" @@ document.F.password.value!=document.F.password_again.value) {
	  alert("两次输入的密码不相同。请重设。");
	  return false;
  }
  return true;
}
</script>

<%
End Sub
'-----------------------------------------
'保存参数设置
Sub adminsave()
  Call admincheck() '登录检测
  	dim fso,hf,hf2
	Dim n_adminname,n_adminpassword,n_HomeName,n_HomeUrl,n_title,n_UploadDirg,n_PicType,n_filelb,n_cook
    Dim n_MaxPerPage,n_Page,n_picwidth,n_picheight
	If trim(Request.form("username"))<>"" then
       n_admin_name = chr(34) & trim(Request.form("username"))& chr(34)
	   Session("lbbs_pic_UserName")=trim(Request.form("username"))
	Else
       n_admin_name = chr(34) &c_admin_name &chr(34)
	End If
	If trim(Request.form("password"))<>"" then
        n_admin_password = chr(34) & md5(trim(Request.form("password")))& chr(34)
		Session("lbbs_pic_password")=md5(trim(Request.form("password")))
 	Else
        n_admin_password =  chr(34) &c_admin_password &chr(34)
	End If	
    n_HomeName = chr(34) & trim(Request("HomeName"))& chr(34)
    n_HomeUrl = chr(34) & trim(Request("HomeUrl"))& chr(34)
    n_title = chr(34) & trim(Request("title"))& chr(34)
    n_UploadDirg = chr(34) & trim(Request("UploadDirg"))& chr(34)
    n_PicType = chr(34) & trim(Request("PicType"))& chr(34)
    n_filelb = chr(34) & trim(Request("filelb"))& chr(34)
    n_cook = chr(34) & trim(Request("cook"))& chr(34)
	c_filelb = Replace(c_filelb,"YES","是")
	c_cook = Replace(c_cook,"YES","是")

    n_MaxPerPage =  trim(Request("MaxPerPage"))
    n_Page = trim(Request("Page"))
    n_picwidth = trim(Request("picwidth"))
    n_picheight = trim(Request("picheight"))

	set fso=Server.CreateObject("Scripting.FileSystemObject")
	set hf2=fso.OpenTextFile(Server.mappath(strFileName),1)
	if Not hf2.atendofstream Then
       all  = hf2.readALL
	   all=Replace(all,"c_admin_name="&chr(34) & c_admin_name & chr(34) &"","c_admin_name="& n_admin_name & "")
	   all=Replace(all,"c_admin_password="& chr(34) &c_admin_password & chr(34) &"","c_admin_password="& n_admin_password & "")
	   all=Replace(all,"c_HomeName="& chr(34) &c_HomeName & chr(34) &"","c_HomeName="& n_HomeName & "")
	   all=Replace(all,"c_HomeUrl="&chr(34) & c_HomeUrl &chr(34) & "","c_HomeUrl="& n_HomeUrl & "")
	   all=Replace(all,"c_title="&chr(34) & c_title &chr(34) & "","c_title="& n_title & "")
	   all=Replace(all,"c_UploadDirg="&chr(34) & c_UploadDirg &chr(34) & "","c_UploadDirg="& n_UploadDirg & "")
	   all=Replace(all,"c_PicType="&chr(34) & c_PicType &chr(34) & "","c_PicType="& n_PicType & "")
	   all=Replace(all,"c_cook="&chr(34) & c_cook &chr(34) & "","c_cook="& n_cook & "")
	   all=Replace(all,"c_filelb="&chr(34) & c_filelb &chr(34) & "","c_filelb="& n_filelb & "")

	   all=Replace(all,"con_MaxPerPage="& con_MaxPerPage & "","con_MaxPerPage="& n_MaxPerPage & "")
	   all=Replace(all,"con_Page="& con_Page & "","con_Page="& n_Page & "")
	   all=Replace(all,"con_picwidth="& con_picwidth & "","con_picwidth="& n_picwidth & "")
	   all=Replace(all,"con_picheight="& con_picheight & "","con_picheight="& n_picheight & "")
    set hf=fso.CreateTextFile(Server.mappath(strFileName),true)
	hf.write all
	hf.close
	End If
	hf2.close
	set hf=Nothing
    set hf2=Nothing
	set fso=Nothing
	Response.write "<script language='javascript'>alert('设置成功!');location.href='?action=admin';</script>"
    response.end
End Sub

'------------------------------------------------
'系统版本信息
response.write "<CENTER>"
response.write "| <A HREF='"&strFileName&"'>回首页 </A> | "
response.write "<A HREF='?action=admin' class='style4'>设置管理</A> | "
If Session("lbbs_pic_UserName")=c_admin_name And Session("lbbs_pic_password")=c_admin_password Then
   response.write "<A HREF='?action=logout' class='style4'>退出</A>  | "
End if 

response.write "&nbsp;&nbsp;Powered by <a  title='乐学LBBS无限级目录图片直读系统 "&c_poweredby&chr(10)&"http://www.learn365.cn/' target='_blank' href='http://www.learn365.cn/'><strong>LBBS_pic</strong> "&c_poweredby&"</a>&nbsp;&nbsp;"

dim endtime:endtime=timer()
if isempty(starttime) then
    response.write "没有程序被执行"
else
    if cstr(FormatNumber((endtime-starttime)*1000,3))=".000" then 
        response.write "没有程序被执行"
    else
        response.write FormatNumber((endtime-starttime)*1000,3)&"毫秒"
    end if
end if 

response.write"</CENTER>"
%>
</body> 
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -