📄 imagedelt.asp
字号:
<!--#include file="../conndb.asp"-->
<!--#include file="isAdmin.asp"-->
<%
Dim ImageFile,lid,Num
'读取线路编号和图片编号
lid = Request.QueryString("lid")
Num = Request.QueryString("no")
'读取指定的线路信息
Set rs = Server.CreateObject("ADODB.RecordSet")
Set rs = Conn.Execute("SELECT * FROM Line WHERE LineId=" & lid)
'如果存在此线路,则删除图片信息
If Not rs.EOF Then
'读取图片文件名
ImageFile = rs("Image" & Num)
'删除图片
filename = Server.MapPath("images\"&ImageFile)
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
If (MyFileObject.FileExists(Trim(filename))) Then
MyFileObject.DeleteFile Trim(filename)
End If
'更新表Line中此图片信息
sql = "UPDATE Line SET Image" & Num & "='', ImageTitle" & Num & "='' WHERE LineId=" & lid
Conn.Execute(sql)
End If
'删除图片后,将页面跳转到编辑页面
Response.Redirect "LineEdit.asp?lid="&lid
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -