Заменить хост в Uri

Как говорит @Ishmael, вы .cs-file можете использовать System.UriBuilder. Вот dotnet пример:

// the URI for which you want to change the host name
var oldUri = Request.Url;

// create a new UriBuilder, which copies all fragments of the source URI
var newUriBuilder = new UriBuilder(oldUri);

// set the new host (you can set other properties too)
newUriBuilder.Host = "newhost.com";

// get a Uri instance from the UriBuilder
var newUri = newUriBuilder.Uri;

c#

.net

uri

2022-10-11T00:57:32+00:00