| FilePathAbsoluteToRelativePath Method |
This helper method can be used to convert an absolute path to one that is relative to the given base
path.
Namespace: SandcastleBuilder.UtilsAssembly: SandcastleBuilder.Utils (in SandcastleBuilder.Utils.dll) Version: 2014.11.22.0
Syntax public static string AbsoluteToRelativePath(
string basePath,
string absolutePath
)
Public Shared Function AbsoluteToRelativePath (
basePath As String,
absolutePath As String
) As String
public:
static String^ AbsoluteToRelativePath(
String^ basePath,
String^ absolutePath
)
static member AbsoluteToRelativePath :
basePath : string *
absolutePath : string -> string
Parameters
- basePath
- Type: SystemString
The base path - absolutePath
- Type: SystemString
An absolute path
Return Value
Type:
StringA path to the given absolute path that is relative to the given base path
Remarks If the base path is null or empty, the current working folder is used.
Examples string basePath = @"E:\DotNet\CS\TestProject\Source";
string absolutePath = @"E:\DotNet\CS\TestProject\Doc\Help.html";
string relativePath = FilePath.AbsoluteToRelativePath(basePath,
absolutePath);
Console.WriteLine(relativePath);
Dim basePath As String = "E:\DotNet\CS\TestProject\Source"
Dim absolutePath As String = "E:\DotNet\CS\TestProject\Doc\Help.html"
Dim relativePath As String = _
FilePath.AbsoluteToRelativePath(basePath, absolutePath);
Console.WriteLine(relativePath)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also