<%@ LANGUAGE="VBScript" %> <% Function IsMobileDevice() Dim userAgent Dim mobileKeywords Dim i userAgent = Request.ServerVariables("HTTP_USER_AGENT") mobileKeywords = Array("Android", "webOS", "iPhone", "iPad", "iPod", "BlackBerry", "Windows Phone", "Opera Mini", "IEMobile") For i = 0 To UBound(mobileKeywords) If InStr(userAgent, mobileKeywords(i)) > 0 Then IsMobileDevice = True Exit Function End If Next IsMobileDevice = False End Function ' 调用IsMobileDevice函数来检测设备类型 If IsMobileDevice() Then ' 如果是移动设备,重定向到移动版页面 Response.Redirect "/dl.php" Else ' 如果是桌面设备,继续显示当前页面或重定向到桌面版页面 ' 如果不需要重定向,可以省略这行代码 Response.Redirect "/dl.asp" End If %>