Share via


IWMPNetwork::getProxyBypassForLocal 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 getProxyBypassForLocal method returns a value indicating whether the proxy server is bypassed if the origin server is on a local network.

Syntax

public System.Boolean getProxyBypassForLocal(
  System.String bstrProtocol
);

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

Parameters

bstrProtocol

A System.String that is the protocol name.

Return value

A System.Boolean value that indicates whether the proxy server is bypassed. The value is meaningful only when IWMPNetwork.getProxySettings returns a value of 2 (use manual settings).

Remarks

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

Examples

The following code example uses getProxyBypassForLocal 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.

' Boolean values to hold the results of calls to getProxyBypassForLocal. 
Dim proxyBypassForLocalHTTP As Boolean = False
Dim proxyBypassForLocalMMS As Boolean = False

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

    proxyBypassForLocalHTTP = player.network.getProxyBypassForLocal("HTTP")

End If

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

    proxyBypassForLocalMMS = player.network.getProxyBypassForLocal("MMS")

End If

' Store the proxy bypass for local values in a string array and display them
' using a multi-line text box. Unavailable proxy bypass for local values will display
' as "undefined".
proxyInfo(0) = ("The current HTTP proxy bypass for local value: " + proxyBypassForLocalHTTP.ToString())
proxyInfo(1) = ("The current MMS proxy bypass for local value: " + proxyBypassForLocalMMS.ToString())
proxyBypassText.Lines = proxyInfo

// Boolean values to hold the results of calls to getProxyBypassForLocal. 
bool proxyBypassForLocalHTTP = false;
bool proxyBypassForLocalMMS = false;

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

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

// Store the proxy bypass for local values in a string array and display them
// using a multi-line text box. Unavailable proxy bypass for local values will display
// as "undefined".
proxyInfo[0] = ("The current HTTP proxy bypass for local value: " + proxyBypassForLocalHTTP.ToString());
proxyInfo[1] = ("The current MMS proxy bypass for local value: " + proxyBypassForLocalMMS.ToString());
proxyBypassText.Lines = proxyInfo;

Requirements

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

See also

IWMPNetwork Interface (VB and C#)

IWMPNetwork.getProxySettings (VB and C#)

IWMPNetwork.setProxyBypassForLocal (VB and C#)