gpt4 book ai didi

c - 启用绕过代理服务器并通知 IE 进行更改

转载 作者:行者123 更新时间:2023-11-30 14:43:57 25 4
gpt4 key购买 nike

我正在尝试使用 Internet Explorer 选项 API 基于此 example from Microsoft 设置LAN 设置 .

我能够设置代理地址和异常(exception),但我想启用绕过本地地址的代理服务器复选框,并通知 Internet Explorer 进行更改,这样我就不必关闭并再次打开它。

我想我需要使用 INTERNET_PER_CONN_OPTION 结构中的另一个选项,但不知道应该使用什么。

enter image description here

这是我的代码:

#include <Windows.h>
#include <wininet.h>
#include <wchar.h>

#pragma comment(lib, "Wininet.lib")

int wmain(int argc, wchar_t * argv[])
{
INTERNET_PER_CONN_OPTION_LIST connList;
DWORD bufSize = sizeof(connList);

connList.dwSize = sizeof(connList);
connList.pszConnection = NULL;
connList.dwOptionCount = 3;
connList.pOptions = (INTERNET_PER_CONN_OPTION*)malloc(sizeof(INTERNET_PER_CONN_OPTION) * 3);

if (connList.pOptions == NULL)
{
fwprintf(stderr, L"Memory allocation failed.\n");
return 1;

}

connList.pOptions[0].dwOption = INTERNET_PER_CONN_FLAGS;
connList.pOptions[0].Value.dwValue = PROXY_TYPE_DIRECT |
PROXY_TYPE_PROXY;

connList.pOptions[1].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
connList.pOptions[1].Value.pszValue = L"https://internal.com.co:80";

connList.pOptions[2].dwOption = INTERNET_PER_CONN_PROXY_BYPASS;
connList.pOptions[2].Value.pszValue = L"local";

BOOL internetOption;

internetOption = InternetSetOptionW(NULL,
INTERNET_OPTION_PER_CONNECTION_OPTION,
&connList,
bufSize);

if (internetOption != TRUE)
{
fwprintf(stderr, L"Faile to set the option with code: %u\n", GetLastError());
return 1;
}

free(connList.pOptions);

wprintf(L"Done!\n");

return 0;
}

你能帮我吗?

最佳答案

添加字符串<local>包括<>标记到异常(exception)列表,例如<local>;*.microsoft.com .

关于c - 启用绕过代理服务器并通知 IE 进行更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53671585/

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