asp 在线记事本程序
<!--#include file="conn/conn.asp"-->
<%
if session("username")="" or session("use_type")<>"超级管理员" then
response.Write("<script language='javascript'>alert('没有足够权限,不能对网站文件进行操作!');history.back();</script>")
response.end
end if
dim path,filename,filetype,fileconten,fso
path=request("path")
filename=html_encode(request("filename"))
filecontent=request("filecontent")
filetype=request("filetype")
if instr(filename,"*")>0 or instr(filename,"?")>0 or instr(filename,"&")>0 or len(filename)<0 or filename="" then
response.Write("<script language='javascript'>alert('非法的文件名!');history.back();</script>")
response.end
else
set fso=server.createobject("scripting.filesystemobject")
if fso.fileexists(path&filename&filetype) then
response.Write("<script language='javascript'>alert('文件名己存,请重新选择!');history.back();</script>")
response.End()
end if
set input=fso.createtextfile(server.mappath(path&filename&filetype),true)
input.writeline(filecontent)
input.close
if err then
response.Write("<script language='javascript'>alert('不可预料的错误!保存文件失败!');history.back();</script>")
else
%>
<script language="">
var pathh="<%=replace(session("scriptname"),"","/")%>";
alert("文件成功!");
window.location="try/mange_page.asp?pathh="+pathh;
</script>
<%
'response.redirect("try/mange_page.asp")
end if
end if
%>
补充:asp教程,ASP入门