共用方式為


UrlMkSetSessionOption function

Sets options for the current Internet session.

Syntax

HRESULT UrlMkSetSessionOption(
  _In_       DWORD                                  dwOption,
  _In_       __in_bcount_opt(dwBufferLength) LPVOID pBuffer,
  _In_       DWORD                                  dwBufferLength,
  _Reserved_ __reserved DWORD                       dwReserved
);

Parameters

dwOption [in]

An unsigned long integer value that contains the option to set. This can be one of the following values.

INTERNET_OPTION_PROXY

Sets the proxy settings. pBuffer must contain an INTERNET_PROXY_INFO structure. INTERNET_OPTION_PROXY and INTERNET_PROXY_INFO are defined in the Wininet.h file. For more information, see Introduction to the Microsoft Win32 Internet Functions.

INTERNET_OPTION_REFRESH

Sets the value that determines if the proxy information can be reread from the registry. The value TRUE indicates that the proxy information can be reread from the registry. For more information, see Introduction to the Microsoft Win32 Internet Functions.

URLMON_OPTION_USERAGENT

Sets the user agent string for this process.

URLMON_OPTION_USERAGENT_REFRESH

Refreshes the user agent string from the registry for this process.

pBuffer [in]

A pointer to the buffer containing the new session settings.

dwBufferLength [in]

An unsigned long integer value that contains the size of pBuffer.

dwReserved [in]

Reserved. Must be set to 0.

Return value

Returns S_OK if options are successfully set, or E_INVALIDARG if one of the parameters is invalid.

Remarks

This function maps directly to the Windows Internet function InternetSetOption, although UrlMkSetSessionOption allows only global options to be set.

To use this function, the client code must include the Wininet.h header file, which declares values for the dwOption parameter and structures for the pBuffer parameter.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Product

Internet Explorer 3.0

Header

Urlmon.h

Library

Urlmon.lib

DLL

Urlmon.dll