[RESOLVED] Pass Inputbox data to end of URL string-VBForums
Results 1 to 2 of 2

Thread: [RESOLVED] Pass Inputbox data to end of URL string

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    2

    Resolved [RESOLVED] Pass Inputbox data to end of URL string

    Hey guys I'm new here, and I've searched for this, but didn't see any posts.

    In my vb windows app, I'm trying to take a simple inputbox and pass the input data to the end of a url string.

    Example -

    Inputbox displays when user selects menu option

    Inputbox displays "enter username"

    User enters a username and the input box passes this data to the end of a URL string opened in browser window (via WebBrowser1.Navigate?).

    So, user enters "Bob" as username, and the application is supposed to open the URL with the userinfo at the end. for example -

    http://privateurl.com/users/Bob

    So far I've managed to create this -

    Dim fname
    fname = InputBox("Enter UserName")
    Dim wsh As Object = CreateObject("WScript.Shell")
    wsh = CreateObject("WScript.Shell")
    wsh.Run (Chr(34) & "http://privateurl.com/users/" & fname & Chr(34))

    This actually works... sort of... it 404's the application browser window (WebBrowser1), but opens a seperate IE browser window and goes to the proper URL. I feel like I'm so close! Any help is appreciated guys. Thanks!

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    2

    Re: Pass Inputbox data to end of URL string

    I figured it out. It looks like I had a bunch of unnecessary code in there with respect to wsh. For others trying to do this, the correct code would be -

    Private Sub
    Dim fname
    fname = InputBox("Enter UserName")
    WebBrowser1.Navigate("http://privateurl.com/users/" & fname)
    End Sub

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.