| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 490 人关注过本帖
标题:请高手帮忙解决,无效的过程调用或参数'MID'
取消只看楼主 加入收藏
koow
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2010-5-24
收藏
 问题点数:0 回复次数:1 
请高手帮忙解决,无效的过程调用或参数'MID'
图片附件: 游客没有浏览图片的权限,请 登录注册


打开网页经常出现以上情况,,,,
Bet007LiveData.asp 是我的一足球自己更新比分的页面,,调用的是 通过下面的源码希望懂的人帮了解决一下,非常感谢

<%
 '===============================================
   '函数名:GetHttpPage
   '作  用:获取网页源码
   '参  数:HttpUrl 网页地址,Cset 编码
   '===============================================
   Function GetHttpPage(ByVal URL, ByVal Cset)
    Dim BlockStartTime
    On Error Resume Next
    Dim Http
     If IsNull(URL)=True Or Len(URL)<18 Or URL="" Then
          GetHttpPage=""
          Exit Function
       End If
       BlockStartTime = Timer()
       Set Http=server.createobject("MSXML2.XMLHTTP")
       Http.open "GET",URL,False
       Http.Send()
      '循环等待数据接收
       Dim temp,BlockTimeout        
       BlockTimeout = 64
       While (http.ReadyState <> 4)
          ' 判断是否块超时
           temp = Timer() - BlockStartTime
           Response.Write(Timer())
           If (temp > BlockTimeout) Then
               http.abort
               Set Http=Nothing
               GetHttpPage=""
               Exit function
               Response.End
           End If
           http.waitForResponse 10000'等待1000毫秒
       Wend
       If Http.Readystate<>4 then
          Set Http=Nothing
          GetHttpPage=""
          Exit function
       End if
       GetHTTPPage=bytesToBSTR(Http.responseBody,Cset)
       Set Http=Nothing
       If Err.number<>0 then
          If IsNull(URL)=True Or Len(URL)<18 Or URL="" Then
          GetHttpPage=""
          Exit Function
       End If
       Set Http=Nothing
          Err.Clear
       End If
   End Function
   '===============================================
   '函数名:BytesToBstr
   '作  用:将获取的源码转换为中文
   '参  数:Body 要转换的变量
   '参  数:Cset 要转换的类型
   '===============================================
    Function BytesToBstr(Body,Cset)
        Dim Objstream
        Set Objstream = Server.CreateObject("adodb.stream")
        objstream.Type = 1
        objstream.Mode =3
        objstream.Open
        objstream.Write body
        objstream.Position = 0
        objstream.Type = 2
        objstream.Charset = Cset
        BytesToBstr = objstream.ReadText
        objstream.Close
        set objstream = nothing
    End Function

    Function GetLiveData
        'On Error Resume Next
        Dim LiveStr,patrn,TempStr,LiveDataAry()
        
        LiveStr = GetHttpPage("http://live.,"GB2312")
        sLet=InStr(LiveStr, "A[1]=""") '取得开头数据
        eLet=InStr(LiveStr, "B[1]=""")
        
        TempStr = Mid(LiveStr,sLet,(eLet-sLet)) '取得结尾数据
        
        Dim regEx, Matche, Matches      ' 创建变量。
        Set regEx = New RegExp         ' 创建正则表达式。
        regEx.Pattern = "=""(\d+)\^(.*)"""          ' 设置模式。
        regEx.IgnoreCase = True         ' 设置为不区分大小写。
        regEx.Global = True         ' 设置全局适用。
        Set Matches = regEx.Execute(TempStr)   ' 执行搜索。
        
        '0为ID,
        '1为联赛原色
        '2为简体中文联赛名称
        '3为繁体中文联赛名称
        '4为英文联赛名称
        '5为简体主队名称
        '6为繁体主队名称
        '7为英文主队名称
        '8为简体客队名称
        '9为繁体客队名称
        '10为英文客队名称
        '11开赛时间
        '12
        '13赛事状态 0 未开赛,1 上半场,2 中场,3 下半场,-1 完场,-11 待定,-12 腰斩,-13 中断,-14 推迟,
        '14 主队进球
        '15 客队进球
        '16 半场主队进球
        '17 半场客队进球
        '18 主队红牌数
        '19 客队红牌数
        '20 主队黄牌数
        '21 客队黄牌数
        '22
        '23
        '24
        '25
        '26 电视转播
        '27 1 阵容
        '28 True 走地
        '29
        '
        '
        
        Dim i
        i = 0
        For Each Matche in Matches      ' 对 Matches 集合进行迭代。
            Dim temp1,temp2,temp3
            temp1 = Matche.Value
            
            temp1 = Left(temp1,len(temp1)-1)
            temp1 = Right(temp1,len(temp1)-2)
            temp2 = Split(temp1,"^")
            
            Redim Preserve LiveDataAry(i)
            LiveDataAry(i) = temp2
            i = i + 1
        Next
'--------------------------------'
'Dim j
'Response.Write("<table border='1'>")
'For Each j In LiveDataAry
'Response.Write("<tr>")
'Response.Write(" <td> " & j(0) & "</td>")
'Response.Write(" <td bgcolor='" & j(1) & "'> " & j(3) & "</td>")
'Response.Write(" <td> " & j(11) & "</td>")
'Response.Write(" <td> " & j(6) & "</td>")
'Response.Write(" <td> " & j(14)&":"& j(15) & "</td>")
'Response.Write(" <td> " & j(16)&":"& j(17) & "</td>")
'Response.Write(" <td> " & j(9) & "</td>")
'Response.Write(" <td> " & j(13) & "</td>")
'Response.Write("<tr>")
'Next
'Response.Write("</table>")
'---------------------------------'

        GetLiveData = LiveDataAry
        If err Then
            Response.Write(err.Description & "</br>")
            err.Clear
        End if   
    End Function
   
    Function UpdateLiveID
        'On Error Resume Next
        LiveAry = GetLiveData
        
        Dim sRs,SqlStr,UTime,DTime,i,LiveEle
        UTime = DateAdd("h",12,Now())
        DTime = DateAdd("h",-12,Now())
        SqlStr = "SELECT * FROM [MatchAdvice] WHERE ([FixType] IN(2,3,4)) AND ([MatchResult] = 0 ) AND ([MatchTime] BETWEEN #"&DTime&"# AND #"&UTime&"#)"
        Set sRs=Server.CreateObject("adodb.recordset")
        sRs.open SqlStr,conn, 1,3, 1

        sRs.MoveFirst
        If sRs.RecordCount > 0 Then
            While Not sRs.EOF
                If IsNull(sRs("LiveID")) Or (Len(Trim(sRs("LiveID"))) < 1)Then
                    For Each LiveEle In LiveAry
                        If (InStr(1,LiveEle(5) & LiveEle(6) & LiveEle(8) & LiveEle(9),Trim(sRs("UpTeam"))) > 0) And (InStr(1,LiveEle(5) & LiveEle(6) & LiveEle(8) & LiveEle(9),Trim(sRs("DownTeam"))) > 0) Then
                            sRs("LiveID") = CStr(LiveEle(0))
                            sRs("LiveInfo") =LiveEle(3) & LiveEle(6) & "VS" & LiveEle(9)
                            sRs.Update

                        End If
                    Next
                End If
                sRs.MoveNext
            Wend        
        End If
        sRs.Close
        Set sRs = Nothing

        If err Then
            Response.Write(err.Description & "</br>")
            err.Clear
        End if
    End Function
   
    Function LiveUpdateMatch
        If Not IsArray(LiveDataArr) Then
            LiveDataArr = GetLiveData
        End If
        'On Error Resume Next
        
        Dim sRs,SqlStr,UTime,DTime,i,odds,TestRes,TempFixType,TempLiveID,LiveEle
        UTime = DateAdd("h",0,Now())
        DTime = DateAdd("h",-24,Now())
        SqlStr = "SELECT * FROM [MatchAdvice] WHERE ([FixType] IN(2,3,4)) AND ([MatchResult] = 0) AND ([MatchTime] BETWEEN #"&DTime&"# AND #"&UTime&"#)"
        
        Set sRs=Server.CreateObject("Adodb.RecordSet")
        sRs.open SqlStr,conn, 1,3, 1
        If Not sRs.Bof Then
            sRs.MoveFirst
        End If
        
        If sRs.RecordCount > 0 Then
        
            While Not sRs.EOF
            
                odds = sRs("AmNo")
                TempFixType = sRs("FixType")
                TempLiveID = CDbl(sRs("LiveID"))
                If TempLiveID > 1 Then         
                    
                    For Each LiveEle In LiveDataArr
                        If CDbl(LiveEle(0)) = TempLiveID Then '用LiveID查找对应比分
                                
                            If CInt(LiveEle(13)) = -1 Then '比赛已经完场
                                If sRs("HToC") = 0 Then '更新完场比分
                                    sRs("MatchScore") = LiveEle(14) & "-" & LiveEle(15)
                                Else
                                    sRs("MatchScore") = LiveEle(15) & "-" & LiveEle(14)
                                End If
                                If (TempFixType = 2) And (sRs("AdviceTeam") > 0) Then '半场开赛
                                    If sRs("HToC") = 0 Then
                                        TestRes = Dealodds(LiveEle(14),LiveEle(15),sRs("AdviceTeam"),odds)
                                    Else
                                        TestRes = Dealodds(LiveEle(15),LiveEle(14),sRs("AdviceTeam"),odds)
                                    End If
                                ElseIf (TempFixType = 4) And (sRs("AdviceTeam") > 0)  Then '手动推介完成判断
                                    If sRs("HToC") = 0 Then
                                        TestRes = Dealodds(LiveEle(14),LiveEle(15),sRs("AdviceTeam"),odds)
                                    Else
                                        TestRes = Dealodds(LiveEle(15),LiveEle(14),sRs("AdviceTeam"),odds)
                                    End If
                                ElseIf (TempFixType = 2) Or (TempFixType = 3) Or (TempFixType = 4) Then '完场开赛
                                    sRs("ShowTime")= Now()
                                    If sRs("HToC") = 0 Then
                                        TestRes = Dealodds(LiveEle(14),LiveEle(15),1,odds)
                                    Else
                                        TestRes = Dealodds(LiveEle(15),LiveEle(14),1,odds)
                                    End If
                                    If TestRes < 3 Then
                                        sRs("AdviceTeam") = 1
                                    Else
                                        sRs("AdviceTeam") = 2
                                        If sRs("HToC") = 0 Then
                                            TestRes = Dealodds(LiveEle(14),LiveEle(15),2,odds)
                                        Else
                                            TestRes = Dealodds(LiveEle(15),LiveEle(14),2,odds)
                                        End If
                                    End If
                                End If
                                sRs("MatchResult") = TestRes
                            ElseIf (CInt(LiveEle(13)) = 2 Or CInt(LiveEle(13)) = 3) And (TempFixType = 2) And  (sRs("AdviceTeam") = 0) Then'比赛在下半场,中场,且为半场比分推介
                                sRs("ShowTime")= Now()
                                If sRs("HToC") = 0 Then
                                    TestRes = Dealodds(LiveEle(14),LiveEle(15),1,odds)
                                Else
                                    TestRes = Dealodds(LiveEle(15),LiveEle(14),1,odds)
                                End If
   
                                If TestRes < 3 Then
                                    sRs("AdviceTeam") = 1
                                Else
                                    sRs("AdviceTeam") = 2
                                End If
                            ElseIf Cint(LiveEle(13)) = -12 Or Cint(LiveEle(13)) = -13 Or Cint(LiveEle(13)) = -14 Then '比赛中断,推迟,延时
                                sRs("MatchResult") = 1
                                sRs("AdviceRemark") = "比赛已经由于异常原因已经中断,此推介取消!"
                            End If
                            sRs.Update
                        End If
                    Next
                End If
                sRs.MoveNext
            Wend
        End If

        sRs.Close
        Set sRs = Nothing
        
        If err Then
            Response.Write(err.Description & "</br>")
            err.Clear
        End if
    End Function
   
%>
搜索更多相关主题的帖子: MID 参数 
2010-05-24 00:27
koow
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2010-5-24
收藏
得分:0 
出错的就是
 Function GetLiveData
        'On Error Resume Next
        Dim LiveStr,patrn,TempStr,LiveDataAry()
        
        LiveStr = GetHttpPage("http://live.,"GB2312")
        sLet=InStr(LiveStr, "A[1]=""") '取得开头数据
        eLet=InStr(LiveStr, "B[1]=""")
        
        TempStr = Mid(LiveStr,sLet,(eLet-sLet)) '取得结尾数据
        
        Dim regEx, Matche, Matches      ' 创建变量。
        Set regEx = New RegExp         ' 创建正则表达式。
        regEx.Pattern = "=""(\d+)\^(.*)"""          ' 设置模式。
        regEx.IgnoreCase = True         ' 设置为不区分大小写。
        regEx.Global = True         ' 设置全局适用。
        Set Matches = regEx.Execute(TempStr)   ' 执行搜索。


http://live.这个文件的源程序是。。


var A=Array(230);
var B=Array(81);
var C=Array(40);
var matchcount=229;
var sclasscount=80;
var matchdate="05月23日"
A[1]="274725^#3a794e^欧青U21^歐青U21^UEFA  U21 CP^爱沙尼亚U21^愛沙尼亞U21^Estonia U21^土耳其U21^土耳其U21^Turkey U21^22:00^2010,4,23,23,00,17^3^1^0^1^0^0^0^0^0^^^1^2^^^True^-0.5^先开球(土耳其U21)^/cup_match/2009-2011/cupmatch_vs/cupmatch_114.htm^^^^^5-23^871^852^^53^0".split('^');
A[2]="396725^#FFCC00^比乙附^比乙附^BEL D2off^隆姆^KVSK 隆姆^United Overpelt-Lommel^罗斯勒^羅斯勒^Roeselare^22:00^2010,4,23,23,00,26^3^4^1^1^1^0^0^0^0^2^22^1^2^^^True^-0.25^^/league_match/league_vs/2009-2010/138.htm^^^^^5-23^2607^1315^^9^0".split('^');
A[3]="396726^#FFCC00^比乙附^比乙附^BEL D2off^欧本^歐本^Eupen^蒙斯^蒙斯^RAEC Mons^22:00^2010,4,23,23,07,39^3^2^1^2^0^0^0^0^0^4^3^1^2^^^True^0.25^^/league_match/league_vs/2009-2010/138.htm^^^^^5-23^1316^161^^9^0".split('^');

A[229]="384625^#3a794e^欧青U19^歐青U19^UEFA U19^俄罗斯U19^俄羅斯U19^Russia U19^捷克U19^捷克U19^Czech Republic U19^21:05^2010,4,23,22,07,45^-1^3^3^2^2^0^0^0^0^^^1^0^^^True^0.5^^/cup_match/2009-2010/cupmatch_vs/cupmatch_215.htm^^^^^5-23^2316^2309^^53^0".split('^');
B[1]="意丙附^意丙附^ITA PO^2^376^0^0^0".split('^');
B[2]="意乙^意乙^ITA D2^1^40^1^0^0".split('^');
B[3]="皇后杯^皇后盃^S Q C^2^684^0^0^0".split('^');
B[4]="西丙附^西丙附^SPA  PO^2^660^0^0^0".split('^');
B[5]="西室內附^西室內附^SPA FDH PO^2^818^0^0^0".split('^');
B[6]="西乙^西乙^SPA D2^1^33^1^0^0".split('^');
ShowBf();
2010-05-24 00:29
快速回复:请高手帮忙解决,无效的过程调用或参数'MID'
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022292 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved