Need to get the .com, .us, .biz, etc. part of the domain name in .NET?
Here’s how:
Dim root As String root = Right(Request.Url.Host, (Request.Url.Host.Length) - InStrRev(Request.Url.Host, ".")) |
Need to get the .com, .us, .biz, etc. part of the domain name in .NET?
Here’s how:
Dim root As String root = Right(Request.Url.Host, (Request.Url.Host.Length) - InStrRev(Request.Url.Host, ".")) |
This would work too:
Dim root as string = replace(right(request.servervariables(“http_host”),3),”.”,”")
You can’t assume domain names are all 3 characters. Also, why would you replace the “.” in this scenario?