Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Easy VB6 to VB.NET conversion help please

Posted on 2004-10-29
Medium Priority
Last Modified: 2010-04-23
I'm trying to make a small app that has a browser window and a button on a form that will load a webform at www.ASpecificForm.com\form1.asp and fill in the textboxes on the form with data I already have.
The purpose is so that I don't have to enter in the same data twice.
ie: I enter in the customer information into my own database, then I have to navigate to the webform at www.this1website.com\form1.asp and re-type it again just to get the customer info into the web form so that I can submit it via the Submit button on the webform itself.

I want a way to auto load as much info as I can into the form to save some time. I'm using the same form over and over on a daily basis....
I have some code that I think might work but I don't have vb6..only vb.net.
Can someone help me translate it into VB.NET or give me a better Idea how to do it. I've already checked with the company and they dont' offer any type of web service to send data to.

 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       WebBrowser1.Navigate2("www.this1website.com\form1.asp ")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If WebBrowser1.Busy Then
            Exit Sub
            WebBrowser1.Document.all("app_first_name").value = "MY FIRST NAME"
            WebBrowser1.Document.all("app_last_name").value = "LAST NAME"
            'etc etc for other fields
            'app_first_name is the input name. ie: <input type=text  name="app_first_name">

            'submit the form by clicking the submit button on the webform itself
        End If
    End Sub
**************END CODE*******************
Question by:Matrix1000
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 70

Accepted Solution

Éric Moreau earned 2000 total points
ID: 12452167
It is much the same.

Have you found the Web Browser control in VB.Net? See http://support.microsoft.com/default.aspx?scid=kb;en-us;821771

I did much the same yesterday:

    Private mblnDownloadCompleted As Boolean

    Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
        mblnDownloadCompleted = False
        With AxWebBrowser1
            Do While Not mblnDownloadCompleted
            .Document.All("app_first_name").Value = "MY FIRST NAME"
            .Document.All("app_last_name").Value = "LAST NAME"

            mblnDownloadCompleted = False
            Do While Not mblnDownloadCompleted
        End With
    End Sub

    Private Sub AxWebBrowser1_DocumentComplete(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles AxWebBrowser1.DocumentComplete
        mblnDownloadCompleted = True
    End Sub

Author Comment

ID: 12475594

One question, how would I send that to a specific frame...the site I'm working with has an upper navigation frame that contains a bunch of tabs and a the lower frame contains the actual form....

Thanks for any assistance.
LVL 70

Expert Comment

by:Éric Moreau
ID: 12475814
I don't know about the frame!

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question