Proprietà IWMPNetwork::sourceProtocol
[La funzionalità associata a questa pagina, Lettore multimediale Windows SDK, è una funzionalità legacy. È stata sostituita da MediaPlayer. MediaPlayer è stato ottimizzato per Windows 10 e Windows 11. Microsoft consiglia vivamente che il nuovo codice usi MediaPlayer anziché Lettore multimediale Windows SDK, quando possibile. Microsoft suggerisce che il codice esistente che usa le API legacy venga riscritto per usare le nuove API, se possibile.
La proprietà sourceProtocol ottiene il protocollo di origine usato per ricevere i dati.
Sintassi
public System.String sourceProtocol {get; set;}
Public ReadOnly Property sourceProtocol As System.String
Valore proprietà
Oggetto System.String che è il nome del protocollo di origine.
Commenti
Questa proprietà ottiene una stringa di lunghezza zero ("") durante la riproduzione di un CD o DVD.
Esempio
Nell'esempio di codice seguente viene usato sourceProtocol per visualizzare il protocollo di origine usato per ricevere i dati. Le informazioni vengono visualizzate in un'etichetta, in risposta all'evento PlayStateChange . L'oggetto AxWMPLib.AxWindowsMediaPlayer è rappresentato dalla variabile denominata 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
Requisiti
Requisito | Valore |
---|---|
Versione |
Lettore multimediale Windows serie 9 o versioni successive |
Spazio dei nomi |
WMPLib |
Assembly |
|
Vedi anche
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per