ServicePoint.ConnectionName 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取连接名称。
public:
property System::String ^ ConnectionName { System::String ^ get(); };
public string ConnectionName { get; }
member this.ConnectionName : string
Public ReadOnly Property ConnectionName As String
属性值
表示连接名称的 A String 。
示例
Console.WriteLine("ConnectionName = " + sp.ConnectionName);
// Display the maximum number of connections allowed on this
// ServicePoint instance.
Console.WriteLine("ConnectionLimit = " + sp.ConnectionLimit);
// Display the number of connections associated with this
// ServicePoint instance.
Console.WriteLine("CurrentConnections = " + sp.CurrentConnections);
Console.WriteLine(("ConnectionName = " + sp.ConnectionName))
' Display the maximum number of connections allowed on this
' ServicePoint instance.
Console.WriteLine(("ConnectionLimit = " + sp.ConnectionLimit.ToString()))
' Display the number of connections associated with this
' ServicePoint instance.
Console.WriteLine(("CurrentConnections = " + sp.CurrentConnections.ToString()))
注解
Caution
WebRequest、 HttpWebRequest、 ServicePoint和 WebClient 已过时,不应将其用于新开发。 改用 HttpClient。
ServicePoint如果通过使用参数调用FindServicePoint重载Uri来构造对象,则该ConnectionName属性表示Scheme所使用的对象的属性Uri。
ServicePoint如果对象是从网络主机和端口构造的,则ConnectionName属性包含表示主机和网络端口的字符串。 ConnectionName如果在从主机和端口构造时设置该属性,则只有WebRequest具有相同ConnectionGroupName值的对象才能使用此ServicePoint对象。