asp识别网页编码转成.net代码,在线等高手帮忙!
asp代码
'---------------------------------------
<%
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
AL = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")'
LG = RegExpTest("^[a-z\-]+",AL)'
select case LG
case "zh-cn"
RESPONSE.REDIRECT "index.aspx"
case "zh-tw"
RESPONSE.REDIRECT "index.aspx"
case "zh-mo"
RESPONSE.REDIRECT "index.aspx"
case "zh-hk"
RESPONSE.REDIRECT "index.aspx"
case "zh-sg"
RESPONSE.REDIRECT "indexE.aspx"
case "en-us"
RESPONSE.REDIRECT "indexE.aspx"
case "en-gb"
RESPONSE.REDIRECT "indexE.aspx"
case "en-au"
RESPONSE.REDIRECT "indexE.aspx"
case "ja"
RESPONSE.REDIRECT "indexE.aspx"
case "ko"
RESPONSE.REDIRECT "indexE.aspx"
end select
'---------------------------------------
%>
移植到asp.net上一个空白index.aspx,
要求打开时就会执行上面的asp代码并根据相应的判断自动跳转,而且还要将select case 转换成if then elseif......end if
在线等,望路见不平的大侠帮忙,先说声谢谢了~