Results 1 to 3 of 3

Thread: Posting to webpages with VB?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    30

    Posting to webpages with VB?

    Hello everyone! New guy here :-)

    I'm not the best with VB but I do have a bit of experience over the years with it. I hope this doesn't sound too simple!

    I am attempting to make a simple program that helps a user keep up with posts they make to a message forum (ironically).

    From within the program itself, I would like to add the option for the user to post a message directly to the website. However, it doesn't seem very easy. When I click on the post button on the website (manually in internet explorer to see how it posts), it seems to be written in Java (or something else for that matter, please excuse my ignorance) but the point is that it doesnt post to the website in your typical:

    www .website .com/newpost.php?post=hello%20world&user=Josh

    kind of way.

    So therefore, I cannot use the webbrowser tool within VB to make it put what they are posting from VB's textbox, etc. I would like something as simple as:
    VB Code:
    1. web.navigate "http://www.website.com/newpost.php?post=TEXT1.TEXTuser=VBUSER" (assuming no spaces, etc in text1 for now)
    as mentioned above, but obviously I don't think I will be able to do this.

    Anyone ever ran into anything like this? I hope I have explained it well.

    Thank you guys for any input.

    -Josh
    Nashville, TN

  2. #2
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Re: Posting to webpages with VB?

    Perhaps you're better off programmatically using the UI (i.e. clicking the button through code). Then you can let the actual posting be done by the site itself. To click a button use something along these lines; it makes use of the HTML Document Object Model.
    VB Code:
    1. WebBrowser1.Document.getElementsByTagName("button").item(0).Click
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  3. #3
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Posting to webpages with VB?

    It should be:
    VB Code:
    1. web.navigate2 "http://www.website.com/newpost.php?post=" & Text1.Text & "&user=" & txtUser.Text
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

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