views:

22

answers:

1

I was wondering if I can use cURL in my .Net application to authenticate to a proxy and then connect with a browser without the annoying authenticate window popping up??

Thanks!

A: 

cURL has many options for dealing authentication.

The command for authenticating with cURL would be:

 curl -u name:passwd http://machine.domain/full/path/to/file

as found in the documentation.

You can learn how to use c# to execute the command and get the results with this question entitled "How To: Execute command line in C#, get STD OUT results".

If you really need to open the browser, you can use:

Process p = new Process();
p.StartInfo.FileName = GetDefaultBrowserPath();
p.StartInfo.Arguments = "http://user:[email protected]";
p.Start();

and the browser should open and authenticate based on the URL.

Oren