Metodo IWMPNetwork::getProxyName

[La funzionalità associata a questa pagina, Lettore multimediale Windows SDK, è una funzionalità legacy. È stato sostituito da MediaPlayer. MediaPlayer è stato ottimizzato per Windows 10 e Windows 11. Microsoft consiglia vivamente che il nuovo codice usi MediaPlayer invece di 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.

Il metodo getProxyName restituisce il nome del server proxy in uso.

Sintassi

public System.String getProxyName(
  System.String bstrProtocol
);

Public Function getProxyName( _
  ByVal bstrProtocol As System.String _
) As System.String
Implements IWMPNetwork.getProxyName

Parametri

bstrProtocol [in]

System.String che rappresenta il nome del protocollo. Per un elenco dei protocolli supportati, vedere Protocolli e tipi di file supportati.

Valore restituito

System.String che corrisponde al nome del server proxy in uso. Il valore è significativo solo quando IWMPNetwork.getProxySettings restituisce un valore pari a 2 (usare le impostazioni manuali).

Commenti

Questo metodo non riesce a meno che l'applicazione chiamante non sia in esecuzione nel computer locale o nella intranet.

Esempio

Nell'esempio di codice seguente viene usato getProxyName per visualizzare i nomi dei server proxy Lettore multimediale Windows per i protocolli HTTP e MMS. L'oggetto AxWMPLib.AxWindowsMediaPlayer è rappresentato dalla variabile denominata player.

// String values to hold the results of calls to getProxyExceptionList. 
string proxyNameHTTP = "";
string proxyNameMMS = "";

// Test whether the HTTP proxy settings are manual.
if (player.network.getProxySettings("HTTP") == 2)
{
    proxyNameHTTP = player.network.getProxyName("HTTP");
}

// Test whether the MMS proxy settings are manual.
if (player.network.getProxySettings("MMS") == 2)
{
    proxyNameMMS = player.network.getProxyName("MMS");
}

// Store the proxy server names in a string array and display them using a multi-line
// text box. Unavailable proxy server names will display as "undefined".
proxyNames[0] = ("The current HTTP proxy server name is: " + proxyNameHTTP);
proxyNames[1] = ("The current MMS proxy server name is: " + proxyNameMMS);
proxyNameText.Lines = proxyNames;

' String values to hold the results of calls to getProxyExceptionList. 
Dim proxyNameHTTP As String = ""
Dim proxyNameMMS As String = ""

' Test whether the HTTP proxy settings are manual.
If (player.network.getProxySettings("HTTP") = 2) Then

    proxyNameHTTP = player.network.getProxyName("HTTP")

End If

' Test whether the MMS proxy settings are manual.
If (player.network.getProxySettings("MMS") = 2) Then

    proxyNameMMS = player.network.getProxyName("MMS")

End If

' Store the proxy server names in a string array and display them using a multi-line
' text box. Unavailable proxy server names will display as "undefined".
proxyNames(0) = ("The current HTTP proxy server name is: " + proxyNameHTTP)
proxyNames(1) = ("The current MMS proxy server name is: " + proxyNameMMS)
proxyNameText.Lines = proxyNames

Requisiti

Requisito Valore
Versione
Lettore multimediale Windows serie 9 o successive
Spazio dei nomi
WMPLib
Assembly
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

Vedi anche

Interfaccia IWMPNetwork (VB e C#)

IWMPNetwork.getProxySettings (VB e C#)

IWMPNetwork.setProxyName (VB e C#)