C# 方法冒号this的用法

public Class1(string host, int port, string password = null):this()
{
     this.Host=host;
     this.Port=port;
     this.Password=password;
}

this的这种用法,是构造函数的复用。

参考文章:.NET/C# 类构造函数中this的用法

网络:C#中this的用法集锦

原文地址:https://www.cnblogs.com/Tpf386/p/7874781.html