????? ????????? ?? ??????? ?????? ??? Internet Explorer ?????? ???????

?????? ????????? ?????? ?????????
???? ???????: 226473 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

????? ??? ??????? ??? ???????? ???? ???????? ??????? ????????? ?? ??????? ????? ?????? ?? Internet Explorer ?????? ???????.

??? Internet Explorer 4.x ?????????? ??????? ??? ??? ??????? InternetSetOption ? APIs InternetQueryOption ????? INTERNET_OPTION_PROXY. ????? ??? ?????? ?? ???? ???? ??? Internet Explorer 5, ?? ??????? ?????? ????? ?????? ?? ??????? ??????. ????? ??? ????? INTERNET_OPTION_PROXY ????? ????? ?????? ?????? "????" ???. ???? ???? ????? ??????? ?????? ?????? ??????? ??? ?????? HKEY_CURRENT_USER ????? ???? ??????? ???? ?? ??? Internet Explorer 4.0

?????? ?? ???? INTERNET_OPTION_PROXY ????????? ???? ????. ???? ??? ??????? ??????? ??? ??? ??????? ???? NULL. ??? ???? ???? ???? ????? ????? ????????? ??? ???? ??? ???? ??? ??? ?? ????? ???? ???? ??? ????? ?? (???? ????? ??? ?????? ????? ???????? API InternetOpen()).

??? ??? Internet Explorer 5 ????? ??? ?????? ????? ?????? (??? ??? ??????? ???????) ????????, ???? ???? ??? ????? ??????? ???? ?????? ??? ??????? INTERNET_OPTION_PROXY ?? ???? ??? ????? ?? ??? ???? ????? ??????? Internet Explorer. ???? ?????? ?? ??? Internet Explorer 5 ?? ???????? ?? ??? ??????? INTERNET_OPTION_PER_CONNECTION_OPTION ????? ?? ???.

?????? ???? INTERNET_OPTION_PER_CONNECTION_OPTION ????????? ??????? ??????? ??? ???? ????? ?????? ??? ??????? ???? NULL. ???? ??????? ?????? ???????? ???? ????, ??? ?? ??????? ???? InternetSetOption ????? ?????? INTERNET_OPTION_REFRESH. ?? ???? ??????? ????? ???? ??? ????? ?????? ????????? ??? ???? ??? ???? ???.

?????? ?? ?????? ??????? ?????? ??????? ?????? ????? whgke ??? ??????? ??? ??????? ?????? ???????? ?? Internet Explorer 5 ?????????? ??????. ?????? ????? ??? ??????? ???? InternetSetOption ??? ???? ???? ?? ??????? ?????? ?????? InternetOpen ???????? ?????? INTERNET_OPTION_PER_CONNECTION_OPTION. ????? ?????? ????????? ???????? ?????? ?????? ??????? ??????? ?????? ?? ????? ???? hInternet ??? ??? ??????? ????? ??????. hInternet
HINTERNET hInternet = InternetOpen(szAppName, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
InternetSetOption(hInternet, INTERNET_OPTION_PER_CONNECTION_OPTION, ...);
InternetCloseHandle (hInternet);

??????? ????

??? ?????? Internet Explorer 4.x? ???? ??????? ????????? ?? ??????? ?????? ???? ??? ??? ???:
unsigned long        nSize = 4096;
char                 szBuf[4096] = { 0 };
INTERNET_PROXY_INFO* pInfo = (INTERNET_PROXY_INFO*)szBuf;

if(!InternetQueryOption(NULL, INTERNET_OPTION_PROXY, pInfo, &nSize))
   printf("InternetQueryOption failed! (%d)\n", GetLastError());
				
??? Internet Explorer 5 ??????? ???? ???? ??? ???????? ??? ??????? ?????:
INTERNET_PER_CONN_OPTION_LIST    List;
INTERNET_PER_CONN_OPTION         Option[5];
unsigned long                    nSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);

