Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 08, 2016, 07:53:55 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Call a webpage with a command line c# program  (Read 3071 times)

mediaguycouk

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 245
    • View Profile
    • Mediaguy
    • Donate to Member
Call a webpage with a command line c# program
« on: March 25, 2009, 10:23:09 AM »
I'm converting a Form based C# application to an automatic command line based C# version. However I need to call a webpage (like a cron job would), but I don't know how to do it from the command line. In a form I would call play.webBrowser1.Url = new Uri(address); (after calling the play class that has a web browser element).

Anyone help with this? I don't think I need any feedback from the page at all.
Learning C# - Graham Robinson

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,288
    • View Profile
    • Miles Ahead Software
    • Donate to Member
Re: Call a webpage with a command line c# program
« Reply #1 on: March 25, 2009, 01:23:08 PM »
If you just want to launch the default browser use ShellExecture() API

http://msdn.microsof...bb762153(VS.85).aspx

Use the URL in double quotes as the "filename" and the 'open' verb
Handle, Working dir and all the rest can be NULL or 0
« Last Edit: March 25, 2009, 01:24:43 PM by MilesAhead »