以编程方式使用C ++ / C获取HTTP代理和端口号 [英] Programmatically to get HTTP proxy and port number using C++ / C

查看:215
本文介绍了以编程方式使用C ++ / C获取HTTP代理和端口号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



如何在Windows中使用C ++和C语言获取http代理IP地址和端口号。



请允许任何人帮我解决这个问题。





谢谢,

S Shanmuga Raja



我尝试过:



我尝试了一些MSDN - 微软的例子。但这对我的问题没有用。

Dear Friends,

How to fetch http proxy IP address and port number using C++ and C language in Windows.

Please can anyone help me on this issue.


Thanks,
S Shanmuga Raja

What I have tried:

I tried out some of the MSDN - Microsoft example. But it is not work out for my problem.

推荐答案

参见WinHttpGetDefaultProxyConfiguration功能(Windows) [ ^ ]。



另请阅读注册表包含Windows HTTP代理设置的密钥。关键是

See WinHttpGetDefaultProxyConfiguration function (Windows)[^].

Alternatively read the registry key that contains the Windows HTTP proxy settings. The key is
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\



,该值以 ProxyServer 中的文本形式存储(来源:如何使用注册表文件配置客户端代理服务器设置 [ ^ ])。



请注意,某些应用程序(通常是所有浏览器)都允许设置自己的代理,而不是使用为系统配置的代理。然后,您必须阅读这些应用程序的配置。


and the value is stored as text in ProxyServer (source: How to configure client proxy server settings by using a registry file[^]).

Note that some applications (usually all browsers) allow setting their own proxy rather than using the one configured for the system. Then you have to read the configuration for those applications.


这篇关于以编程方式使用C ++ / C获取HTTP代理和端口号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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