Returns the specified Uri as a relative URI.
- toUri
- The URI to compare to the current URI.
A string with the difference between the current instance and toUri if the two URIs are the same except for the path information. If the two URIs differ in more than the Uri.AbsolutePath, this method returns the string representation of toUri.
Documentation for this section has not yet been entered.
The following example demonstrates the Uri.MakeRelative(Uri) method.
C# Example
using System; public class UriTest { public static void Main() { Uri myUri = new Uri("http://www.contoso.com/Hello%20World.htm", true); Console.WriteLine(myUri.ToString()); Console.WriteLine(myUri.MakeRelative(new Uri ("http://www.contoso.com/index.htm"))); } }The output is
http://www.contoso.com/Hello World.htm
index.htm
Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0