Vb.net 从HTML源代码中查找HTML元素

Vb.net 从HTML源代码中查找HTML元素,vb.net,Vb.net,因此,我试图找到一个HTML元素,它是: <a class="signout" href="https://www.dreamstime.com/logout.php">Sign out</a> 我的代码是: Dim thepage As String = postreqreader.ReadToEnd If thepage.Contains("<a href="https: //www.dreamstime.com/log

因此,我试图找到一个HTML元素,它是:

<a class="signout" href="https://www.dreamstime.com/logout.php">Sign out</a>

我的代码是:

 Dim thepage As String = postreqreader.ReadToEnd

                If thepage.Contains("<a href="https: //www.dreamstime.com/logout.php" class="signout">Sign out</a>") Then
                    good += 1
                    Label2.Text = "Good: " & good.ToString

                    If pencil = False Then
                        TextBox1.Text += currentaccount & vbNewLine
                        Me.Refresh()
                    End If
Dim页面为String=postreqreader.ReadToEnd
如果页面包含(“”),则
良好+=1
Label2.Text=“Good:&Good.ToString
如果pencil=False,那么
TextBox1.Text+=currentaccount&vbNewLine
我
如果结束
但这种错误每次都会发生:

我试图删除空间,但它总是出现错误
应为逗号“)”或有效的表达式继续

您没有正确地避开引号。“A”=A,”=,“=”

或者让我们使用*以便更容易看到, *“*,首先*表示开始,然后”表示您的字符,然后是另一个*表示字符的结尾,*表示字符串的结尾

在较长的字符串中,如下所示:

"some string ""is"" here"
这导致:

这里有一些字符串“是”

您需要在字符串中使用双引号。因此
Dim s=“a”“b”
将导致s设置为
a“b
@Andrew Morton您能在我的代码中应用这个吗?我是vb.net新手,所以很难理解您的意思。它是这样的:
如果page.Contains(“”),那么
或者更简单的方法:
将ahref变为String=“”。替换(“”,Chr(34))
,然后
如果page.Contains(ahref)那么…
。。。不要在这么多双引号中“迷失”
Chr(34)
是双引号的ascii码。