Go to website in c++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lumpybanana247
    New Member
    • Apr 2007
    • 134

    Go to website in c++

    how could you make the program go to a website like google.com?
    i dont care if it opens it in the default browser or if you have to type it in, just somehow open a webpage.
    i tried to make the program create a .URL and the run that w/ System(); but that didnt work.
    is there a way to do it (if so, how)

    thanks
    -nate
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Hi,
    Do u want to open the internet explorer window with a specified address from ur c++ program?
    If yes the the use system command and pass this argument to it
    [code=c]
    system("iexplor e www.thescripts. com");
    [/code]

    This will work for you.
    Raghuram

    Comment

    • lumpybanana247
      New Member
      • Apr 2007
      • 134

      #3
      Originally posted by gpraghuram
      Hi,
      Do u want to open the internet explorer window with a specified address from ur c++ program?
      If yes the the use system command and pass this argument to it
      [code=c]
      system("iexplor e www.thescripts. com");
      [/code]

      This will work for you.
      Raghuram

      i tried that and what i got was a blank cmd window for a split second- then nothing happend. im using windows xp if that makes a difference

      thanks

      ps "iexplore" is not in my WINDOWS folder.

      Comment

      • lumpybanana247
        New Member
        • Apr 2007
        • 134

        #4
        now i did put iexplore in my system directory manually and it works perfect (Thank you very much!) but do most ppl have iexplore in their 'windows' folder? none of my computers do.

        Comment

        • weaknessforcats
          Recognized Expert Expert
          • Mar 2007
          • 9214

          #5
          Originally posted by lumpybanana247
          i tried that and what i got was a blank cmd window for a split second- then nothing happend. im using windows xp if that makes a difference

          thanks

          ps "iexplore" is not in my WINDOWS folder.
          That split-second blank screen was your program executing. Then it shout down and took the ie session with it.

          Put a cin.get() in the code to keep wh command window up. Then you shoueol see the ie session take off.

          As for your ie not being in a specific place, create a string with the path and use that for the system call.

          Comment

          • lumpybanana247
            New Member
            • Apr 2007
            • 134

            #6
            Originally posted by weaknessforcats
            That split-second blank screen was your program executing. Then it shout down and took the ie session with it.

            Put a cin.get() in the code to keep wh command window up. Then you shoueol see the ie session take off.

            As for your ie not being in a specific place, create a string with the path and use that for the system call.
            Thank you very much gpraghuram and weaknessforcats- you helped me a lot.
            I got it all worked out. :-)

            Comment

            • niskin
              New Member
              • Apr 2007
              • 109

              #7
              If you want to use the default browser without having to use IE then do this:

              Code:
              system("start /max /wait http://www.google.com");

              Comment

              Working...