Answers for "get path relative path c#"

C#
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
0

convert relative path to physical path c#

String RelativePath = AbsolutePath.Replace(Request.ServerVariables["APPL_PHYSICAL_PATH"], String.Empty);
Posted by: Guest on July-13-2020

C# Answers by Framework

Browse Popular Code Answers by Language