WenJian.Asp
资源名称:4.rar [点击查看]
上传用户:zhbanny
上传日期:2020-11-04
资源大小:161k
文件大小:5k
源码类别:

手机WAP编程

开发平台:

ASP/ASPX

  1. <!--#Include File="Inc/xkon.Asp"--><!--#Include File="Inc/upload_5xsoft.Inc"--><%
  2. Call QuanXian("1",0)
  3. Private c,s
  4. Set c=New xkon_Response
  5. Set s=New xkon_Request
  6. Dim ZhangHao
  7. ZhangHao=s.QueryString("ZhangHao")
  8. If ZhangHao="" Then
  9. ZhangHao=Zi_ZhangHao
  10. End If
  11. Private Sub WenJianLieBiao()
  12. Dim FSO,FS,Files,File,WenJian_LieBiao,p,PageCount,FileCount,AllFiles,i,WenJian
  13. p=s.QueryString_Long("p")
  14. Set FSO=Server.CreateObject("Scripting.FileSystemObject")
  15. If FSO.FolderExists(Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&ZhangHao)) Then
  16. Set FS=FSO.GetFolder(Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&ZhangHao))
  17. Set Files=FS.Files
  18. FileCount=Files.Count
  19. For Each File In Files
  20. If File.Name<>"U.Txt" Then
  21. AllFiles=AllFiles&"#x"&"kon.c"&"n#"&File.Name
  22. End If
  23. Next
  24. Set Files=Nothing
  25. If FileCount Mod Const_Page_Ys = 0 Then
  26. PageCount=FileCountConst_Page_Ys
  27. Else
  28. PageCount=FileCountConst_Page_Ys+1
  29. End If
  30. If p>PageCount Then
  31. P=1
  32. End If
  33. If AllFiles="" Then
  34. WenJian_LieBiao="没有找到任何文件<br/>"
  35. Else
  36. Dim JianJie,JianJie1,JianJie2
  37. Set JianJie=FSO.OpenTextFile(Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&Zi_ZhangHao&"/U.Txt"),1,False)
  38. If Not JianJie.AtEndOfStream Then
  39. JianJie1=Split(JianJie.ReadAll,"&xkon&")
  40. End If
  41. Set JianJie=Nothing
  42. WenJian=Split(AllFiles,"#xkon.cn#")
  43. For i=1 To Const_Page_Ys
  44. If (p-1)*Const_Page_Ys+i=FileCount Then Exit For
  45. JianJie2=Split(JianJie1((p-1)*Const_Page_Ys+i),"&xkon.cn&")
  46. WenJian_LieBiao=WenJian_LieBiao&WenJian((p-1)*Const_Page_Ys+i)&"<br/>简介:"&JianJie2(0)&"<br/><a href=""File/"&Read_SZ("Folder_ZiYuan")&"/"&ZhangHao&"/"&WenJian((p-1)*Const_Page_Ys+i)&""">下载</a>"
  47. If ZhangHao=Zi_ZhangHao Then
  48. WenJian_LieBiao=WenJian_LieBiao&"<a href=""WenJian.Asp?l=s&amp;File="&Server.UrlEncode(WenJian((p-1)*Const_Page_Ys+i))&"{(xkon.cn)链接}"">删除</a>"
  49. End If
  50. WenJian_LieBiao=WenJian_LieBiao&"<br/>"
  51. Next
  52. WenJian_LieBiao=WenJian_LieBiao&Cpage(PageCount,p,"WenJian.Asp?ZhangHao="&ZhangHao&"{(xkon.cn)链接}&amp;")
  53. End If
  54. Set FS=Nothing
  55. Else
  56. WenJian_LieBiao="没有找到任何文件<br/>"
  57. FSO.CreateFolder(Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&ZhangHao))
  58. End If
  59. Set FSO=Nothing
  60. c.Write(xkon_FenXi(Replace(Replace(Replace(Read_Text("WenJian"),xkon_S("文件列表"),WenJian_LieBiao),xkon_S("资源数"),FileCount-1),xkon_S("文件数"),FileCount)))
  61. End Sub
  62. Private Sub j()
  63. c.Write(xkon_FenXi(Read_Text("WenJian;j")))
  64. End Sub
  65. Private Sub j2()
  66. If Read_SZ("YH_ShangChuan")="0" Then Call xkon_Error("禁止上传文件")
  67. Dim File,Upload,JianJie,GeShi,GeShi1,i,ShangChuan,J2_Name
  68. ShangChuan=False
  69. GeShi=Split(Read_SZ("ShangChuan_GeShi"),",")
  70. Set Upload=New Upload_5xsoft
  71. JianJie=Upload.Form("JianJie")
  72. Set File=Upload.File("File")
  73. If File.FileSize=0 Then Call xkon_Error("请先选择文件")
  74. If File.FileSize>CLng(Read_SZ("ShangChuan_DaXiao")) Then Call xkon_Error("文件太大")
  75. GeShi1=Split(File.FileName,".")
  76. For i=0 To UBound(GeShi)
  77. If Trim(GeShi1(UBound(GeShi1)))=GeShi(i) Then ShangChuan=True:Exit For
  78. Next
  79. If ShangChuan=False Then Call xkon_Error("不支持该格式")
  80. J2_Name=Year(Date)&Month(Date)&Day(Date)&Hour(Time)&Minute(Time)&Second(Time)&"."&GeShi1(UBound(GeShi1))
  81. File.SaveAs Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&Zi_ZhangHao&"/"&J2_Name)
  82. Set File=Nothing
  83. Set Upload=Nothing
  84. Dim FSO,FS
  85. Set FSO=Server.CreateObject("Scripting.FileSystemObject")
  86. Set FS=FSO.OpenTextFile(Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&Zi_ZhangHao&"/U.Txt"),8,True)
  87. FS.Write("&xkon&"&JianJie&"&xkon.cn&"&J2_Name)
  88. FS.Close
  89. Set FS=Nothing
  90. Set FSO=Nothing
  91. c.Write(xkon_FenXi("上传成功<br/><a href=""WenJian.Asp?n={(xkon.cn)链接}"">返回我的文件</a>"))
  92. End Sub
  93. Private Sub Delete()
  94. Dim File,NeiRong,NeiRong1,NeiRong2,i
  95. File=s.QueryString("File")
  96. Dim FSO,FS
  97. Set FSO=Server.CreateObject("Scripting.FileSystemObject")
  98. If FSO.FileExists(Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&Zi_ZhangHao&"/"&File)) Then
  99. Set FS=FSO.OpenTextFile(Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&Zi_ZhangHao&"/U.Txt"))
  100. NeiRong=FS.ReadAll
  101. FS.Close
  102. Set FS=Nothing
  103. NeiRong1=Split(NeiRong,"&xkon&")
  104. For i=1 To UBound(NeiRong1)
  105. NeiRong2=Split(NeiRong1(i),"&xkon.cn&")
  106. If NeiRong2(1)=File Then
  107. NeiRong=Replace(NeiRong,"&xkon&"&NeiRong1(i),""):Exit For
  108. End If
  109. Next
  110. Set FS=FSO.OpenTextFile(Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&Zi_ZhangHao&"/U.Txt"),2,True)
  111. FS.Write(NeiRong)
  112. FS.Close
  113. Set FS=Nothing
  114. FSO.DeleteFile(Server.Mappath("File/"&Read_SZ("Folder_ZiYuan")&"/"&Zi_ZhangHao&"/"&File))
  115. End If
  116. Set FSO=Nothing
  117. c.Write(xkon_FenXi("删除成功<br/><a href=""WenJian.Asp?n={(xkon.cn)链接}"">返回我的文件</a>"))
  118. End Sub
  119. Call H_Title("我的文件")
  120. Dim l
  121. l=s.QueryString("l")
  122. Select Case l
  123. Case ""
  124. Call WenJianLieBiao()
  125. Case "j"
  126. Call j()
  127. Case "s"
  128. Call Delete()
  129. Case "j2"
  130. Call j2()
  131. End Select
  132. Call H_End()
  133. Set c=Nothing
  134. Set s=Nothing
  135. %>