Windows Media Player 11 SDK IWMPNetwork.getProxyName (VB and C#)
Previous | Next |
IWMPNetwork.getProxyName (VB and C#)
The getProxyName method returns the name of the proxy server being used.
Parameters
bstrProtocol
A System.String that is the protocol name. For a list of supported protocols, see Supported Protocols and File Types.
Return Value
A System.String that is the name of the proxy server being used. The value is meaningful only when IWMPNetwork.getProxySettings returns a value of 2 (use manual settings).
Remarks
This method fails unless the calling application is running on the local computer or intranet.
Example Code
The following code example uses getProxyName to display the Windows Media Player proxy server names for the HTTP and MMS protocols. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
' 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
FakePre-e4adc84ea4744b5caf3bb7450fe75b7d-0a0630813f2540568ca7ad0350a135e0
// 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;
Requirements
Version: Windows Media Player 9 Series or later
Namespace: WMPLib
Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)
See Also
- IWMPNetwork Interface (VB and C#)
- IWMPNetwork.getProxySettings (VB and C#)
- IWMPNetwork.setProxyName (VB and C#)
Previous | Next |