Click or drag to resize
Sandcastle Help File BuilderFilePathRelativeToAbsolutePath 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: SandcastleBuilder.Utils (in SandcastleBuilder.Utils.dll) Version: 2014.11.22.0
Syntax
public static string RelativeToAbsolutePath(
	string basePath,
	string relativePath
)

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
See Also