IWMPNetwork::setProxySettings 메서드
[이 페이지와 연결된 기능인 Windows 미디어 플레이어 SDK는 레거시 기능입니다. MediaPlayer로 대체되었습니다. MediaPlayer는 Windows 10 및 Windows 11 최적화되었습니다. 가능한 경우 새 코드에서 Windows 미디어 플레이어 SDK 대신 MediaPlayer를 사용하는 것이 좋습니다. 가능한 경우 레거시 API를 사용하는 기존 코드를 다시 작성하여 새 API를 사용하도록 제안합니다.]
setProxySettings 메서드는 프로토콜에 대한 프록시 설정을 지정합니다.
구문
public void setProxySettings(
System.String bstrProtocol,
System.Int32 lProxySetting
);
Public Sub setProxySettings( _
ByVal bstrProtocol As System.String, _
ByVal lProxySetting As System.Int32 _
)
Implements IWMPNetwork.setProxySettings
매개 변수
-
bstrProtocol [in]
-
프로토콜 이름인 System.String 입니다. 지원되는 프로토콜 목록은 지원되는 프로토콜 및 파일 형식을 참조하세요.
-
lProxySetting [in]
-
다음 값 중 하나인 System.Int32 입니다.
값 설명 0 프록시 서버를 사용하지 마세요. 1 현재 브라우저의 프록시 설정을 사용합니다(HTTP에만 유효). 2 수동으로 지정된 프록시 설정을 사용합니다. 3 프록시 설정을 자동으로 검색합니다.
반환 값
이 메서드는 값을 반환하지 않습니다.
설명
호출하는 애플리케이션이 로컬 컴퓨터 또는 인트라넷에서 실행되고 있지 않으면 이 메서드가 실패합니다.
예제
다음 코드 예제에서는 목록 상자를 사용하여 사용자가 HTTP 프로토콜에 대한 Windows 미디어 플레이어 프록시 설정을 허용합니다. AxWMPLib.AxWindowsMediaPlayer 개체는 player라는 변수로 표시됩니다.
// Load the list box with the proxy settings in order so that their index in the
// list box matches their value.
proxySettings.Items.Add("Do not use a proxy server. (Value = 0)");
proxySettings.Items.Add("Use the proxy settings of the current browser. Valid for HTTP only. (Value = 1)");
proxySettings.Items.Add("Use the manually specified proxy settings. (Value = 2)");
proxySettings.Items.Add("Auto-detect the proxy settings. (Value = 3)");
// Change the proxy setting for the HTTP protocol when the user makes a list box selection.
private void proxySettings_OnSelectedIndexChanged(object sender, System.EventArgs e)
{
// Store the index of the setting from the ListBox
int setting = ((System.Windows.Forms.ListBox)sender).SelectedIndex;
// Change the proxy setting.
player.network.setProxySettings("HTTP", setting);
}
' Load the list box with the proxy settings in order so that their index in the
' list box matches their value.
proxySettings.Items.Add("Do not use a proxy server. (Value = 0)")
proxySettings.Items.Add("Use the proxy settings of the current browser. Valid for HTTP only. (Value = 1)")
proxySettings.Items.Add("Use the manually specified proxy settings. (Value = 2)")
proxySettings.Items.Add("Auto-detect the proxy settings. (Value = 3)")
' Change the proxy setting for the HTTP protocol when the user makes a list box selection.
Public Sub proxySettings_OnSelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles proxySettings.SelectedIndexChanged
' Store the index of the setting from the ListBox
Dim lb As System.Windows.Forms.ListBox = sender
Dim setting As Integer = lb.SelectedIndex
' Change the proxy setting.
player.network.setProxySettings("HTTP", setting)
End Sub
요구 사항
요구 사항 | 값 |
---|---|
버전 |
Windows 미디어 플레이어 9 시리즈 이상 |
네임스페이스 |
WMPLib |
어셈블리 |
|
추가 정보
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기