问题描述
在我的应用程序启动时,我正在使用WinHttpGetIEProxyConfigForCurrentUser
和朋友收集当前的代理信息,因为每次请求似乎都会大大降低性能,因为它需要花费几秒钟的时间来收集代理数据.有没有一种方法可以检测Windows代理设置何时发生更改,以便我可以缓存信息直到更改为止?
I'm using WinHttpGetIEProxyConfigForCurrentUser
and friends to gather the current proxy information when my app starts as doing it before each request seems to degrade performance greatly with it something sitting for a few seconds gathering the proxy data. Is there a way to detect when the Windows proxy settings have changed so I can cache the information until it changes?
谢谢,J
推荐答案
不确定是否有更好的方法,但是您始终可以选择使用核选项,并在HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
中使用RegNotifyChangeKeyValue.
Not sure if there is a better way, but you could always take the nuclear option and use RegNotifyChangeKeyValue with HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
.
这篇关于检测Windows(IE)代理设置更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!