Uri domain = new UriBuilder("milosev.com").Uri; if (Uri.TryCreate(domain, "2015-01-23-20-08-55/gallery", out Uri myUri)) { Console.WriteLine(myUri.AbsoluteUri); }
Creating valid HTTP URI
- Details
- Written by: Stanko Milosev
- Category: C#
- Hits: 1175
One example how to create URI with HTTP protocol. If we have like "www.milosev.com" and link is "2015-01-23-20-08-55/gallery", then safest way is to do it like: