How can I launch internet explorer in Visual Studio 2005, using VB language?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Faez
    New Member
    • Oct 2006
    • 10

    How can I launch internet explorer in Visual Studio 2005, using VB language?

    Dear sir/madam,

    As part of my project, I need to send queries from my website to Google search engine. The query needs to be send directly to the URL.
    Thus, need to launch internet explore from visual studio 2005 (web development).

    i have used the following Shell command, which is not working;

    Dim IE
    IE = Shell("C:\progr am Files\internet explorer\iexplo re.exe http://www.google.co.u k/search?" + TxtWebSearch.te xt, 1)

    * TxtWebSearch is the name of the text box; where i would be typing in my query.

    Please note that the above code works well in visual basic 6.0

    If possible, could you please advice me,
    Many thanks.
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    Use System.Diagnost ics.Process("ie xplore.exe");

    Comment

    • Faez
      New Member
      • Oct 2006
      • 10

      #3
      Thank you,

      I have used the above code, but not successful; the code was accepted (no error showing) however at run time it did not open an Internet Explorer. I have also tried the following code:

      System.Diagnost ics.Process("ie xplore.exe http://www.google.co.u k/search?" + TxtWebSearch.te xt, 1);

      *It is essential for me to have the ‘TxtWebSearch.t ext’ as I want to send queries to Google via URL (Internet Explorer address box)

      Could you please advice me if I need to add anything in the beginning of this code or if I am missing syntax.

      Many Thanks,

      Comment

      • anaphaxeon
        New Member
        • Oct 2006
        • 30

        #4
        System.Diagnost ics.Process.Sta rt("iexplore.ex e","url here")

        I've never tried in VB but if you try to stick the url next to the iexplore.exe, it will puke. The syntax is System.Diagnost ics.Process.Sta rt(<path to executable>, <parameters>) .

        Comment

        • Faez
          New Member
          • Oct 2006
          • 10

          #5
          Thank you very much, your support is most appreciated.

          i can now open a new internet explore, however, i cannot add the content in the text box, as the system does not add (recognise) the <+ "TextBox1.Text" > to the code, thus, nothing happens; the content of the text box is not added to the URL address.

          System.Diagnost ics.Process.Sta rt("iexplore.ex e", "http://www.google.co.u k/search?" + "TextBox1.Text" )


          i have tried the following codes , but it didn't work

          System.Diagnost ics.Process.Sta rt("iexplore.ex e", "http://www.google.co.u k/search? + TextBox1.Text")

          System.Diagnost ics.Process.Sta rt("iexplore.ex e", "http://www.google.co.u k/search?", "TextBox1.Text" )


          if possible, could you please advice me.

          Comment

          Working...