-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!

John
  • 87
  • 2
  • 6

2 Answers2

0

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:pass@www.yahoo.com";
p.Start();

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

Community
  • 1
  • 1
Oren Hizkiya
  • 4,420
  • 2
  • 23
  • 33
0

You could also connect your application to the browser via Automation and then send orders ( fill in input, form submit...) to handle authentification

Please also post details about authentification process of your specific proxy to help others to answer.

Frederic Bazin
  • 1,530
  • 12
  • 27