IWMPNetwork::setProxyBypassForLocal-Methode

Die setProxyBypassForLocal-Methode gibt an, ob der Proxyserver umgangen wird, wenn sich der Ursprungsserver in einem lokalen Netzwerk befindet.

Syntax

public void setProxyBypassForLocal(
  System.String bstrProtocol,
  System.Boolean fBypassForLocal
);

Public Sub setProxyBypassForLocal( _
  ByVal bstrProtocol As System.String, _
  ByVal fBypassForLocal As System.Boolean _
)
Implements IWMPNetwork.setProxyBypassForLocal

Parameter

bstrProtocol [ In]

Eine System.String, die der Protokollname ist. Eine Liste der unterstützten Protokolle finden Sie unter Unterstützte Protokolle und Dateitypen.

fBypassForLocal [ In]

Ein boolescher System.Boolean-Wert, der angibt, ob der Proxyserver umgangen wird.

Rückgabewert

Diese Methode gibt keinen Wert zurück.

Hinweise

Diese Methode hat keine Auswirkungen, es sei denn, der von IWMPNetwork.getProxySettings abgerufene Wert ist 2 (manuelle Einstellungen verwenden).

Diese Methode schlägt fehl, es sei denn, die aufrufende Anwendung wird auf dem lokalen Computer oder Intranet ausgeführt.

Beispiele

Im folgenden Codebeispiel wird setProxyBypassForLocal verwendet, um anzugeben, ob der Windows Media Player-Proxyserver umgangen wird, wenn das MMS-Protokoll verwendet wird, wenn sich der Ursprungsserver in einem lokalen Netzwerk befindet. Das AxWMPLib.AxWindowsMediaPlayer-Objekt wird durch die Variable player dargestellt.

// Prepare a message, a caption and buttons for the user prompt.
string message = ("Bypass proxy server for local addresses?");
string caption = "Proxy Settings";
System.Windows.Forms.MessageBoxButtons buttons = System.Windows.Forms.MessageBoxButtons.YesNo;

// Test whether the proxy settings are manual.
if (player.network.getProxySettings("MMS") == 2)
{
    // Prompt the user for a setting. 
    System.Windows.Forms.DialogResult result = System.Windows.Forms.MessageBox.Show(message, caption, buttons);

    // Store the return value of the DialogResult in a boolean variable.
    bool proxybypass;
    
    if(result == System.Windows.Forms.DialogResult.Yes)
    {
        proxybypass = true;
    }
    else
    {
        proxybypass = false;
    }

    // Set the proxy bypass value according to the response.
    player.network.setProxyBypassForLocal("MMS", proxybypass);
}
else
{
    // Warn that proxy settings must be set to 2 (manual).
    System.Windows.Forms.MessageBox.Show("Proxy settings must be manual!");
}

' Prepare a message, a caption and buttons for the user prompt.
Dim message As String = "Bypass proxy server for local addresses?"
Dim caption As String = "Proxy Settings"
Dim buttons As System.Windows.Forms.MessageBoxButtons = System.Windows.Forms.MessageBoxButtons.YesNo

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

    ' Prompt the user for a setting. 
    Dim result As System.Windows.Forms.DialogResult = System.Windows.Forms.MessageBox.Show(message, caption, buttons)

    ' Store the return value of the DialogResult as a boolean.
    Dim proxybypass As Boolean

    If (result = System.Windows.Forms.DialogResult.Yes) Then

        proxybypass = True

    Else

        proxybypass = False

    End If

    ' Set the proxy bypass value according to the response.
    player.network.setProxyBypassForLocal("MMS", proxybypass)

Else

    ' Warn that proxy settings must be set to 2 (manual).
    System.Windows.Forms.MessageBox.Show("Proxy settings must be manual!")

End If

Anforderungen

Anforderung Wert
Version
Windows Media Player 9-Serie oder höher
Namespace
WMPLib
Assembly
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

Siehe auch

IWMPNetwork-Schnittstelle (VB und C#)

IWMPNetwork.getProxyBypassForLocal (VB und C#)

IWMPNetwork.getProxySettings (VB und C#)