Metodo IWMPNetwork::getProxySettings
[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.
Il metodo getProxySettings restituisce informazioni sulle impostazioni proxy per un protocollo.
Sintassi
public System.Int32 getProxySettings(
System.String bstrProtocol
);
Public Function getProxySettings( _
ByVal bstrProtocol As System.String _
) As System.Int32
Implements IWMPNetwork.getProxySettings
Parametri
-
bstrProtocol [in]
-
Oggetto System.String che corrisponde al nome del protocollo. Per un elenco di protocolli supportati, vedere Protocolli e tipi di file supportati.
Valore restituito
System.Int32 che è uno dei valori seguenti.
Valore | Descrizione |
---|---|
0 | Non viene usato un server proxy. |
1 | Le impostazioni proxy per il browser corrente vengono usate (valide solo per HTTP). |
2 | Vengono usate le impostazioni proxy specificate manualmente. |
3 | Le impostazioni proxy vengono rilevate automaticamente. |
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 getProxySettings per visualizzare un messaggio, che fornisce informazioni sulle impostazioni proxy correnti del lettore, in un'etichetta. L'oggetto AxWMPLib.AxWindowsMediaPlayer è rappresentato dalla variabile denominata player.
// 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;
}
' 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
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 dismessi i problemi di GitHub come meccanismo di feedback per il contenuto e verranno sostituiti con un nuovo sistema di feedback. Per altre informazioni, vedere:Invia e visualizza il feedback per