0
kicks
Retrieve the subdomain from a URL in C#
Yesterday I had to come up with a method that retrieved the subdomain from the current web request on an ASP.NET website. I thought that the System.Uri class contained that information in an easy retrievable way, but no.
Here’s what I came up with instead. It still uses the System.Uri to find the subdomain.