Compartilhar via


PathUtil.MakeRelative(String, String) Method

Definition

Returns a relative path from relativePathBase to pathToRelativize. The parameters are treated as folders if they end in "", otherwise as filenames. The path from c:\foo\bar to c:\cat\dog is ..\cat\dog -- NOT ....\cat\dog because "bar" and "dog" are files, not folders. If "bar" is a folder, you must append "" to ask for the path from c:\foo\bar\ to c:\cat\dog -- THEN the answer will be ....\cat\dog.

public:
 static System::String ^ MakeRelative(System::String ^ relativePathBase, System::String ^ pathToRelativize);
public static string MakeRelative (string relativePathBase, string pathToRelativize);
static member MakeRelative : string * string -> string
Public Function MakeRelative (relativePathBase As String, pathToRelativize As String) As String

Parameters

relativePathBase
String
pathToRelativize
String

Returns

Applies to