FilePath.RelativeToAbsolutePath Method

HTML to MAML Converter

FilePathRelativeToAbsolutePath Method
This helper method can be used to convert a relative path to an absolute path based on the given base path.

Namespace: SandcastleBuilder.Utils
Assembly: ConvertHtmlToMaml (in ConvertHtmlToMaml.exe) Version: 1.0.0.2
Syntax
public static string RelativeToAbsolutePath(
	string basePath,
	string relativePath
)
Public Shared Function RelativeToAbsolutePath ( 
	basePath As String,
	relativePath As String
) As String
public:
static String^ RelativeToAbsolutePath(
	String^ basePath, 
	String^ relativePath
)
static member RelativeToAbsolutePath : 
        basePath : string * 
        relativePath : string -> string 

Parameters

basePath
Type: SystemString
The base path
relativePath
Type: SystemString
A relative path

Return Value

Type: String
An absolute 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 relativePath = @"..\Doc\Help.html";

string absolutePath = FilePath.RelativeToAbsolutePath(basePath,
    relativePath);

Console.WriteLine(absolutePath);

// Results in: E:\DotNet\CS\TestProject\Doc\Help.html
Dim basePath As String = "E:\DotNet\CS\TestProject\Source"
Dim relativePath As String = "..\Doc\Help.html"

Dim absolutePath As String = _
    FilePath.RelativeToAbsolutePath(basePath, relativePath);

Console.WriteLine(absolutePath)

' Results in: E:\DotNet\CS\TestProject\Doc\Help.html

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