gpt4 book ai didi

c++ - WinHttpDetectAutoProxyConfigUrl 始终失败,错误代码为 12180 (ERROR_WINHTTP_AUTODETECTION_FAILED)

转载 作者:太空宇宙 更新时间:2023-11-04 03:42:12 27 4
gpt4 key购买 nike

我正在尝试自动为我的计算机获取代理设置。我已经设置了一个本地服务器并上传了一个 .pac 文件(我可以从我的浏览器访问它)并且我已经在 Internet Explorer 连接设置中的“地址”字段中设置了指向它的链接并进行了检查“使用自动配置脚本”。

我的代码如下:

int main()
{
LPWSTR str = NULL;
if (!WinHttpDetectAutoProxyConfigUrl(WINHTTP_AUTO_DETECT_TYPE_DHCP | WINHTTP_AUTO_DETECT_TYPE_DNS_A, &str))
{
printf("%d\n", GetLastError());
}

if(str)
GlobalFree(str);
return 0;
}

函数总是失败,GetLastError 返回 12180 (ERROR_WINHTTP_AUTODETECTION_FAILED)

我做错了什么?

最佳答案

来自 https://developer.appcelerator.com/question/120622/errorwinhttpautodetectionfailed :

This error message is not necessarily a problem and can be ignored if you are using direct connection. you get this error if you are having direct connection. to check that and get more info, you can use the following commands: cd windows\system32 netsh winhttp help — answered 4 years ago by Nick G

根据您的评论,我了解到这确实是您收到此错误的原因,因此我将其作为答案发布。

关于c++ - WinHttpDetectAutoProxyConfigUrl 始终失败,错误代码为 12180 (ERROR_WINHTTP_AUTODETECTION_FAILED),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27548646/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com