Delphi应用程序如何检测Windows PC的网络代理设置? [英] How can a Delphi application detect the network proxy settings of a Windows PC?
问题描述
我有一个Delphi应用程序可以使用 Indy组件与因特网上的Web服务器进行通信。应用程序的大多数用户都具有直接的Internet连接,但有些则在本地网络的代理服务器之后。我不想要求用户在 Internet选项/连接/ LAN设置对话框
I have a Delphi application that communicates with web servers on the Internet using the Indy components. Most users of the application have direct Internet connections but some are behind a proxy server of a local network. I don't want to have to ask the users to lookup their proxy server in the Internet Options / Connections / LAN Settings dialog
alt text http://toybase.files.wordpress.com/2008/11/ie-proxy-settings.png
坦白说,大多数人不会知道或关心这个设置。
as quite frankly most people won't know or care what this setting is.
我可以通过一些系统调用获取这些信息一个Delphi-7应用程序?
Can I get this information via some system calls from a Delphi-7 appplication?
非常感谢!
推荐答案
WinAPI - WinHttpGetIEProxyConfigForCurrentUser 。你必须爱MS的长WINAPI名称^ _ ^。
Via WinAPI -- WinHttpGetIEProxyConfigForCurrentUser. You gotta love MS's long WINAPI names ^_^.
OP编辑后:您可以从注册表中读取,AFAIR将位于此处:
After OP edit: You can read from the registry, AFAIR it would be located here :
[ HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings ]
这篇关于Delphi应用程序如何检测Windows PC的网络代理设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!