📄 savefile.asp
字号:
<!--#include file="mdb/conn.asp" -->
<!--#include file="info.asp" -->
<!--#include file="config.asp" -->
<!--#include file="check.asp" -->
<%
on error resume next
if Request.QueryString("cz")="" then
Response.Redirect"info.asp?info=错误的参数"
else
cz=Request.QueryString("cz")
end if
if cz="del" then
set rs=server.createobject("adodb.recordset")
sql="select * from desktop where id="&Request.QueryString("id")
rs.open sql,conn,1,3
fn=rs("url")
filepath=Server.MapPath(fn)
'response.write filepath
'response.end
Set Fso=server.createobject("scripting.filesystemobject")
Fso.DeleteFile(Filepath)
fn=rs("surl")
filepath=Server.MapPath(fn)
'response.write filepath
'response.end
Set Fso=server.createobject("scripting.filesystemobject")
Fso.DeleteFile(Filepath)
set Fso=nothing
conn.execute "delete from desktop where id="&Request.QueryString("id")
response.write "<SCRIPT language=JavaScript>alert('删除成功!');"
response.write "this.location.href='javascript:window.close()';</SCRIPT>"
else
REM ------判断数据有效性------
if trim(Request.Form("name"))="" then
founderr=true
info=info+"<li>请填写文件名称</li>"
end if
if trim(Request.Form("typeid"))="" then
founderr=true
info=info+"<li>请选择分类</li>"
end if
REM ------如果数据是有效的则开始存储数据并显示相关信息------
set rs=server.createobject("adodb.recordset")
sql="select * from desktop where id="&Request.QueryString("id")
rs.open sql,conn,1,3
rs("name")=Request.Form("name")
rs("zhuanti")=Request.Form("zhuanti")
if Request.Form("jj")<>"" then
rs("jj")=HTMLEncode2(Request.Form("jj"))
end if
rs.update
rs.close
set rs=nothing
conn.close
Set conn=Nothing
Response.Redirect"addfile.asp?typeid="&Request.Form("zhuanti")
REM ------如果数据是无效的则开始显示错误信息------
call infom()
end if
function HTMLEncode2(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLEncode2 = fString
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -