S
SuKiDelphi
Unregistered / Unconfirmed
GUEST, unregistred user!
取网页中部分内容的函数(VB 转 DELPHI 的也可以)<br><br> Function GetBody(ByVal constr, ByVal StartStr, ByVal OverStr, ByVal IncluL, ByVal IncluR)<br> If constr = "$False$" Or constr = "" Or IsDBNull(constr) = True Or StartStr = "" Or IsDBNull(StartStr) = True Or OverStr = "" Or IsDBNull(OverStr) = True Then<br> GetBody = "$False$"<br> Exit Function<br> End If<br> Dim ConStrTemp<br> Dim Start, Over<br> ConStrTemp = LCase(constr)<br> StartStr = LCase(StartStr)<br> OverStr = LCase(OverStr)<br> Start = InStr(1, ConStrTemp, StartStr, vbBinaryCompare)<br> If Start <= 0 Then<br> GetBody = "$False$"<br> Exit Function<br> Else<br> If IncluL = False Then<br> Start = Start + Len(StartStr)<br> End If<br> End If<br> Over = InStr(Start, ConStrTemp, OverStr, vbBinaryCompare)<br> If Over <= 0 Or Over <= Start Then<br> GetBody = "$False$"<br> Exit Function<br> Else<br> If IncluR = True Then<br> Over = Over + Len(OverStr)<br> End If<br> End If<br> GetBody = Mid(constr, Start, Over - Start)<br> End Function