在操作时出现“截取列表时发生错误”,查询现有帖子,没有结果。特向高手求教,向能正常采集的先行者求教。
我在KS.CollectCls.asp中设置了断点和显示Response.Write,如下。
Function GetBody(Constr, StartStr, OverStr, IncluL, IncluR)
'Response.Write(Constr)
'Response.Write("<br>===================================================<br>")
Response.Write(server.htmlencode(StartStr))
Response.Write("<br>===================================================<br>")
Response.Write(server.htmlencode(OverStr))
Response.Write("<br>===================================================<br>")
Response.Write(IncluL)
If Constr = "Error" Or Constr = "" Or IsNull(Constr) = True Or StartStr = "" Or IsNull(StartStr) = True Or OverStr = "" Or IsNull(OverStr) = True Then
GetBody = "Error"
Exit Function
End If
Response.Write("<br>GetBody===================================================<br>")
Response.Write(GetBody)
Dim ConstrTemp
Dim Start, Over
ConstrTemp = LCase(Constr)
StartStr = LCase(StartStr)
OverStr = LCase(OverStr)
Start = InStrB(1, ConstrTemp, StartStr, vbBinaryCompare)
Response.Write("<br>Start===================================================<br>")
Response.Write(Start)
Response.Write("<br>ConstrTemp===================================================<br>")
Response.Write(ConstrTemp)
Response.Write("<br>Start===================================================<br>")
Response.Write(GetBody)
Response.Write("<br>Start===================================================<br>")
Response.Write(GetBody)
Response.End()
If Start <= 0 Then
GetBody = "Error"
Exit Function
Else
If IncluL = False Then
Start = Start + LenB(StartStr)
End If
End If
Response.Write("<br>Start===================================================<br>")
Response.Write(GetBody)
Over = InStrB(Start, ConstrTemp, OverStr, vbBinaryCompare)
If Over <= 0 Or Over <= Start Then
GetBody = "Error"
Exit Function
Else
If IncluR = True Then
Over = Over + LenB(OverStr)
End If
End If
Response.Write("<br>Over===================================================<br>")
Response.Write(GetBody)
Response.End()
GetBody = MidB(Constr, Start, Over - Start)
End Function
[此贴子已经被作者于2007-10-6 21:53:19编辑过]