如何检查返回值是否为null vb.net

时间:2017-06-10 10:16:41

标签: vb.net

我开始创建一个自动按下我的网页上的按钮的应用程序 它的工作完美的代码,但我如何检查返回值是否为null? 这是我的代码

Public Class Form5
Dim CheckButton, skip_button As HtmlElement
Private Sub Form5_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
    skip_button = WebBrowser1.Document.GetElementById("skip_button")
    CheckButton = WebBrowser1.Document.GetElementById("skip_button")

    skip_button.InnerText = "skip_button" 'Replace testID by the ID you want


End Sub
End Class

1 个答案:

答案 0 :(得分:0)

您可以查看GetElementById的结果,如下所示:

 FRM_RECEIPTS frm = new FRM_RECEIPTS();
 FRM_RECEIPTS.getMainForm.dgvRecipts.DataSource = null;
 FRM_RECEIPTS.getMainForm.dgvRecipts.DataSource = receipt.SearchRecepits(frm.txtSearch.Text, frm.coBoxState.Text);