i want to convert a network path (Directory "\www.dummy.com@ABC\test") to URI:
var uri = new Uri(path, UriKind.RelativeOrAbsolute);
It occures a URIFormatException
How can i fix this?
i want to convert a network path (Directory "\www.dummy.com@ABC\test") to URI:
var uri = new Uri(path, UriKind.RelativeOrAbsolute);
It occures a URIFormatException
How can i fix this?
I think you need to change UriKind
enum to the Relative
value.
This code snippet is working fine:
const string path = @"\www.dummy.com@ABC\test";
var uri = new Uri(path, UriKind.Relative);
Console.Write(uri);
// Output:
// \www.dummy.com@ABC\test