IWMPNetwork::getProxyPort 메서드

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

getProxyPort 메서드는 사용 중인 프록시 포트를 반환합니다.

구문

public System.Int32 getProxyPort(
  System.String bstrProtocol
);

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

매개 변수

bstrProtocol [in]

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

반환 값

사용 중인 프록시 포트인 System.Int32 입니다. 이 값은 IWMPNetwork.getProxySettings 가 2 값을 반환하는 경우에만 의미가 있습니다(수동 설정 사용).

설명

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

예제

다음 코드 예제에서는 getProxyPort를 사용하여 MMS 및 HTTP 프로토콜에 대한 현재 Windows 미디어 플레이어 프록시 포트 번호를 표시합니다. AxWMPLib.AxWindowsMediaPlayer 개체는 player라는 변수로 표시됩니다.

// Variables to hold the results of calls to getProxyPort. 
int proxyPortHTTP = 0;
int proxyPortMMS = 0;

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

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

// Store the proxy port numbers in a string array and display them using a multi-line
// text box. Unavailable proxy port numbers will display as "undefined".
proxyPorts[0] = ("The current HTTP proxy port is: " + proxyPortHTTP.ToString());
proxyPorts[1] = ("The current MMS proxy port is: " + proxyPortMMS.ToString());
proxyPortText.Lines = proxyPorts;

' Variables to hold the results of calls to getProxyPort. 
Dim proxyPortHTTP As Integer = 0
Dim proxyPortMMS As Integer = 0

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

    proxyPortHTTP = player.network.getProxyPort("HTTP")

End If

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

    proxyPortMMS = player.network.getProxyPort("MMS")

End If

' Store the proxy port numbers in a string array and display them using a multi-line
' text box. Unavailable proxy port numbers will display as "undefined".
proxyPorts(0) = ("The current HTTP proxy port is: " + proxyPortHTTP.ToString())
proxyPorts(1) = ("The current MMS proxy port is: " + proxyPortMMS.ToString())
proxyPortText.Lines = proxyPorts

요구 사항

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

추가 정보

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

IWMPNetwork.getProxySettings(VB 및 C#)

IWMPNetwork.setProxyPort(VB 및 C#)