开发者

cURL Proxy Identification

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!


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