Windows Media Player 11 SDK IWMPNetwork.getProxySettings (VB and C#)
Previous | Next |
IWMPNetwork.getProxySettings (VB and C#)
The getProxySettings method returns information about the proxy settings for a protocol.
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 one of the following values.
Value | Description |
0 | A proxy server is not being used. |
1 | The proxy settings for the current browser are being used (valid only for HTTP). |
2 | The manually specified proxy settings are being used. |
3 | The proxy settings are being auto-detected. |
Remarks
This method fails unless the calling application is running on the local computer or intranet.
Example Code
The following code example uses getProxySettings to display a message, which gives information about the current proxy settings of the Player, in a label. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
' Retrieve a number representing the current proxy settings. Dim proxySetting As Integer = player.network.getProxySettings("MMS") ' Display the message that corresponds to the current settings. Select Case proxySetting Case 0 proxySettingsLabel.Text = "A proxy server is not being used" Case 1 proxySettingsLabel.Text = "The proxy settings for the current browser are being used." Case 2 proxySettingsLabel.Text = "The manually specified proxy settings are being used." Case 3 proxySettingsLabel.Text = "The proxy settings are being auto-detected." Case Else proxySettingsLabel.Text = "Unable to determine proxy setting, try again." End Select
FakePre-8bbf3a4aaeb4490fb127e4030620e5de-2ce991d122ed448ab293cf8254ad68eb
// Retrieve a number representing the current proxy settings. int proxySetting = player.network.getProxySettings("MMS"); // Display the message that corresponds to the current settings. switch(proxySetting) { case 0: proxySettingsLabel.Text = "A proxy server is not being used"; break; case 1: proxySettingsLabel.Text = "The proxy settings for the current browser are being used."; break; case 2: proxySettingsLabel.Text = "The manually specified proxy settings are being used."; break; case 3: proxySettingsLabel.Text = "The proxy settings are being auto-detected."; break; default: proxySettingsLabel.Text = "Unable to determine proxy setting, try again."; break; }
Requirements
Version: Windows Media Player 9 Series or later
Namespace: WMPLib
Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)
See Also
Previous | Next |