VB问题,有关查找字符
有这样一段字符这是一个论坛版块的源码“<spanid="thread_105920"><ahref="thread-105920-1-1.html">发布n0steam联...
有这样一段字符
这是一个论坛版块的源码
“
<span id="thread_105920"><a href="thread-105920-1-1.html">发布n0steam联机+成就全解锁补丁!</a></span>
<span class="threadpages"> ... <a href="thread-105920-2-1.html">2</a> <a href="thread-105920-3-1.html">3</a> <a href="thread-105920-4-1.html">4</a> <a href="thread-105920-5-1.html">5</a> <a href="thread-105920-6-1.html">6</a> .. <a href="thread-105920-17-1.html">17</a> </span>
<a href="redirect.php?tid=105920&goto=newpost#newpost" class="new">New</a>
</th>
<td class="author">
<cite>
<a href="space-uid-31203.html">moyiwei</a>
</cite>
<em>2008-12-19</em>
</td>
<td class="nums"><strong>167</strong>/<em>5594</em></td>
<td class="lastpost">
<cite><a href="space-username-scout9595.html">scout9595</a></cite>
<em><a href="redirect.php?tid=105920&goto=lastpost#lastpost"><span title="2009-6-25 11:36">6 分钟前</span></a></em>
</td>
</tr>
</tbody><tbody id="normalthread_112471" >
<tr>
<td class="folder">
<a href="thread-112471-1-1.html" title="新窗口打开" target="_blank">
<img src="./images/default/folder_new.gif" alt="new" />
</a>
</td>
<td class="icon">
</td>
<th class="subject new">
<label>
</label>
<span id="thread_112471"><a href="thread-112471-1-1.html">告诉各位地图制作者一个好消息</a></span>
<a href="redirect.php?tid=112471&goto=newpost#newpost" class="new">New</a>
</th>
<td class="author">
<cite>
<a href="space-uid-39532.html">888</a>
</cite>
<em>2009-6-24</em>
</td>
<td class="nums"><strong>1</strong>/<em>35</em></td>
<td class="lastpost">
<cite><a href="space-username-moyiwei.html">moyiwei</a></cite>
<em><a href="redirect.php?tid=112471&goto=lastpost#lastpost"><span title="2009-6-25 09:28">2 小时前</span></a></em>
</td>
</tr>
</tbody><tbody id="normalthread_112381" >
<tr>
<td class="folder">
<a href="thread-112381-1-1.html" title="新窗口打开" target="_blank">
<img src="./images/default/folder_new.gif" alt="new" />
</a>
</td>
<td class="icon">
<img src="images/icons/icon12.gif" alt="Icon52" class="icon" /></td>
<th class="subject new">
<label>
</label>
”
如何把每个帖子的标题查找出来,并分别赋予a1,a2,a3,a4……an ? 展开
这是一个论坛版块的源码
“
<span id="thread_105920"><a href="thread-105920-1-1.html">发布n0steam联机+成就全解锁补丁!</a></span>
<span class="threadpages"> ... <a href="thread-105920-2-1.html">2</a> <a href="thread-105920-3-1.html">3</a> <a href="thread-105920-4-1.html">4</a> <a href="thread-105920-5-1.html">5</a> <a href="thread-105920-6-1.html">6</a> .. <a href="thread-105920-17-1.html">17</a> </span>
<a href="redirect.php?tid=105920&goto=newpost#newpost" class="new">New</a>
</th>
<td class="author">
<cite>
<a href="space-uid-31203.html">moyiwei</a>
</cite>
<em>2008-12-19</em>
</td>
<td class="nums"><strong>167</strong>/<em>5594</em></td>
<td class="lastpost">
<cite><a href="space-username-scout9595.html">scout9595</a></cite>
<em><a href="redirect.php?tid=105920&goto=lastpost#lastpost"><span title="2009-6-25 11:36">6 分钟前</span></a></em>
</td>
</tr>
</tbody><tbody id="normalthread_112471" >
<tr>
<td class="folder">
<a href="thread-112471-1-1.html" title="新窗口打开" target="_blank">
<img src="./images/default/folder_new.gif" alt="new" />
</a>
</td>
<td class="icon">
</td>
<th class="subject new">
<label>
</label>
<span id="thread_112471"><a href="thread-112471-1-1.html">告诉各位地图制作者一个好消息</a></span>
<a href="redirect.php?tid=112471&goto=newpost#newpost" class="new">New</a>
</th>
<td class="author">
<cite>
<a href="space-uid-39532.html">888</a>
</cite>
<em>2009-6-24</em>
</td>
<td class="nums"><strong>1</strong>/<em>35</em></td>
<td class="lastpost">
<cite><a href="space-username-moyiwei.html">moyiwei</a></cite>
<em><a href="redirect.php?tid=112471&goto=lastpost#lastpost"><span title="2009-6-25 09:28">2 小时前</span></a></em>
</td>
</tr>
</tbody><tbody id="normalthread_112381" >
<tr>
<td class="folder">
<a href="thread-112381-1-1.html" title="新窗口打开" target="_blank">
<img src="./images/default/folder_new.gif" alt="new" />
</a>
</td>
<td class="icon">
<img src="images/icons/icon12.gif" alt="Icon52" class="icon" /></td>
<th class="subject new">
<label>
</label>
”
如何把每个帖子的标题查找出来,并分别赋予a1,a2,a3,a4……an ? 展开
1个回答
展开全部
form加一个按钮,一个多行文本框,属性不用改
把上面的论坛代码复制到text里面,然后运行下面的代码就行了
Private Sub Command1_Click()
Dim a As Variant, i As Integer, j As Integer
If Len(Text1.Text) <> 0 Then
a = Split(Text1.Text, "</a></span>")
For i = LBound(a) To UBound(a)
j = InStrRev(a(i), ">")
a(i) = Right$(a(i), Len(a(i)) - j)
Print a(i)
Next i
End If
End Sub
================
结果如下
发布n0steam联机+成就全解锁补丁!
告诉各位地图制作者一个好消息
把上面的论坛代码复制到text里面,然后运行下面的代码就行了
Private Sub Command1_Click()
Dim a As Variant, i As Integer, j As Integer
If Len(Text1.Text) <> 0 Then
a = Split(Text1.Text, "</a></span>")
For i = LBound(a) To UBound(a)
j = InStrRev(a(i), ">")
a(i) = Right$(a(i), Len(a(i)) - j)
Print a(i)
Next i
End If
End Sub
================
结果如下
发布n0steam联机+成就全解锁补丁!
告诉各位地图制作者一个好消息
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询