IWMPNetwork::setProxyBypassForLocal 메서드

[이 페이지와 연결된 기능인 Windows 미디어 플레이어 SDK는 레거시 기능입니다. MediaPlayer로 대체되었습니다. MediaPlayer는 Windows 10 및 Windows 11 최적화되었습니다. 가능한 경우 새 코드에서 Windows 미디어 플레이어 SDK 대신 MediaPlayer를 사용하는 것이 좋습니다. 가능한 경우 레거시 API를 사용하는 기존 코드를 다시 작성하여 새 API를 사용하도록 제안합니다.]

setProxyBypassForLocal 메서드는 원본 서버가 로컬 네트워크에 있는 경우 프록시 서버가 무시되는지 여부를 지정합니다.

구문

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

매개 변수

bstrProtocol [in]

프로토콜 이름인 System.String 입니다. 지원되는 프로토콜 목록은 지원되는 프로토콜 및 파일 형식을 참조하세요.

fBypassForLocal [in]

프록시 서버가 무시되는지 여부를 나타내는 System.Boolean 값입니다.

반환 값

이 메서드는 값을 반환하지 않습니다.

설명

이 메서드는 IWMPNetwork.getProxySettings 에서 검색된 값이 2(수동 설정 사용)인 경우가 아니면 아무 효과가 없습니다.

호출하는 애플리케이션이 로컬 컴퓨터 또는 인트라넷에서 실행되고 있지 않으면 이 메서드가 실패합니다.

예제

다음 코드 예제에서는 setProxyBypassForLocal을 사용하여 원본 서버가 로컬 네트워크에 있는 경우 MMS 프로토콜을 사용할 때 Windows 미디어 플레이어 프록시 서버가 무시되는지 여부를 지정합니다. AxWMPLib.AxWindowsMediaPlayer 개체는 player라는 변수로 표시됩니다.

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

요구 사항

요구 사항
버전
Windows 미디어 플레이어 9 시리즈 이상
네임스페이스
WMPLib
어셈블리
Interop.WMPLib.dll(Interop.WMPLib.dll.dll)

추가 정보

IWMPNetwork 인터페이스(VB 및 C#)

IWMPNetwork.getProxyBypassForLocal(VB 및 C#)

IWMPNetwork.getProxySettings(VB 및 C#)