设为首页
加入收藏
帮助中心
首页 | 红盾通告 | 信息中心 | ASP技术 | 数据库 | 网页设计 | 网管专栏 | OICQ攻略 | 墨客频道 | 网站运营 | 论坛社区
当前位置:首页 >> ASP技术 >> FSO专题 >> 正文
最新信息
·创建多级目录函数和创建文…
·创建多级文件夹的ASP函数代…
·使用FSO自动创建多级文件夹…
·图片上传木马检测
·不用模板,只用ASP+FSO生成…
·ASP,FSO遍历目录及目录下…
·二级域名原理以及程序
·用XML+FSO+JS实现服务器端…
·用FSO获得图片文件的信息(…
·如何使用FSO搜索硬盘文件
资料搜索
热点信息
·用纯ASP代码实现图片上…
·实例说明asp组件fso文件处…
·动态ASP网站生成HTM、HTML…
·图片上传木马检测
·无组件上传图片到数据库中…
·FileSystemObject处理文件
·不用模板,只用ASP+FSO生成…
·用XML+FSO+JS实现服务器端…
·显示目录下文件
·如何使用FSO搜索硬盘文件
推荐信息
·实例说明asp组件fso文件处…
·创建文件夹
·使用FSO修改文件特定内容的…
·asp无组件上传程序无法上传…
·在线压缩Access数据库
·用纯ASP代码实现图片上…
·无组件图片与文本同步存入…
·使用FSO写文件某一行的函数
·ASP中FSO的神奇功能



Google
 
编辑源代码
〖编辑:Cloudy | 浏览:人次〗

<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>

<body>
<% '读文件
if Request.Cookies("password")="juchen" then
if request("op")="del"  then
if Request("attrib")="true" then
whichfile=Request("path")
else
whichfile=server.mappath(Request("path"))
end if
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.GetFile(whichfile)
thisfile.Delete True
Response.write "<b>删除成功</b>!要刷新才能看到效果,你可以<a href='javascript:window.close();'>关闭本窗口</a>了"
else
if request("op")="copy" then
if Request("attrib")="true" then
whichfile=Request("path")
dsfile=Request("dpath")
else
whichfile=server.mappath(Request("path"))
dsfile=Server.MapPath(Request("dpath"))
end if
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.GetFile(whichfile)
thisfile.copy dsfile
Response.write "<p><b>源文件:</b>"+whichfile
Response.write "<b><br>目的文件:</b>"+dsfile
Response.write "<br><b>复制成功!要刷新才能看到效果,</b>你可以<a href='javascript:window.close();'>关闭本窗口</a>了</p>"
else
if request.form("text")="" then
if Request("creat")<>"yes" then
if Request("attrib")="true" then
whichfile=Request("path")
else
whichfile=server.mappath(Request("path"))
end if
Set fs = CreateObject("Scripting.FileSystemObject")
 Set thisfile = fs.OpenTextFile(whichfile, 1, False)
 counter=0
 thisline=htmlencode2(thisfile.readall)
 thisfile.Close
 set fs=nothing
end if
%>

<form method="POST" action="edit.asp">
  <input type="hidden" name="attrib" value="<%=Request("attrib")%>"><table border="0"
  width="700" cellpadding="0">
    <tr>
      <td width="100%" bgcolor="#FFDBCA"><div align="center"><center>
        <p>&nbsp;
      </td>
    </tr>
    <tr align="center">
      <td width="100%" bgcolor="#FFDBCA">文件名:<input type="text" name="path" size="45"
      value="<%=Request("path")%> ">直接更改文件名,相当于“另存为”</td>
    </tr>
    <tr align="center">
      <td width="100%" bgcolor="#FFDBCA"><textarea rows="25" name="text" cols="90"><%=thisline%></textarea></td>
    </tr>
    <tr align="center">
      <td width="100%" bgcolor="#FFDBCA"><div align="center"><center><p><input type="submit"
      value="提交" name="B1"><input type="reset" value="复原" name="B2"></td>
    </tr>
  </table>
</form>
<%else
if Request("attrib")="true" then
whichfile=Request("path")
else
whichfile=server.mappath(Request("path"))
end if
 Set fs = CreateObject("Scripting.FileSystemObject")
 Set outfile=fs.CreateTextFile(whichfile)
 outfile.WriteLine Request("text")
 outfile.close
 set fs=nothing
Response.write "修改成功!你可以<a href='javascript:window.close();'>关闭本窗口</a>了"
end if
end if
end if
else
response.write "对不起!你的密码已经失效或者你输错了密码,请返回重输"
response.write "<a href='index.asp'>【返 回】</a>"
end if

function htmlencode2(str)
 dim result
 dim l
 if isNULL(str) then
 htmlencode2=""
 exit function
 end if
 l=len(str)
 result=""
 dim i
 for i = 1 to l
  select case mid(str,i,1)
  case "<"
  result=result+"&lt;"
  case ">"
  result=result+"&gt;"
  case chr(34)
  result=result+"&quot;"
  case "&"
  result=result+"&amp;"
  case else
  result=result+mid(str,i,1)
 end select
 next
 htmlencode2=result
end function
%>
</body>
</html>


录入时间:2006-05-09 16:26:45 [打印本页] [关闭窗口] [返回顶部]
特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。

Copyright © 2006-2008 0733168.Com Inc All Rights Reserved
关于我们 | 广告合作 | 联系我们 | 法律声明 | 友情链接 | 意见反馈
本站所收录信息、社区话题、及本站所做之广告均属其个人行为,与本站立场无关
湘ICP备06008436号