www.gusucode.com > 艺帆全站DIV+CSS体育用品公司网站源码 1.7.5源码程序 > i5808/seeion.asp

    <%if session("admin")<>"" then%>
<%
else
response.write "<script>alert('请先登陆!');window.location.href='login.asp';</script>"
response.end
end if
%>

<%
Function i5808(ByVal Str,ByVal StrLen)
     Dim l,t,c,i,r
     
     '过滤全部HTML标记
     Set r=New RegExp
     r.Global=True
     r.MultiLine=True
     r.Pattern="(</?[A-Za-z][A-Za-z0-9]*[^>]*>)"
     str=r.Replace(str," ")
     Set r=Nothing
     
     l=Len(str)
     t=0
     For i=1 To l
           c=AscW(Mid(str,i,1))
           If c<0 Or c>255 Then t=t+2 Else t=t+1
           IF t>=StrLen Then
                 i5808=Left(Str,i)&"..."
                 Exit For
           Else
                 i5808=Str
           End If
     Next
End Function
%>
<%
Function DelHtml(Str1)
  Dim regEx
  Set regEx = New RegExp
  regEx.Pattern = "(<[^>]*?>)"
  regEx.Global = True
  regEx.IgnoreCase = True
  DelHtml = replace(regEx.Replace(""&str1,""),"&nbsp;","")
End Function
%>
<%
Function InterceptString(txt,length)
    txt=trim(txt)
    x = len(txt)
    y = 0
    if x >= 1 then
        for ii = 1 to x
            if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then '如果是汉字
                y = y + 2
            else
                y = y + 1
            end if
            if y >= length then
                txt = left(trim(txt),ii) '字符串限长
                exit for
            end if
        next
        InterceptString = txt
    else
        InterceptString = ""
    end if
End Function
%>