IWMPNetwork :: sourceProtocol, propriété

La propriété sourceProtocol obtient le protocole source utilisé pour recevoir des données.

Syntaxe

public System.String sourceProtocol {get; set;}

Public ReadOnly Property sourceProtocol As System.String

Valeur de la propriété

System. String qui est le nom du protocole source.

Notes

Cette propriété obtient une chaîne de longueur nulle ("") lors de la diffusion d’un CD ou d’un DVD.

Exemples

L’exemple de code suivant utilise sourceProtocol pour afficher le protocole source utilisé pour recevoir des données. Les informations s’affichent dans une étiquette, en réponse à l’événement PlayStateChange . L’objet AxWMPLib. AxWindowsMediaPlayer est représenté par la variable Player.

// 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);
    } 
}

' 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

Spécifications

Condition requise Valeur
Version
Lecteur Windows Media série 9 ou version ultérieure
Espace de noms
WMPLib
Assembly
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

Voir aussi

Interface IWMPNetwork (VB et C#)