ASP论坛的Microsoft VBScript 运行时错误 错误 '800a0009'
提示的MicrosoftVBScript运行时错误错误'800a0009'下标越界:'[number:1]'/bbs/Default.asp,行179然后具体是<%Cla...
提示的Microsoft VBScript 运行时错误 错误 '800a0009'
下标越界: '[number: 1]'
/bbs/Default.asp,行 179
然后具体是
<%
Class Cls_Browser
Public Browser,version,platform,IsSearch
Private Sub Class_Initialize()
Dim Agent,Tmpstr,Agent1
Agent=Request.ServerVariables("HTTP_USER_AGENT")
Agent1=Request.ServerVariables("HTTP_USER_AGENT")
Agent1=Split(Agent1,"/")
'Agent="Opera/7.23 (X11; Linux i686; U) [en]"
If Left(Agent,7) ="Mozilla" Then
Agent=Split(Agent,";")
If InStr(Agent(1),"MSIE")>0 Then
Browser="Internet Explorer "
version=Trim(Left(Replace(Agent(1),"MSIE",""),6))
ElseIf InStr(Agent1(2),"Chrome")>0 Then
Browser="Google Chrome "
tmpstr=Split(Agent(3),"/")
version=tmpstr(UBound(tmpstr))
ElseIf InStr(Agent(4),"Netscape")>0 Then
Browser="Netscape "
tmpstr=Split(Agent1(4),"/")
version=tmpstr(UBound(tmpstr))
ElseIf InStr(Agent(4),"rv:")>0 Then
Browser="Mozilla "
tmpstr=Split(Agent(4),":")
version=tmpstr(UBound(tmpstr))
If InStr(version,")") > 0 Then
tmpstr=Split(version,")")
version=tmpstr(0)
End If
-----------
179行是 If InStr(Agent(1),"MSIE")>0 Then 展开
下标越界: '[number: 1]'
/bbs/Default.asp,行 179
然后具体是
<%
Class Cls_Browser
Public Browser,version,platform,IsSearch
Private Sub Class_Initialize()
Dim Agent,Tmpstr,Agent1
Agent=Request.ServerVariables("HTTP_USER_AGENT")
Agent1=Request.ServerVariables("HTTP_USER_AGENT")
Agent1=Split(Agent1,"/")
'Agent="Opera/7.23 (X11; Linux i686; U) [en]"
If Left(Agent,7) ="Mozilla" Then
Agent=Split(Agent,";")
If InStr(Agent(1),"MSIE")>0 Then
Browser="Internet Explorer "
version=Trim(Left(Replace(Agent(1),"MSIE",""),6))
ElseIf InStr(Agent1(2),"Chrome")>0 Then
Browser="Google Chrome "
tmpstr=Split(Agent(3),"/")
version=tmpstr(UBound(tmpstr))
ElseIf InStr(Agent(4),"Netscape")>0 Then
Browser="Netscape "
tmpstr=Split(Agent1(4),"/")
version=tmpstr(UBound(tmpstr))
ElseIf InStr(Agent(4),"rv:")>0 Then
Browser="Mozilla "
tmpstr=Split(Agent(4),":")
version=tmpstr(UBound(tmpstr))
If InStr(version,")") > 0 Then
tmpstr=Split(version,")")
version=tmpstr(0)
End If
-----------
179行是 If InStr(Agent(1),"MSIE")>0 Then 展开
1个回答
展开全部
晕,你这代码本身就有错,你的Agent到底是个什么东西?是个文本格式的东西?还是数组?
我想If InStr(Agent(1),"MSIE")>0 Then这个代码应该写为
If InStr(Agent1(1),"MSIE")>0 Then吧,,,Agent1才是数组
我想If InStr(Agent(1),"MSIE")>0 Then这个代码应该写为
If InStr(Agent1(1),"MSIE")>0 Then吧,,,Agent1才是数组
追问
谢谢啊,其实我完全看不懂,论坛是10多年前的……那时候还没有win7系统的……所以以前的xp用着没问题……现在各种问题……我也是隔了快10年才又上传的,其实我之前自己像你这样改了……我其实是猜的,当时没看到您的留言,然后电脑显示正常了,手机显示还是提示有代码错误……我就没管了……也谢谢啊
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询