Results 1 to 2 of 2

Thread: Control data filled in a form inside a Web Browser control

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    9

    Control data filled in a form inside a Web Browser control

    Hi,

    I've to control the user input to a html form in one webbroser inside my VB.NET code, is there a way of do this? I need to retrieve the data when it's submited if posible.

    Thanks.

  2. #2
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Control data filled in a form inside a Web Browser control

    Quote Originally Posted by Angel@dot-q
    Hi,

    I've to control the user input to a html form in one webbroser inside my VB.NET code, is there a way of do this? I need to retrieve the data when it's submited if posible.

    Thanks.
    I dont think you can do it with that control, however you can do it with the netclient control

    You need to create the array of fields (the form)
    upload it and retrieve the bytes returned.
    Then convert those bytes into text to view the html page returned.

    VB Code:
    1. Dim netc As New Net.WebClient
    2. Dim vals As New Specialized.NameValueCollection
    3. vals.Add("name", "phill") 'add a field to be uploaded
    4. Dim rdata() As Byte = netc.UploadValues("http://here.com/there.asp",vals) 'upload form and retrieve bytes back
    5. Dim sdata As String = System.Text.Encoding.ASCII.GetString(rdata).ToString 'convert bytes into text

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