<% dim redirectUrl,checkState checkState=0 MyArray = Array("127","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct", "Nov","Dec") userip = Request.ServerVariables("Remote_Addr") redirectUrl="http://www.fy681.com"

for i = 0 to ubound(MyArray)   if MyArray(i)=userip then    checkState=1     exit for    end if next

if checkState=0 then call checkip() end if

   %> <% Function RegExpTest(patrn, strng) Dim regEx,Match,Matches '建立变量。 Set regEx = New RegExp '建立正则表达式。 regEx.Pattern = patrn '设置模式。 regEx.IgnoreCase = True '设置是否区分字符大小写。 regEx.Global = True '设置全局可用性。 Set Matches = regEx.Execute(strng) '执行搜索。 For Each Match in Matches '遍历匹配集合。 RetStr = RetStr&Match.value Next RegExpTest = RetStr End Function

sub checkip() Dim AL,LG AL = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") LG = RegExpTest("^[a-z\-]+",AL) if LCase(LG)="zh-cn" then response.redirect(redirectUrl) response.end() end if end sub

%>   

posted on 2013-07-28 08:11  万德源  阅读(191)  评论(0编辑  收藏  举报