c# WinForm WebBrowser 怎样获取页面JS弹出框的内容解决思路

c# WinForm WebBrowser 怎样获取页面JS弹出框的内容
我做了一个winForm 自动填写网页表单的程序并提交表单的程序,网页提交成功后会有JS提示“录入成功”,我想根据JS的提示再对本地数据库的数据进行操作,问题是WebBrowser 怎样获取页面JS弹出框的内容,有哪位大侠帮帮我啊!
------解决思路----------------------
可以通过FindWindowEx这个函数查找到弹出窗口,并获取窗口中的内容,从而知道是否“录入成功”,以下VB代码为我在另一程序中的,你参考下看是否有用:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer 

Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick 
       
        Dim hMyWindow As Integer 
        Dim hMyButton As Integer 
        Dim sss As String 
        Timer3.Enabled = False 
        If MyTry < 1 Then Exit Sub 
        MyTry = MyTry - 1 

        sss = New String("", 256) 

        hMyWindow = FindWindowEx(0, 0, Nothing, Nothing) 

        While hMyWindow 
            hMyButton = FindWindowEx(hMyWindow, 0&, "Static", Nothing) 
            While hMyButton 
                SendMessage(hMyButton, WM_GETTEXT, 256, sss) 
                If Mid(sss, 1, Len(MyMsgText)) = MyMsgText Then 

                    hMyButton = FindWindowEx(hMyWindow, 0&, "Button", "确定") 
                    While hMyButton 
                        SendMessage(hMyButton, WM_GETTEXT, 256, sss) 
                        If Mid(sss, 1, 2) = "确定" Then 

                            Select Case MyMsgText 
                                Case "监控删除设备的时候" 
                                    PostMessage(hMyButton, BM_CLICK, 0, 0) 
                                    MyStep = 1 
                                    Me.MyMsgText = "删除终端成功" 
                                    Me.MyTry = 3 
                                    Timer3.Enabled = True 
                                Case "删除终端成功" 
                                    PostMessage(hMyButton, BM_CLICK, 0, 0) 
                                    Timer3.Enabled = False 
                                    MyStep = 1 
                                Case "增加终端设备成功" 
                                    PostMessage(hMyButton, BM_CLICK, 0, 0) 
                                    Timer3.Enabled = False 
                                    MyStep = 2 
                                Case "修改终端设备成功" 
                                    PostMessage(hMyButton, BM_CLICK, 0, 0) 
                                    Timer3.Enabled = False 
                                    MyStep = 3 
                                Case Else 
                                    'PostMessage(hMyButton, BM_CLICK, 0, 0) 
                                    'Me.MyTry = 0 
                                    'MsgBox("oooo") 
                            End Select 

                        End If 
                        hMyButton = GetNextWindow(hMyButton, 2) 
                    End While 
                End If 
                hMyButton = GetNextWindow(hMyButton, 2) 

            End While 
            hMyWindow = FindWindowEx(0, hMyWindow, Nothing, Nothing) 
        End While 
        Timer3.Enabled = True 
        '也没有找到 

    End Sub