Go to if you use the default proxy settings of IE:
Hinternet = internetopen (afxgetappname (), internet_open_type_proxy, null, null, 0 );
Change internet_open_type_proxy to internet_open_type_preconfig.
If you want to configure the proxy server by yourself:
Set the 3rd parameters of internetopen to the IP address of the proxy server:
The proxy format must be [<protocol >=] [<scheme >:///] <proxy> [: <port>].
Protocol, scheme: //, And: port are optional. If the three parameters are ignored, they are HTTP, http: //, and 80 by default.
HTTP proxy by default.
Common proxies are used as follows:
HTTP: HTTP = http: // proxyserver: Port
FTP: ftp: // proxyserver: Port
Gopher: gopher = http: // proxyserver: Port
Socket: SOCKS = proxyserver: Port
If the proxy has a user name/password, you can use the following function settings:
Internetsetoption (hhandle, internet_option_username ,"",);
Internetsetoption (hhandle, internet_option_password ,"",);
Set
Http://faq.csdn.net/read/208215.html 1. Related functions: Hinternet winapi internetopen ( Lpctstr lpszagent, DWORD dwaccesstype, Lpctstr lpszproxy, Lpctstr lpszproxybypass, DWORD dwflags ); Bool winapi internetsetoption ( Hinternet, DWORD dwoption, Lpvoid lpbuffer, DWORD dwbufferlength ); 2. Related Structure Typedef struct { DWORD dwaccesstype; Lpctstr lpszproxy; Lpctstr lpszproxybypass; } Internet_proxy_info, * lpinternet_proxy_info; 3. Use a Proxy Server (1) set dwaccesstype to internet_open_type_proxy. (2) Set lpszproxy (A) The proxy format must be [<protocol >=] [<scheme >:///] <proxy> [: <port>]. (B) Protocol, scheme: //, And: port are optional. If the three are ignored, they are HTTP, http: //,: 80. The default value is HTTP proxy. (C) multiple proxies must be separated by spaces. (D) Use of common proxies is as follows: HTTP: HTTP = http: // proxyserver: Port FTP: FTP: ftp: // proxyserver: Port Gopher Gopher = http: // proxyserver: Port Socks = proxyserver: Port The first three of them can be found in msdn, But I found N locations in the fourth one. in addition, it should be noted that socks proxy can be used only when IE is installed. |