Retruns a relative path according to a base path.

Namespace:  SGP.XUtility
Assembly:  SGP.XUtility (in SGP.XUtility.dll)
Version: 1.2.3019.18718

Syntax

C#
public static string GetRelativePath(
	string path,
	string basePath
)

Parameters

path
Type: System..::.String
A path, which should be related to a base path.
basePath
Type: System..::.String
A base path.

Return Value

A relative path to path according to basePath.

Remarks

Method returns a relative path (as subdirectory and/or using "..") from the base path basePath to path including, when exists. Otherwise returns path.

Exceptions

ExceptionCondition
System..::.ArgumentNullException path is nullNothingnullptra null reference (Nothing in Visual Basic).
System..::.ArgumentNullException basePath is nullNothingnullptra null reference (Nothing in Visual Basic).

See Also