Share via


Windows Media Player 11 SDK IWMPNetwork.getProxyBypassForLocal (VB and C#) 

Windows Media Player SDK banner art

Previous Next

IWMPNetwork.getProxyBypassForLocal (VB and C#)

The getProxyBypassForLocal method returns a value indicating whether the proxy server is bypassed if the origin server is on a local network.

  

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.

Example Code

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

FakePre-399c93f6c19d45fbbd0420d3fbebbf1a-1fcbb50822c7410ca7e05758663d03a9

// 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

Version: Windows Media Player 9 Series or later

Namespace: WMPLib

Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)

See Also

Previous Next