以编程方式使用C ++ / C获取HTTP代理和端口号

编程入门 行业动态 更新时间:2024-10-24 18:16:39
本文介绍了以编程方式使用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代理和端口号

本文发布于:2023-11-25 17:22:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630659.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:端口号   方式   HTTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!