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

📄 editor.asp

📁 使用Asp+Access+FSO+Jmail+Servu开发
💻 ASP
字号:
<!--#include file="chkuser.asp"-->
<!--#include file="config.asp"-->
<!--#include file="inc/user.asp"-->
<%
if rshost("html") then
response.redirect("error.asp?error=html")
response.end
end if
dim filehtml, files , filetext
username=Request.Cookies("username")
files=request("file")
' 如果文件名是空的
if not fso.FileExists(userdir&files) then
response.write "<script>alert('对不起,找不到该文件!');location.href='javascript:history.back()'</script>"
response.end
end if
Set fs = fso.GetFile(userdir&files)
if fs.size>204800 then
response.write "<script>alert('对不起,最大允许编辑尺寸为200KB!');location.href='javascript:self.close()'</script>"
response.end
end if
if files="" then 
response.write "<script>alert('对不起,文件名不能为空!');location.href='javascript:self.close()'</script>"
response.end
end if
If files = "" or Instr(files,"..")>0 then
response.redirect("error.asp?error=baderror")
Response.end
End if
checkpath="/"&Request.Cookies("username")
if lcase(checkpath)<>lcase(left(files,len("/"&Request.Cookies("username")))) then
response.redirect("error.asp?error=baderror")
response.end
end if
	dim fso, f
	set f = fso.opentextfile(userdir&files, 1)
	filetext = f.readall
	f.close
	set fso = nothing
	set f = nothing

%>
<html>
<head>
<title><%=site%>——文件编辑——<%=request("file")%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#d6d3cc" leftmargin="0" topmargin="0" onkeydown=return(!(event.keyCode==78&&event.ctrlKey))>
<table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><table width="580"  border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
          <form name="form2" method="post" action="editor.asp"><td height="30">文件位置:
            <input name="file" type="text" class="input" id="file" style="width:300" value="<%=files%>" size="1" maxlength="50">
            <input name="Button" type="submit" class="button" value="读文件">
            <input name="Submit" type="button" class="button" value="源码编辑" onClick="location.href='file_edit.asp?file=<%=files%>'"></td></form> 
      </tr>
      <tr>
        <td align="center"><form name="form1" method="post" action="file_save.asp">
              <iframe ID="eWebEditor1" src="editor/eWebEditor.asp?id=html&style=standard" frameborder="0" scrolling="no" width="100%" HEIGHT="350"></iframe><br>
            <input name="html" type="hidden" id="content" value="<%=Server.HTMLEncode(filetext)%>"><input type="hidden" name="file" value="<%=files%>">
            <br>
              <input name=Submit1 type=submit class="button" id=Submit1 value="保存">
              <input type="reset" name="submit2" class="button" value="还原">
        </form></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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