Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

99 linhas
2.9 KiB

  1. <%
  2. Function GetUrl()
  3. Dim ScriptAddress, M_ItemUrl, M_item
  4. ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME")) '取得当前地址
  5. M_ItemUrl = ""
  6. If (Request.QueryString <> "") Then
  7. ScriptAddress = ScriptAddress & "?"
  8. For Each M_item In Request.QueryString
  9. If InStr(page,M_Item)=0 Then
  10. M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) & "&"
  11. End If
  12. Next
  13. end if
  14. c_geturl = trim(ScriptAddress & M_ItemUrl)
  15. GetUrl = c_geturl
  16. End Function
  17. Sub makeFile(cfilename,cfilecontent)
  18. on error resume next
  19. filepath=Server.MapPath(cfilename)
  20. Set fso = Server.CreateObject("Scripting.FileSystemObject")
  21. c_fileoldcontent = ""
  22. Set txt = fso.OpenTextFile(filepath,1,true)
  23. c_fileoldcontent = txt.ReadAll
  24. txt.close
  25. set file = fso.opentextfile(filepath, 2 , TRUE)
  26. c_filenewcontent = cstr(now()) & "@" & GetIP & " : " & cfilecontent
  27. c_fileoldcontent = c_fileoldcontent & c_filenewcontent
  28. file.writeline c_fileoldcontent
  29. file.close
  30. set file = nothing
  31. set fso = nothing
  32. End Sub
  33. Function GetIP()
  34. dim strIPAddr
  35. If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 Then
  36. strIPAddr = Request.ServerVariables("REMOTE_ADDR")
  37. ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 Then
  38. strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",")-1)
  39. ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 Then
  40. strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";")-1)
  41. Else
  42. strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
  43. End If
  44. GetIP = Trim(Mid(strIPAddr, 1, 30))
  45. End Function
  46. function deal_str_beforesql(csource)
  47. csource = trim(csource)
  48. csource = replace(csource,"'","")
  49. deal_str_beforesql = csource
  50. end function
  51. function deal_num_beforesql(csource)
  52. if len(csource)=0 then csource="0"
  53. if isnumeric(csoure)=false then csource="0"
  54. deal_num_beforesql = csource
  55. end function
  56. function deal_str_beforeshow(csource)
  57. csource = replace(csource,"&","&amp;")
  58. csource = replace(csource,"<","&lt;")
  59. csource = replace(csource,">","&gt;")
  60. deal_str_beforeshow = csource
  61. end function
  62. Function URLDecode(enStr)
  63. dim deStr,strSpecial
  64. dim c,i,v
  65. deStr=""
  66. strSpecial="!""#$%&'()*+,.-_/:;< =>?@[/]^`{|}~%"
  67. for i=1 to len(enStr)
  68. c=Mid(enStr,i,1)
  69. if c="%" then
  70. v=eval("&h"+Mid(enStr,i+1,2))
  71. if inStr(strSpecial,chr(v))>0 then
  72. deStr=deStr&chr(v)
  73. i=i+2
  74. else
  75. v=eval("&h"+ Mid(enStr,i+1,2) + Mid(enStr,i+4,2))
  76. deStr=deStr & chr(v)
  77. i=i+5
  78. end if
  79. else
  80. if c="+" then
  81. deStr=deStr&" "
  82. else
  83. deStr=deStr&c
  84. end if
  85. end if
  86. next
  87. URLDecode=deStr
  88. End function
  89. %>