Windows Media Player 11 SDK IWMPNetwork.sourceProtocol (VB and C#)
Previous | Next |
IWMPNetwork.sourceProtocol (VB and C#)
The sourceProtocol property gets the source protocol used to receive data.
Property Value
A System.String that is the name of the source protocol.
Remarks
This property gets a zero-length string ("") when playing a CD or DVD.
Example Code
The following code example uses sourceProtocol to display the source protocol used to receive data. The information is displayed in a label, in response to the PlayStateChange Event. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
' Create an event handler for the PlayStateChange event. Public Sub player_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles player.PlayStateChange ' Display the network source protocol when the player is playing by testing for a ' play state enum value of WMPLib.WMPPlayState.wmppsPlaying which equals 3. If (e.newState = 3) Then sourceProtocolLabel.Text = ("Source protocol: " + player.network.sourceProtocol) End If End Sub
FakePre-cf96bf1846714d6e89c975cdab8d256c-cd7d464fb09342d9988dabdf20c9d85f
// Add a delegate for the PlayStateChange event. player.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(player_PlayStateChange); // Create an event handler for the PlayStateChange event. private void player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { // Display the network source protocol when the player is playing by testing for a // play state enum value of WMPLib.WMPPlayState.wmppsPlaying which equals 3. if (e.newState == 3) { sourceProtocolLabel.Text = ("Source protocol: " + player.network.sourceProtocol); } }
Requirements
Version: Windows Media Player 9 Series or later
Namespace: WMPLib
Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)
See Also
Previous | Next |