Results 1 to 3 of 3

Thread: Setting a file to upload inside the WebBrowser component

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2009
    Posts
    20

    Setting a file to upload inside the WebBrowser component

    im using a loop to enter text into text boxes using the following:

    Code:
    Private Sub FillTextbox(ByVal sElement As String, ByVal sString As String)
            Dim z As Integer = 0
    
            While Not SiteIsLoaded
                Application.DoEvents()
            End While
    
                For Each Form As HtmlElement In webby.Document.Forms
                    Dim el2 As HtmlElementCollection = webby.Document.Forms(z).GetElementsByTagName("input")
                    For Each curElement As HtmlElement In el2
                        Dim ControlName As String = curElement.GetAttribute("name").ToString
                        If ControlName = sElement Then  'Add
                            curElement.InnerText = sString
                        End If
                    Next
                    z = z + 1
                Next
    
        End Sub
    But i have a file property, the website has the following code

    <input type="file" size="30" name="torrent" id="torrent"/>

    How can i use a loop similar to above to insert the filename
    Last edited by stewmath; May 13th, 2011 at 10:27 AM. Reason: Better Title

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width