다음을 통해 공유


IWMPNetwork::getProxyExceptionList method

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The getProxyExceptionList method returns the proxy exception list.

Syntax

public System.String getProxyExceptionList(
  System.String bstrProtocol
);

Public Function getProxyExceptionList( _
  ByVal bstrProtocol As System.String _
) As System.String
Implements IWMPNetwork.getProxyExceptionList

Parameters

bstrProtocol [in]

A System.String that is the protocol name. For a list of supported protocols, see Supported Protocols and File Types.

Return value

A System.String that is a semicolon-delimited list of hosts for which the proxy server is bypassed. The value is meaningful only when IWMPNetwork.getProxySettings returns a value of 2 (use manual settings).

Remarks

This is a list of computers, domains, and/or addresses that will bypass the proxy server when the host portion of the target URL matches an entry in the list.

The * character can be used as a wildcard character for listing entries. For example, *.com would match all hosts in the com domain, while 67.* would match all hosts in the 67 class A subnet.

This method fails unless the calling application is running on the local computer or intranet.

Examples

The following code example uses getProxyExceptionList to display whether Windows Media Player is set to bypass the proxy server for local addresses. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

// String values to hold the results of calls to getProxyExceptionList. 
string proxyExceptionListHTTP = "";
string proxyExceptionListMMS = "";

// Test whether the HTTP proxy settings are manual.
if (player.network.getProxySettings("HTTP") == 2)
{
    proxyExceptionListHTTP = player.network.getProxyExceptionList("HTTP");
}

// Test whether the MMS proxy settings are manual.
if (player.network.getProxySettings("MMS") == 2)
{
    proxyExceptionListMMS = player.network.getProxyExceptionList("MMS");
}

// Store the proxy exception lists in a string array and display them
// using a multi-line text box. Unavailable exception lists will display
// as "undefined".
proxyExList[0] = ("The current HTTP proxy exception list: " + proxyExceptionListHTTP);
proxyExList[1] = ("The current MMS proxy exception list: " + proxyExceptionListMMS);
proxyExceptionListText.Lines = proxyExList;

' String values to hold the results of calls to getProxyExceptionList. 
Dim proxyExceptionListHTTP As String = ""
Dim proxyExceptionListMMS As String = ""

' Test whether the HTTP proxy settings are manual.
If (player.network.getProxySettings("HTTP") = 2) Then

    proxyExceptionListHTTP = player.network.getProxyExceptionList("HTTP")

End If

' Test whether the MMS proxy settings are manual.
If (player.network.getProxySettings("MMS") = 2) Then

    proxyExceptionListMMS = player.network.getProxyExceptionList("MMS")

End If

' Store the proxy exception lists in a string array and display them
' using a multi-line text box. Unavailable exception lists will display
' as "undefined".
proxyExList(0) = ("The current HTTP proxy exception list: " + proxyExceptionListHTTP)
proxyExList(1) = ("The current MMS proxy exception list: " + proxyExceptionListMMS)
proxyExceptionList.Lines = proxyExList

Requirements

Requirement Value
Version
Windows Media Player 9 Series or later
Namespace
WMPLib
Assembly
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

See also

IWMPNetwork Interface (VB and C#)

IWMPNetwork.getProxySettings (VB and C#)

IWMPNetwork.setProxyExceptionList (VB and C#)