I need to convert UNC paths to file:///
URLs, e.g.
\\fileserver\share\dir\some file.ext --> file://///fileserver/share/dir/some%20file.ext
Is there some built-in function for this?
I need to convert UNC paths to file:///
URLs, e.g.
\\fileserver\share\dir\some file.ext --> file://///fileserver/share/dir/some%20file.ext
Is there some built-in function for this?
Yes, use the Uri class in the System namespace:
Uri uri = new Uri(@"\\fileserver\share\dir\some file.ext");
string url = uri.AbsoluteUri;