Function.asp
上传用户:yunfeng252
上传日期:2022-07-23
资源大小:12403k
文件大小:5k
- <%
- Function GuDateTimeFormat(GuDateTime0,GuDateTimeFT)
- GuDateTimeFormat,GuDateTimeWeek0
- select case GuDateTimeFT
- case "1"
- GuDateTimeFormat=""&year(GuDateTime0)&"年"&month(GuDateTime0)&"月"&day(GuDateTime0)&"日"
- case "2"
- GuDateTimeFormat=""&month(GuDateTime0)&"月"&day(GuDateTime0)&"日"
- case "3"
- GuDateTimeFormat=""&year(GuDateTime0)&"/"&month(GuDateTime0)&"/"&day(GuDateTime0)&""
- case "4"
- GuDateTimeFormat=""&month(GuDateTime0)&"/"&day(GuDateTime0)&""
- case "5"
- GuDateTimeFormat=""&month(GuDateTime0)&"月"&day(GuDateTime0)&"日 "&FormatDateTime(GuDateTime0,4)&""
- case "6"
- GuDateTimeWeek0="星期日,星期一,星期二,星期三,星期四,星期五,星期六"
- GuDateTimeWeek0=split(GuDateTimeWeek0,",")
- GuDateTimeFormat=GuDateTimeWeek0(Weekday(GuDateTime0)-1)
- case else
- GuDateTimeFormat=GuDateTime0
- end select
- End Function
- Function GuStringCheck(GuString0)
- if isnull(GuString0) then
- GuStringCheck=""
- exit Function
- end if
- GuStringCheck=replace(GuString0,"'","''")
- End Function
- Function GuBrowserCheck(GuBrowserInfo)
- if Instr(GuBrowserInfo,"NetCaptor 6.5.0")>0 then
- GuBrowserCheck="NetCaptor 6.5.0"
- elseif Instr(GuBrowserInfo,"MyIe 3.1")>0 then
- GuBrowserCheck="MyIe 3.1"
- elseif Instr(GuBrowserInfo,"NetCaptor 6.5.0RC1")>0 then
- GuBrowserCheck="NetCaptor 6.5.0RC1"
- elseif Instr(GuBrowserInfo,"NetCaptor 6.5.PB1")>0 then
- GuBrowserCheck="NetCaptor 6.5.PB1"
- elseif Instr(GuBrowserInfo,"MSIE 5.5")>0 then
- GuBrowserCheck="Internet Explorer 5.5"
- elseif Instr(GuBrowserInfo,"MSIE 6.0")>0 then
- GuBrowserCheck="Internet Explorer 6.0"
- elseif Instr(GuBrowserInfo,"MSIE 6.0b")>0 then
- GuBrowserCheck="Internet Explorer 6.0b"
- elseif Instr(GuBrowserInfo,"MSIE 5.01")>0 then
- GuBrowserCheck="Internet Explorer 5.01"
- elseif Instr(GuBrowserInfo,"MSIE 5.0")>0 then
- GuBrowserCheck="Internet Explorer 5.00"
- elseif Instr(GuBrowserInfo,"MSIE 4.0")>0 then
- GuBrowserCheck="Internet Explorer 4.01"
- else
- GuBrowserCheck="Other"
- end if
- End Function
- Function GuSystemCheck(GuSystemInfo)
- if Instr(GuSystemInfo,"NT 5.1")>0 then
- GuSystemCheck=GuSystemCheck+"Windows XP"
- elseif Instr(GuSystemInfo,"Tel")>0 then
- GuSystemCheck=GuSystemCheck+"Telport"
- elseif Instr(GuSystemInfo,"webzip")>0 then
- GuSystemCheck=GuSystemCheck+"webzip"
- elseif Instr(GuSystemInfo,"flashget")>0 then
- GuSystemCheck=GuSystemCheck+"flashget"
- elseif Instr(GuSystemInfo,"offline")>0 then
- GuSystemCheck=GuSystemCheck+"offline"
- elseif Instr(GuSystemInfo,"NT 5")>0 then
- GuSystemCheck=GuSystemCheck+"Windows 2000"
- elseif Instr(GuSystemInfo,"NT 4")>0 then
- GuSystemCheck=GuSystemCheck+"Windows NT4"
- elseif Instr(GuSystemInfo,"98")>0 then
- GuSystemCheck=GuSystemCheck+"Windows 98"
- elseif Instr(GuSystemInfo,"95")>0 then
- GuSystemCheck=GuSystemCheck+"Windows 95"
- elseif instr(GuSystemInfo,"unix") or instr(GuSystemInfo,"linux") or instr(GuSystemInfo,"SunOS") or instr(GuSystemInfo,"BSD") then
- GuSystemCheck=GuSystemCheck+"类Unix"
- elseif instr(thesoft,"Mac") then
- GuSystemCheck=GuSystemCheck+"Mac"
- else
- GuSystemCheck=GuSystemCheck+"Other"
- end if
- End Function
- Function GuStringCut(GuString0,GuStringLen)
- dim GuStringL,GuStringT,GuStringC,i
- GuStringL=len(GuString0)
- GuStringT=0
- for i=1 to GuStringL
- GuStringC=abs(asc(mid(GuString0,i,1)))
- if GuStringC>255 then
- GuStringT=GuStringT+2
- else
- GuStringT=GuStringT+1
- end if
- if GuStringT>=GuStringLen then
- GuStringCut=left(GuString0,i)&".."
- exit for
- else
- GuStringCut=GuString0
- end if
- next
- GuStringCut=replace(GuStringCut,chr(10),"")
- End Function
- Function GuIntegerCheck(GuInteger0)
- dim GuIntegerString,GuIntegerL,i
- if isNUll(GuInteger0) then
- GuIntegerCheck=false
- exit Function
- end if
- GuIntegerString=cstr(GuInteger0)
- if trim(GuIntegerString)="" then
- GuIntegerCheck=false
- exit Function
- end if
- GuIntegerL=len(GuIntegerString)
- for i=1 to GuIntegerL
- if mid(GuIntegerString,i,1)>"9" or mid(GuIntegerString,i,1)<"0" then
- GuIntegerCheck=false
- exit Function
- end if
- next
- GuIntegerCheck=true
- if err.number<>0 then err.clear
- End Function
- Function GuURLEncoding(GuURLEncoding0)
- dim GuURLEncoding1,GuStringSpecial,GuThischr,GuInnercode,GuHight8,GuLow8,i
- GuStringSpecial="!""#$%&'()*+,/:;<=>?@[]^`{|}~%"
- GuURLEncoding1=""
- for i=1 to len(GuURLEncoding0)
- GuThischr=mid(GuURLEncoding0,i,1)
- if abs(asc(GuThischr)) < &hff then
- if GuThischr=" " then
- GuURLEncoding1=GuURLEncoding1 & "+"
- elseif instr(GuStringSpecial,GuThischr)>0 then
- GuURLEncoding1=GuURLEncoding1 & "%" & hex(asc(GuThischr))
- else
- GuURLEncoding1=GuURLEncoding1 & GuThischr
- end if
- else
- GuInnercode=asc(GuThischr)
- if GuInnercode<0 then
- GuInnercode=GuInnercode + &h10000
- end if
- GuHight8=(GuInnercode and &hff00) &hff
- GuLow8=GuInnercode and &hff
- GuURLEncoding1=GuURLEncoding1& "%" & hex(GuHight8) & "%" & hex(GuLow8)
- end if
- next
- GuURLEncoding=GuURLEncoding1
- End Function
- Function GuHTMLCodeFilter(GuHTMLCode0)
- dim GuRegExp,GuHTMLCode1
- set GuRegExp=New Regexp
- GuRegExp.IgnoreCase=true
- GuRegExp.Global=true
- GuRegExp.Pattern="<.+?>"
- GuHTMLCode1=GuRegExp.Replace(GuHTMLCode0,"")
- GuHTMLCode1=Replace(GuHTMLCode1,"<","<")
- GuHTMLCode1=Replace(GuHTMLCode1,">",">")
- GuHTMLCodeFilter=GuHTMLCode1
- set GuRegExp=Nothing
- End Function
- %>