Windows Media Player 11 SDK IWMPNetwork.getProxyPort (VB and C#)
Previous | Next |
IWMPNetwork.getProxyPort (VB and C#)
The getProxyPort method returns the proxy port 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.Int32 that is the proxy port 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 getProxyPort to display the current Windows Media Player proxy port numbers for the MMS and HTTP protocols. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
' 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
FakePre-94636a5daacd44b6a25e9e655fd38341-4bd2ca1a6b07402f9a0a2ce4962e2b47
// 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;
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.setProxyPort (VB and C#)
Previous | Next |