?? editor.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="chkuser.asp"-->
<!--#include file="inc/user.asp"-->
<%
if rshost("html")=False then WriteErrMsg("您暫時不能使用HTML編輯器功能!")
dim filehtml, files , filetext
username=Request.Cookies("9cool_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 WriteErrMsg("處理URL時出錯,請與系統管理員聯系!")
checkpath="/"&Request.Cookies("9cool_username")
if lcase(checkpath)<>lcase(left(files,len("/"&Request.Cookies("9cool_username")))) then
WriteErrMsg("處理URL時出錯,請與系統管理員聯系!")
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/default.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" id="file" style="width:300" value="<%=files%>" size="1" maxlength="50">
<input name="Button" type="submit" value="讀文件">
<input name="Submit" type="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 id=Submit1 value="保存">
<input type="reset" name="submit2" value="還原">
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -