Run URL in command prompt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mamul
    New Member
    • Oct 2008
    • 23

    Run URL in command prompt

    Hi All,

    I have used system("firefox "url" "); to open a url in command prompt.
    Is there any other way in c++ , that without runing firefox.exe , i will direct open the url in command prompt. please if someone know this reply me.


    Thanks
  • newb16
    Contributor
    • Jul 2008
    • 687

    #2
    I have used system("firefox "url" "); to open a url in command prompt.
    So that is how you make firefox run and tell it to load web page at address specified by url. ( i.e. send request, receive html and outher stuff like images and render it )

    Is there any other way in c++ , that without runing firefox.exe , i will direct open the url in command prompt. please if someone know this reply me.
    What do you want to do here? Tell some other browser to load the page or to load and render it in your program?

    Comment

    • arnaudk
      Contributor
      • Sep 2007
      • 425

      #3
      You can use the telnet utility in windows to open a url. For example, in command prompt, type

      telnet www.yahoo.com 80

      Then type:

      GET /index.html HTTP/1.0

      and the webserver will respond with the homepage of yahoo. Or you can open a url in the default browser by typing

      start http://www.yahoo.com

      on the command line...

      Comment

      • mac11
        Contributor
        • Apr 2007
        • 256

        #4
        you could also code your program to open a port and access the URL itself - sort of like implementing your own browser

        Comment

        Working...