是否可以使用 .NET 应用程序中的 IE 连接设置
我有一个在 Windows 7 (x86) 上运行的 .NET 应用程序(WPF,但这并不重要)。我想从我的应用程序连接到互联网以调用网络服务。当有 wifi 连接时,我想使用它。如果没有 wifi 连接,我想自动连接到操作系统中定义的 GPRS 连接设置(例如,在 Internet Explorer 的连接设置中)。
在拨号时代,你可以在IE中同时指定LAN连接和拨号连接,当IE检测到没有LAN时,会询问你是否要连接到拨号。
在本例中,我使用 wifi 代替 LAN,使用 GPRS 代替拨号,并且我不使用 IE,而是使用自定义 .NET 应用程序。用操作系统对话框提示用户就可以了。
我可以使用托管 wlan API (codeplex) 和 GPRS 芯片组制造商的 SDK 自己完成此操作,但我想知道 Windows 7 是否可以通过某种方式为我完成此操作。
I have a .NET application (WPF but that doesn't really matter) running on Windows 7 (x86). I want to connect to the internet from my application to call a web service. When there is a wifi connection, I want to use that. If there is no wifi connection, I want to automatically connect to a GPRS connection setting defined in the OS (e.g. in internet explorer's connection settings).
In the days of dial-up, you could specify both a LAN connection and a dial-up connection in IE, and when IE detected that there was no LAN, you were asked if you wanted to connect to dial-up.
In this case, I have wifi instead of LAN and GPRS instead of dialup and I'm not using IE but a custom .NET application. Prompting the user with an OS dialog would be OK.
I can do this myself with the managed wlan API (codeplex) and the GPRS chipset manufaturer's SDK, but I want to know if there is a way that Windows 7 can do this for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 WebRequest 上可用的 DefaultWebproxy。 DefaultWebProxy 属性从 app.config 文件读取代理设置。如果没有配置文件,则使用当前用户的 Internet Explorer (IE) 代理设置。
例如-
查看这些链接 -
Use DefaultWebproxy available on a WebRequest. The DefaultWebProxy property reads proxy settings from the app.config file. If there is no config file, the current user's Internet Explorer (IE) proxy settings are used.
For Ex-
Check out these links -