请高手帮忙解决,无效的过程调用或参数'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
%>