yns_cab.asp
上传用户:yjkj1008
上传日期:2020-10-17
资源大小:1496k
文件大小:2k
源码类别:

电子政务应用

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <!--#include file="Connections/conn_news.asp" --> <% '请尊重作者劳动成果不要删除以上信息 '业一新闻系统3.0正式版 '主页:http://yeyi.net '论坛:http://bbs.yeyi.net '业一网络 承接各种网站制作 '程序开发 软件开发业务 '业务联系 '电话: 13007310512 '联系人:郝亚平 'QQ:24344842 (只谈业务,技术问题请访问论坛) '请尊重作者劳动成果不要删除以上信息 %>
  3. <%
  4. Dim rsn__MMColParam
  5. rsn__MMColParam = "1"
  6. If (Request.Form("t_id") <> "") Then 
  7.   rsn__MMColParam = Request.Form("t_id")
  8. End If
  9. %>
  10. <%
  11. Dim rsn
  12. Dim rsn_numRows
  13. Set rsn = Server.CreateObject("ADODB.Recordset")
  14. rsn.ActiveConnection = MM_conn_news_STRING
  15. rsn.Source = "SELECT * FROM t_news WHERE n_tid = " + Replace(rsn__MMColParam, "'", "''") + ""
  16. rsn.CursorType = 0
  17. rsn.CursorLocation = 2
  18. rsn.LockType = 1
  19. rsn.Open()
  20. rsn_numRows = 0
  21. %>
  22. <%if rsn.eof and rsn.bof then%>
  23. <script language=javascript>  
  24. alert( "该类别没有新闻!"  );
  25. location.href = "javascript:history.back()"   
  26. </script>
  27. <% Else %>
  28. <%
  29. Dim rsm__MMColParam
  30. do while not rsn.EOF
  31. rsm__MMColParam = "1"
  32. If (Request.Form("m_id") <> "") Then 
  33.   rsm__MMColParam = Request.Form("m_id")
  34. End If
  35. %>
  36. <%
  37. Dim rsm
  38. Dim rsm_numRows
  39. Set rsm = Server.CreateObject("ADODB.Recordset")
  40. rsm.ActiveConnection = MM_conn_news_STRING
  41. rsm.Source = "SELECT * FROM t_mob WHERE m_id = " + Replace(rsm__MMColParam, "'", "''") + ""
  42. rsm.CursorType = 0
  43. rsm.CursorLocation = 2
  44. rsm.LockType = 1
  45. rsm.Open()
  46. rsm_numRows = 0
  47. pencat = (rsm.Fields.Item("m_content").Value)
  48. %>
  49. <%
  50. dim n_fpath
  51. dim n_title
  52. dim n_author
  53. dim n_content
  54. dim n_date
  55. dim n_fname
  56.  
  57. n_fpath = request.form("t_id")
  58. n_title = (rsn.Fields.Item("n_title").Value)
  59. n_author = (rsn.Fields.Item("n_author").Value)
  60. n_content = (rsn.Fields.Item("n_content").Value)
  61. n_date = (rsn.Fields.Item("n_date").Value)
  62. n_fname = (rsn.Fields.Item("n_fname").Value)
  63. pencat = replace(pencat,"t_title",n_title)
  64. pencat = replace(pencat,"t_author",n_author)
  65. pencat = replace(pencat,"t_content",n_content)
  66. pencat = replace(pencat,"t_date",n_date)
  67. Set fso = Server.CreateObject("Scripting.FileSystemObject")
  68. Set fout = fso.CreateTextFile(server.mappath(n_fpath&""&n_fname),true)
  69. fout.WriteLine pencat
  70. fout.close
  71. response.write("转换文件:"&n_fpath&""&n_fname&"<br>")
  72. %>
  73. <%
  74. rsm.Close()
  75. Set rsm = Nothing
  76. %>
  77. <%
  78. rsn.MoveNext 
  79. loop
  80. rsn.Close()
  81. Set rsn = Nothing
  82. %>
  83. <% End If %>
  84. <script language=javascript>  
  85. alert( "模版转换完成"  );
  86. location.href = "javascript:history.back()"   
  87. </script>