Option[0].dwOption = INTERNET_PER_CONN_AUTOCONFIG_URL;
Option[1].dwOption = INTERNET_PER_CONN_AUTODISCOVERY_FLAGS;
Option[2].dwOption = INTERNET_PER_CONN_FLAGS;
Option[3].dwOption = INTERNET_PER_CONN_PROXY_BYPASS;
Option[4].dwOption = INTERNET_PER_CONN_PROXY_SERVER;

List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
List.pszConnection = NULL;
List.dwOptionCount = 5;
List.dwOptionError = 0;
List.pOptions = Option;

if(!InternetQueryOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &List, &nSize))
   printf("InternetQueryOption failed! (%d)\n", GetLastError());
   if(Option[0].Value.pszValue != NULL)
   printf("%s\n", Option[0].Value.pszValue);

if((Option[2].Value.dwValue & PROXY_TYPE_AUTO_PROXY_URL) == PROXY_TYPE_AUTO_PROXY_URL)
  printf("PROXY_TYPE_AUTO_PROXY_URL\n");

if((Option[2].Value.dwValue & PROXY_TYPE_AUTO_DETECT) == PROXY_TYPE_AUTO_DETECT)
   printf("PROXY_TYPE_AUTO_DETECT\n");

INTERNET_VERSION_INFO      Version;
nSize = sizeof(INTERNET_VERSION_INFO);

InternetQueryOption(NULL, INTERNET_OPTION_VERSION, &Version, &nSize);

if(Option[0].Value.pszValue != NULL)
   GlobalFree(Option[0].Value.pszValue);

if(Option[3].Value.pszValue != NULL)
   GlobalFree(Option[3].Value.pszValue);

if(Option[4].Value.pszValue != NULL)
   GlobalFree(Option[4].Value.pszValue);
				
???????? ???????? ????? ????? ??????? ?? ???? ????? ????? pszConnection ?? ???? INTERNET_PER_CONN_OPTION_LIST. ?????? ??? ??????? ??? NULL ???? ????????? ??????? ??????? ????????? (?? LAN) ?????????.

?????? ????? (?????? INTERNET_PER_CONN_AUTOCONFIG_URL [0]) ??? ????? URL ?????? ????? ?????? ????? ????. ?????? ?????? (?????? INTERNET_PER_CONN_AUTODISCOVERY_FLAG [1]) ????? ?????? ?? ?? ??? ??? ????? ???????? ?? ????? ???? ?? ???? ?? ??? ??????? ??????. ???? ?????? ?????? ?? ?? ?????? ???????? ???? ?? ??????? ???? ??????? ?????. ?????? ???????? ??? ????????? ??? ?? ????????? whe ????????? INTERNET_OPTION_PROXY ?? Internet Explorer 4.x.

??? ????? ????? ??????, ??? ????? ???????? ???? ???? ???? ?? ??????? ?? ???? ?????? ??? ??????? ???????? GlobalFree(). ???? ???? ??? ??????? ??????? ??????? ????? ?? ?? ??? ????? WININET ??? ??? ??????? ?????? ?????? ?????? ??? ????????.

?????? ??? ??????? ????? ?????? ???? ?????? ????? ????? List.pszConnection ??????? ??? ????? ????? ????? ??????? ???? ???? ??.

????? ?????? ?????? ??????? ?????? ??????? ??? ??????? ???? ?? InternetSetOption() ????? ?? ???? ??? ???? ??????:
INTERNET_PER_CONN_OPTION_LIST    List;
INTERNET_PER_CONN_OPTION         Option[1];
unsigned long                    nSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);

Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
Option[0].Value.pszValue = "http://myproxy:8080";

List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
List.pszConnection = NULL;
List.dwOptionCount = 1;
List.dwOptionError = 0;
List.pOptions = Option;

if(!InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &List, nSize))
   printf("InternetQueryOption failed! (%d)\n", GetLastError());

				
