How to find domain name in C#

How to find domain name in C#

string domainName = System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority);

2020-02-12