How to determine the difference between two Uri instances in C#

1 Answer

0 votes
using System;

class Program
{
   static void Main(string[] args)
   {
        Uri address1 = new Uri("https://www.seek4info.com/");

        Uri address2 = new Uri("https://www.seek4info.com/search.php?type=sites&order=rand&query=relative+path");

        Console.WriteLine(address1.MakeRelativeUri(address2));
   }
}



 
/*
run:
   
search.php?type=sites&order=rand&query=relative+path
    
*/

 



answered Apr 14, 2024 by avibootz
...