Windows Media Player 11 SDK IWMPNetwork.setProxyPort (VB and C#)
Previous | Next |
IWMPNetwork.setProxyPort (VB and C#)
The setProxyPort method specifies the proxy port to use.
Parameters
bstrProtocol
A System.String that is the protocol name. For a list of supported protocols, see Supported Protocols and File Types.
lProxyPort
A System.Int32 that is the proxy port to use.
Remarks
This method has no effect unless the value retrieved from IWMPNetwork.getProxySettings is 2 (use manual settings).
This method fails unless the calling application is running on the local computer or intranet.
Example Code
The following code example uses setProxyPort to specify the Windows Media Player proxy port number for the MMS protocol. The port number is retrieved from a text box when a button is clicked. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
Public Sub setProxyPort_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles setProxyPort.Click ' Test whether proxy settings are manual. If (player.network.getProxySettings("MMS") = 2) Then ' Store the user's new proxy port number. Dim portnumber As Integer = System.Convert.ToInt32(portText.Text) ' Set the proxy port. player.network.setProxyPort("MMS", portnumber) Else ' Warn that the proxy settings must be set to 2 (manual). System.Windows.Forms.MessageBox.Show("Proxy settings must be manual!") End If End Sub
FakePre-aeaed93c2bda4f5f814c9be07db5e3d3-9a98d3e432f043e097428316a0d16715
private void setProxyPort_Click(object sender, System.EventArgs e) { // Test whether proxy settings are manual. if (player.network.getProxySettings("MMS") == 2) { // Store the user's new proxy port number. int portnumber = System.Convert.ToInt32(portText.Text); // Set the proxy port. player.network.setProxyPort("MMS", portnumber); } else { // Warn that the proxy settings must be set to 2 (manual). System.Windows.Forms.MessageBox.Show("Proxy settings must be manual!"); } }
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.getProxyPort (VB and C#)
- IWMPNetwork.getProxySettings (VB and C#)
Previous | Next |