Condividi tramite


HttpClientConnection.UseProxyCredentials Proprietà

Definizione

Ottiene o imposta un valore booleano che indica se la connessione userà le credenziali di rete.

public:
 property bool UseProxyCredentials { bool get(); void set(bool value); };
public bool UseProxyCredentials { get; set; }
member this.UseProxyCredentials : bool with get, set
Public Property UseProxyCredentials As Boolean

Valore della proprietà

Valore booleano che indica se la connessione proxy userà le credenziali di rete. Un valore true indica che la connessione userà le credenziali di rete. Un valore false indica che la connessione non userà le credenziali di rete.

Esempio

L'esempio di codice seguente crea un HttpClientConnectionoggetto , quindi imposta le proprietà. Il valore delle proprietà richiede la sostituzione con valori validi per l'applicazione.

string[] byPassList = { "http://myserver", "http://companysite" };  
Package pkg = new Package();  
ConnectionManager httpConn = pkg.Connections.Add("HTTP");  
HttpClientConnection clientConn = new HttpClientConnection(httpConn.AcquireConnection(null));  
clientConn.ChunkSize = 5;  // Default is 1.  
clientConn.ProxyBypassList = byPassList;  
clientConn.Timeout = 60;  // Default is 30.  
clientConn.UseSecureConnection = false;  

// When UseServerCredentials is true, provide Domain and Password.  
clientConn.UseServerCredentials = true;  
clientConn.ServerDomain = "serverLogOnDomain";  
clientConn.ServerUserName = "serversUserName";  
clientConn.ServerPassword = "serverPasswd"; // Write-only property.  

// When UseProxyCredentials is true, provide Domain and Password.  
clientConn.UseProxyCredentials = true;  
clientConn.ProxyDomain = "myDomain";  
clientConn.ProxyPassword = "proxyPassword";  
Dim byPassList() As String = {"http://myserver", "http://companysite"}  

Dim pkg As Package =  New Package()   
Dim httpConn As ConnectionManager =  pkg.Connections.Add("HTTP")   
Dim clientConn As HttpClientConnection =  New HttpClientConnection(httpConn.AcquireConnection(Nothing))   
clientConn.ChunkSize = 5  ' Default is 1.  
clientConn.ProxyBypassList = byPassList  
clientConn.Timeout = 60  ' Default is 30.  
clientConn.UseSecureConnection = False  

' When UseServerCredentials is true, provide Domain and Password.  
clientConn.UseServerCredentials = True  
clientConn.ServerDomain = "serverLogOnDomain"  
clientConn.ServerUserName = "serversUserName"  
clientConn.ServerPassword = "serverPasswd" ' Write-only property.  

' When UseProxyCredentials is true, provide Domain and Password.  
clientConn.UseProxyCredentials = True  
clientConn.ProxyDomain = "myDomain"  
clientConn.ProxyPassword = "proxyPassword"  

Commenti

Il valore predefinito è false.

Si applica a