IWMPNetwork::getProxyName 메서드

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

getProxyName 메서드는 사용 중인 프록시 서버의 이름을 반환합니다.

구문

public System.String getProxyName(
  System.String bstrProtocol
);

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

매개 변수

bstrProtocol [in]

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

반환 값

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

설명

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

예제

다음 코드 예제에서는 getProxyName을 사용하여 HTTP 및 MMS 프로토콜에 대한 Windows 미디어 플레이어 프록시 서버 이름을 표시합니다. AxWMPLib.AxWindowsMediaPlayer 개체는 player라는 변수로 표시됩니다.

// String values to hold the results of calls to getProxyExceptionList. 
string proxyNameHTTP = "";
string proxyNameMMS = "";

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

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

// Store the proxy server names in a string array and display them using a multi-line
// text box. Unavailable proxy server names will display as "undefined".
proxyNames[0] = ("The current HTTP proxy server name is: " + proxyNameHTTP);
proxyNames[1] = ("The current MMS proxy server name is: " + proxyNameMMS);
proxyNameText.Lines = proxyNames;

' String values to hold the results of calls to getProxyExceptionList. 
Dim proxyNameHTTP As String = ""
Dim proxyNameMMS As String = ""

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

    proxyNameHTTP = player.network.getProxyName("HTTP")

End If

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

    proxyNameMMS = player.network.getProxyName("MMS")

End If

' Store the proxy server names in a string array and display them using a multi-line
' text box. Unavailable proxy server names will display as "undefined".
proxyNames(0) = ("The current HTTP proxy server name is: " + proxyNameHTTP)
proxyNames(1) = ("The current MMS proxy server name is: " + proxyNameMMS)
proxyNameText.Lines = proxyNames

요구 사항

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

추가 정보

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

IWMPNetwork.getProxySettings(VB 및 C#)

IWMPNetwork.setProxyName(VB 및 C#)