ServicePoint.BindIPEndPointDelegate 屬性
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定要將本機 IPEndPoint 與 ServicePoint產生關聯的委派。
public:
property System::Net::BindIPEndPoint ^ BindIPEndPointDelegate { System::Net::BindIPEndPoint ^ get(); void set(System::Net::BindIPEndPoint ^ value); };
C#
public System.Net.BindIPEndPoint? BindIPEndPointDelegate { get; set; }
C#
public System.Net.BindIPEndPoint BindIPEndPointDelegate { get; set; }
member this.BindIPEndPointDelegate : System.Net.BindIPEndPoint with get, set
Public Property BindIPEndPointDelegate As BindIPEndPoint
強制 ServicePoint 使用特定本機因特網通訊協定 (IP) 位址和埠號碼的委派。 預設值為 null
。
警告
WebRequest
、HttpWebRequest
、ServicePoint
和 WebClient
已經過時,您不應該將它們用於新的開發。 請改用 HttpClient。
某些負載平衡技術需要用戶端使用特定的本機 IP 位址和埠號碼,而不是 IPAddress.Any(或因特網通訊協定第 6 版的 IPAddress.IPv6Any)和暫時埠。 您的 BindIPEndPointDelegate 可以滿足此需求。
產品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |