Function.asp
上传用户:yunfeng252
上传日期:2022-07-23
资源大小:12403k
文件大小:5k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%
  2. Function GuDateTimeFormat(GuDateTime0,GuDateTimeFT)
  3. GuDateTimeFormat,GuDateTimeWeek0
  4. select case GuDateTimeFT
  5. case "1"
  6. GuDateTimeFormat=""&year(GuDateTime0)&"年"&month(GuDateTime0)&"月"&day(GuDateTime0)&"日"
  7. case "2"
  8. GuDateTimeFormat=""&month(GuDateTime0)&"月"&day(GuDateTime0)&"日"
  9. case "3" 
  10. GuDateTimeFormat=""&year(GuDateTime0)&"/"&month(GuDateTime0)&"/"&day(GuDateTime0)&""
  11. case "4"
  12. GuDateTimeFormat=""&month(GuDateTime0)&"/"&day(GuDateTime0)&""
  13. case "5"
  14. GuDateTimeFormat=""&month(GuDateTime0)&"月"&day(GuDateTime0)&"日 "&FormatDateTime(GuDateTime0,4)&""
  15. case "6"
  16. GuDateTimeWeek0="星期日,星期一,星期二,星期三,星期四,星期五,星期六"
  17. GuDateTimeWeek0=split(GuDateTimeWeek0,",") 
  18. GuDateTimeFormat=GuDateTimeWeek0(Weekday(GuDateTime0)-1)
  19. case else
  20. GuDateTimeFormat=GuDateTime0
  21. end select
  22. End Function
  23. Function GuStringCheck(GuString0)
  24. if isnull(GuString0) then
  25. GuStringCheck=""
  26. exit Function
  27. end if
  28. GuStringCheck=replace(GuString0,"'","''")
  29. End Function
  30. Function GuBrowserCheck(GuBrowserInfo)
  31. if Instr(GuBrowserInfo,"NetCaptor 6.5.0")>0 then
  32. GuBrowserCheck="NetCaptor 6.5.0"
  33. elseif Instr(GuBrowserInfo,"MyIe 3.1")>0 then
  34. GuBrowserCheck="MyIe 3.1"
  35. elseif Instr(GuBrowserInfo,"NetCaptor 6.5.0RC1")>0 then
  36. GuBrowserCheck="NetCaptor 6.5.0RC1"
  37. elseif Instr(GuBrowserInfo,"NetCaptor 6.5.PB1")>0 then
  38. GuBrowserCheck="NetCaptor 6.5.PB1"
  39. elseif Instr(GuBrowserInfo,"MSIE 5.5")>0 then
  40. GuBrowserCheck="Internet Explorer 5.5"
  41. elseif Instr(GuBrowserInfo,"MSIE 6.0")>0 then
  42. GuBrowserCheck="Internet Explorer 6.0"
  43. elseif Instr(GuBrowserInfo,"MSIE 6.0b")>0 then
  44. GuBrowserCheck="Internet Explorer 6.0b"
  45. elseif Instr(GuBrowserInfo,"MSIE 5.01")>0 then
  46. GuBrowserCheck="Internet Explorer 5.01"
  47. elseif Instr(GuBrowserInfo,"MSIE 5.0")>0 then
  48. GuBrowserCheck="Internet Explorer 5.00"
  49. elseif Instr(GuBrowserInfo,"MSIE 4.0")>0 then
  50. GuBrowserCheck="Internet Explorer 4.01"
  51. else
  52. GuBrowserCheck="Other"
  53. end if
  54. End Function
  55. Function GuSystemCheck(GuSystemInfo)
  56. if Instr(GuSystemInfo,"NT 5.1")>0 then
  57. GuSystemCheck=GuSystemCheck+"Windows XP"
  58. elseif Instr(GuSystemInfo,"Tel")>0 then
  59. GuSystemCheck=GuSystemCheck+"Telport"
  60. elseif Instr(GuSystemInfo,"webzip")>0 then
  61. GuSystemCheck=GuSystemCheck+"webzip"
  62. elseif Instr(GuSystemInfo,"flashget")>0 then
  63. GuSystemCheck=GuSystemCheck+"flashget"
  64. elseif Instr(GuSystemInfo,"offline")>0 then
  65. GuSystemCheck=GuSystemCheck+"offline"
  66. elseif Instr(GuSystemInfo,"NT 5")>0 then
  67. GuSystemCheck=GuSystemCheck+"Windows 2000"
  68. elseif Instr(GuSystemInfo,"NT 4")>0 then
  69. GuSystemCheck=GuSystemCheck+"Windows NT4"
  70. elseif Instr(GuSystemInfo,"98")>0 then
  71. GuSystemCheck=GuSystemCheck+"Windows 98"
  72. elseif Instr(GuSystemInfo,"95")>0 then
  73. GuSystemCheck=GuSystemCheck+"Windows 95"
  74. elseif instr(GuSystemInfo,"unix") or instr(GuSystemInfo,"linux") or instr(GuSystemInfo,"SunOS") or instr(GuSystemInfo,"BSD") then
  75. GuSystemCheck=GuSystemCheck+"类Unix"
  76. elseif instr(thesoft,"Mac") then
  77. GuSystemCheck=GuSystemCheck+"Mac"
  78. else
  79. GuSystemCheck=GuSystemCheck+"Other"
  80. end if
  81. End Function
  82. Function GuStringCut(GuString0,GuStringLen)
  83. dim GuStringL,GuStringT,GuStringC,i
  84. GuStringL=len(GuString0)
  85. GuStringT=0
  86. for i=1 to GuStringL
  87. GuStringC=abs(asc(mid(GuString0,i,1)))
  88. if GuStringC>255 then
  89. GuStringT=GuStringT+2
  90. else
  91. GuStringT=GuStringT+1
  92. end if
  93. if GuStringT>=GuStringLen then
  94. GuStringCut=left(GuString0,i)&".."
  95. exit for
  96. else
  97. GuStringCut=GuString0
  98. end if
  99. next
  100. GuStringCut=replace(GuStringCut,chr(10),"")
  101. End Function
  102. Function GuIntegerCheck(GuInteger0)
  103. dim GuIntegerString,GuIntegerL,i
  104. if isNUll(GuInteger0) then
  105. GuIntegerCheck=false
  106. exit Function
  107. end if
  108. GuIntegerString=cstr(GuInteger0)
  109. if trim(GuIntegerString)="" then
  110. GuIntegerCheck=false
  111. exit Function
  112. end if
  113. GuIntegerL=len(GuIntegerString)
  114. for i=1 to GuIntegerL
  115. if mid(GuIntegerString,i,1)>"9" or mid(GuIntegerString,i,1)<"0" then
  116. GuIntegerCheck=false 
  117. exit Function
  118. end if
  119. next
  120. GuIntegerCheck=true
  121. if err.number<>0 then err.clear
  122. End Function
  123. Function GuURLEncoding(GuURLEncoding0)
  124. dim GuURLEncoding1,GuStringSpecial,GuThischr,GuInnercode,GuHight8,GuLow8,i
  125. GuStringSpecial="!""#$%&'()*+,/:;<=>?@[]^`{|}~%"
  126. GuURLEncoding1=""
  127. for i=1 to len(GuURLEncoding0)
  128. GuThischr=mid(GuURLEncoding0,i,1)
  129. if abs(asc(GuThischr)) < &hff then
  130. if GuThischr=" " then
  131. GuURLEncoding1=GuURLEncoding1 & "+"
  132. elseif instr(GuStringSpecial,GuThischr)>0 then
  133. GuURLEncoding1=GuURLEncoding1 & "%" & hex(asc(GuThischr))
  134. else
  135. GuURLEncoding1=GuURLEncoding1 & GuThischr
  136. end if
  137. else
  138. GuInnercode=asc(GuThischr)
  139. if GuInnercode<0 then
  140. GuInnercode=GuInnercode + &h10000
  141. end if
  142. GuHight8=(GuInnercode and &hff00) &hff
  143. GuLow8=GuInnercode and &hff
  144. GuURLEncoding1=GuURLEncoding1& "%" & hex(GuHight8) & "%" & hex(GuLow8)
  145. end if
  146. next
  147. GuURLEncoding=GuURLEncoding1
  148. End Function
  149. Function GuHTMLCodeFilter(GuHTMLCode0)
  150. dim GuRegExp,GuHTMLCode1
  151. set GuRegExp=New Regexp
  152. GuRegExp.IgnoreCase=true
  153. GuRegExp.Global=true
  154. GuRegExp.Pattern="<.+?>"
  155. GuHTMLCode1=GuRegExp.Replace(GuHTMLCode0,"")
  156. GuHTMLCode1=Replace(GuHTMLCode1,"<","&lt;")
  157. GuHTMLCode1=Replace(GuHTMLCode1,">","&gt;")
  158. GuHTMLCodeFilter=GuHTMLCode1
  159. set GuRegExp=Nothing
  160. End Function
  161. %>