BVB Source Codes

QQ number network source v1.0 Show delete.asp Source code

Return Download QQ number network source v1.0: download delete.asp Source code - Download QQ number network source v1.0 Source code - Type:.asp
  1. <!--#include file = "Startup.asp"-->
  2.  
  3. <%
  4.  
  5. ' ======================
  6. ' 功能:删除新闻
  7. ' 描述:新闻删除后,页面转向新闻列表页。
  8. '       删除新闻的同时,删除此新闻相关的上传文件。
  9. ' ======================
  10.  
  11. Call Header("删除新闻")
  12. Call Content()
  13. Call Footer()
  14.  
  15.  
  16. ' 本页内容区
  17. Sub Content()
  18.  
  19.         ' 取参数:新闻ID
  20.         Dim sNewsID
  21.         sNewsID = Trim(Request("id"))
  22.  
  23.         ' 新闻ID有效性验证,防止有些人恶意的破坏此演示程序
  24.         If IsNumeric(sNewsID) = False Then
  25.                 GoError "请通过页面上的链接进行操作,不要试图破坏此演示系统。"
  26.         End If
  27.  
  28.         ' 从新闻数据表中取出相关的上传文件
  29.         ' 上传后保存到本地服务器的路径文件名,多个以"|"分隔
  30.         ' 删除文件,要取带路径的文件名才可以,并且只要这个就可以了,原来存的原文件名或不带路径的保存文件名可用于其它地方使用
  31.         Dim sSavePathFileName
  32.        
  33.         sSql = "SELECT D_SavePathFileName FROM NewsData WHERE D_ID=" & sNewsID
  34.         oRs.Open sSql, oConn, 0, 1
  35.         If Not oRs.Eof Then
  36.                 sSavePathFileName = oRs("D_SavePathFileName")
  37.         Else
  38.                 GoError "无效的新闻ID,请点页面上的链接进行操作!"
  39.         End If
  40.         oRs.Close
  41.  
  42.         ' 把带"|"的字符串转为数组
  43.         Dim aSavePathFileName
  44.         aSavePathFileName = Split(sSavePathFileName, "|")
  45.  
  46.         ' 删除新闻相关的文件,从文件夹中
  47.         Dim i
  48.         For i = 0 To UBound(aSavePathFileName)
  49.                 ' 按路径文件名删除文件
  50.                 Call DoDelFile(aSavePathFileName(i))
  51.         Next
  52.  
  53.         ' 删除新闻
  54.         sSql = "DELETE FROM NewsData WHERE D_ID=" & sNewsID
  55.         oConn.Execute sSql
  56.  
  57.         ' 3秒转向新闻列表页
  58.         response.write "<p align=center>新闻删除成功,3秒后自动返回新闻列表页!<script>window.setTimeout(""location.href='list.asp'"",3000);</script></p>"
  59.  
  60. End Sub
  61.  
  62. ' 删除指定的文件
  63. Sub DoDelFile(sPathFile)
  64.         On Error Resume Next
  65.         Dim oFSO
  66.         Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
  67.         oFSO.DeleteFile(Server.MapPath(sPathFile))
  68.         Set oFSO = Nothing
  69. End Sub
  70.  
  71. %>
  72.  
  73.  
downloaddelete.asp Source code - Download QQ number network source v1.0 Source code
Related Source Codes/Software:
Fate. Mobile message this v1.1 - Fate. Wind chimes guestbook, which is used to coll... 2016-11-11
400 simple message this V1.0 - 400 simple message this V1.0 2016-11-11
ASP cache them v1.0 premium - Released a few days before the ASP application emb... 2016-11-11
Ding v2.0 auspicious multi-user online customer service system - Multi-user online customer service system is an en... 2016-11-11
Think of concise message this v1.1 - Wisdom of concise message this V1.1 main functions... 2016-11-11
A small BBS V1.0 - Update: added SQL injection prevention program, re... 2016-11-11
Love will find clothing site www.2145.cc (full version) - It's nice to see you again. 2016-11-11
Qi qi ebook thief (pseudo static + background) v1.0 - Pseudo static + background Qi Qi thief programs ... 2016-11-11
Tao, ASP Trojan scanner v1.1 - Can scan all the specified type on the server (asp... 2016-11-11
138 MC v1.0 music network program - Installation instructions: 2016-11-11
ng-bootstrap - Angular powered Bootstrap h... 2017-04-09
vscode-go - An extension for VS Code which provides support fo... 2017-04-09
electron-builder - A complete solution to package and build a ready f... 2017-04-09
husky - 2017-04-09
eslint-plugin-react - React specific linting rules for ESLint 2017-04-09
fuckitjs - The Original Javascript Error Steamroller 2017-04-09
DeDRM_tools - DeDRM tools for ebook 2017-04-08
kcp - KCP - A Fast and Reliable ARQ Protocol 2017-04-08
cloc - cloc counts blank lines, comment lines, and physic... 2017-04-08

 Back to top