??? ????? ??? ????? ???? ????? ????? ????? ?????????? (?? LAN) ??????? (List.pszConnection == NULL). ?? ?????? ? ??? ????? ??????? ?????? ?????? "???????" ??? "http://myproxy" ?????? 8080. ???? ????? ????? ????? URL ??????? ????????:
INTERNET_PER_CONN_OPTION_LIST    List;
INTERNET_PER_CONN_OPTION         Option[2];
unsigned long                    nSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);

Option[0].dwOption = INTERNET_PER_CONN_AUTOCONFIG_URL;
Option[0].Value.pszValue = "http://myserver/get_proxy_info.dll";
Option[1].dwOption = INTERNET_PER_CONN_FLAGS;
Option[1].Value.dwValue = PROXY_TYPE_AUTO_PROXY_URL;

List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
List.pszConnection = NULL;
List.dwOptionCount = 2;
List.dwOptionError = 0;
List.pOptions = Option;

if(!InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &List, nSize))
   printf("InternetQueryOption failed! (%d)\n", GetLastError());
				
??? ????? Internet Explorer ??????? ???? ???? HTTP ????????? ?????? ?????????? ???? ??????? ????????? ???????? ???????.

?????? ????? ?????? ?????? ???? ?? ?????? ??? INTERNET_PER_CONN_PROXY_SERVER ????????? ??? ???????? (????? ??? ???????? ???????? HTTP ??? ? ???????????? ?????? ??????? ????? ?????).

?????? INTERNET_PER_CONN_FLAGS ????? ?????? ??? ?????? ?????? (????? ??? ???? ??????) ?? ???? ???? ?? "???? ????? ????" ??? ?? ???? ????? ?? ????????? ????????.

?????? ???? OR ??? ???????? ?? ???? ????. ??? ??? ???? ??? ???????? ?? ???? ????? ??? ??? ???? ???? (Internet Explorer OPTIONS) ? ????? ???? ??? ???????? (?????? ???? ?? ???????).
int main(int argc, char * argv[]) 
{ 
char buff[256] = "http=http://<ProxyServerName>:80"; 
// To include server for FTP, HTTPS, and so on, use the string
// (ftp=http://<ProxyServerName>:80; https=https://<ProxyServerName>:80) 
INTERNET_PER_CONN_OPTION_LIST    List; 
INTERNET_PER_CONN_OPTION         Option[3]; 
unsigned long                    nSize = sizeof(INTERNET_PER_CONN_OPTION_LIST); 

Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER; 
Option[0].Value.pszValue = buff; 

Option[1].dwOption = INTERNET_PER_CONN_FLAGS; 
Option[1].Value.dwValue = PROXY_TYPE_PROXY; 
Option[1].Value.dwValue |= PROXY_TYPE_DIRECT; 
// This option sets all the possible connection types for the client. 
// This case specifies that the proxy can be used or direct connection is possible.

Option[2].dwOption = INTERNET_PER_CONN_PROXY_BYPASS; 
Option[2].Value.pszValue = "<local>"; 

 

List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST); 
List.pszConnection = NULL; 
List.dwOptionCount = 3; 
List.dwOptionError = 0; 
List.pOptions = Option; 

if(!InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &List, nSize)) 
printf("InternetSetOption failed! (%d)\n", GetLastError()); 

InternetSetOption(NULL, INTERNET_OPTION_REFRESH, NULL,NULL); 
//The connection settings for other instances of Internet Explorer. 

return 0; 

}
				
?? ????? ????? (????????? ??? ???? ?? ????? LAN) ? ??? ???? ????? URL ??????? ?????? ???????? ?????? ????? ?????? ?????? ????? ?????? ????????.

?????

????? WinInet API MSDN ????? 1999

???????

???? ???????: 226473 - ????? ??? ??????: 22/???? ?????/1428 - ??????: 4.0
????? ???
  • Microsoft Internet Explorer 4.0 128-Bit Edition
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 4.01 Service Pack 1
  • Microsoft Internet Explorer 5.0
  • Microsoft Windows Internet Services (WinInet)
????? ??????: 
kbmt kbhowto KB226473 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????226473
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com