Answers for "c# get absolute path from relative"

C#
2

get absolute url c#

string absoluteurl = System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
Posted by: Guest on May-26-2020
0

how to get relative path in c#

Uri file = new Uri(@"c:foobarblopblap.txt");
// Must end in a slash to indicate folder
Uri folder = new Uri(@"c:foobar");
string relativePath = 
Uri.UnescapeDataString(
    folder.MakeRelativeUri(file)
        .ToString()
        .Replace('/', Path.DirectorySeparatorChar)
    );
Posted by: Guest on September-30-2020

Code answers related to "c# get absolute path from relative"

C# Answers by Framework

Browse Popular Code Answers by Language