how to execute aspx page using VB

hai there,

i have a problem on how do i write a VB application to open an IE with specific page like (http://202.176.45.9:8001/sendsms.aspx user=testuser&to=012&server=10) then close the ie.

or is there a way to execute the aspx page without even open the ie.

can anyone help me out here.

Thanks.



Answer this question

how to execute aspx page using VB

  • Celal Ak


    In addition to Geoff's suggestion you can also use the WebRequest class.

  • donaldi

    Hi,

    You've got a few different options, depending on what you need to do. Do you need someone to do something with the page once it's loaded (Like, based on your sample url, fill in the text for a text message ). If so, then you either need to spawn an IE page like you asked, or you could embed the webbrowser control onto your form, which is an IE window that lives on your own window :)

    To start an IE instance (whatever browser happens to be the default browser) do something like this

    System.Diagnostics.Process.Start("http://your url")

    This will start IE directly to that page.

    If the page doesn't even need to be displayed, you just need the url hit to make something happen, then you can use the webclient.

    Dim oWebClient As New System.Net.WebClient()

    Dim oStream As System.IO.Stream = oWebClient.OpenRead("http://www.google.com")

    Dim oBuffer(1024) As Byte

    Do While oStream.Read(oBuffer, 0, 1024) > 0

    Continue Do

    Loop

    oStream.Close()

    Hope this helps

    --Geoff



  • Dave McPherson

    hi,

    actually i don't need the page to be loaded, so i tried the webclient but how do i know if there's any error or the page executed correctly. is there a way to get response from the page once the link executed. since manually if we open page in ie with correct parameters, it only display text message SUCCESS. if the wrong parameters provided the page should wont load except the page not found loaded.


  • how to execute aspx page using VB