VB如何提取htm代码中固定的字符串

来源:百度知道 编辑:UC知道 时间:2024/05/12 09:18:24
","tianjia");</script>
<script>o2(181396,"http:\/\/www.7haosf.com","帝国英雄","121.10.104.174","2007年/4月/17日/22点开放","中国电信","仿盛大1.85新地图","家族上送记忆","0","219.146.155.147 ","xiugai");</script>
<script>o2(181387,"http:\/\/sh.4546uc.com","袁京是玻璃","59.34.216.148","2007年/4月/17日/22点开放","中国电信","仿盛大1.85爽死","家族送记忆","0","219.146.155.147

Private Sub Command1_Click()
Dim TempLine As String
Dim StartPos As Long, EndPos As Long
Open "D:\a.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, TempLine
StartPos = InStr(TempLine, "http")
If StartPos > 0 Then
EndPos = InStr(StartPos, TempLine, ",")
If EndPos > 0 Then
EndPos = InStr(EndPos + 1, TempLine, ",")
If EndPos > 0 Then
List1.AddItem Mid(TempLine, StartPos, EndPos - StartPos - 1)
End If
End If
End If
Loop
Close #1
End Sub