在单在OSX我如何才能获得当前代理? [英] In Mono on OSX how do I get access to the current proxy?

查看:202
本文介绍了在单在OSX我如何才能获得当前代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GetSystemWebProxy 和的 DefaultWebProxy 返回null。

  WebRequest.GetSystemWebProxy();
WebRequest.DefaultWebProxy;
 

解决方案

如果您使用的是最新版本的 monomac (或从源代码编译的话),那么你应该能够调用静态方法 CFNetwork.GetDefaultProxy 来源,看文件的末尾),以获得的 IWebProxy 实例应匹配什么OSX使用。

Both GetSystemWebProxy and DefaultWebProxy return null.

WebRequest.GetSystemWebProxy();
WebRequest.DefaultWebProxy;

解决方案

If you use a recent version of monomac (or build it from source) then you should be able to call the static method CFNetwork.GetDefaultProxy (source, look at the end of the file) to get an IWebProxy instance that should match what OSX is using.

这篇关于在单在OSX我如何才能获得当前代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