HttpClientConnection.UseProxy 属性

定义

获取或设置一个布尔值,该值指示连接是否将使用代理。

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

属性值

一个布尔值,指示连接是否将使用代理。 true 值指示连接将使用代理。 false 值指示连接不使用代理。

示例

下面的代码示例演示如何为包创建 HTTP 连接并创建客户端连接。 然后,它会设置多个属性,包括该 UseProxy 属性。

// Create an HTTP connection.  
ConnectionManager httpConn = pkg.Connections.Add("HTTP");  
HttpClientConnection clientConn = new   
           HttpClientConnection(httpConn.AcquireConnection(null));  
string HTTPUrl = @"http://<yourserver>/<yourfolder>/test.asmx?wsdl";  
clientConn.UseProxy = true;  
clientConn.ProxyURL = @"http://<yourproxy>";  
clientConn.BypassProxyOnLocal = true;  
clientConn.ServerURL = HTTPUrl;  
' Create an HTTP connection.  
Dim httpConn As ConnectionManager =  pkg.Connections.Add("HTTP")   
HttpClientConnection clientConn = New   
           HttpClientConnection(httpConn.AcquireConnection(Nothing))  
Dim HTTPUrl As String =  "http:// <yourserver>/<yourfolder>/test.asmx?wsdl"   
clientConn.UseProxy = True  
clientConn.ProxyURL = "http://<yourproxy>"  
clientConn.BypassProxyOnLocal = True  
clientConn.ServerURL = HTTPUrl  

注解

默认值为 false

适用于