How to use uri.MakeRelativeUri() to get the relative URI from absolute URI

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Uri uri = new Uri("http://seek4info.com/index.php?query=web+hosting");

                Console.WriteLine(uri.MakeRelativeUri(uri));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}


/*
run:
 
?query=web+hosting

*/

 



answered Mar 10, 2017 by avibootz

Related questions

1 answer 214 views
214 views asked Mar 10, 2017 by avibootz
3 answers 759 views
2 answers 281 views
3 answers 219 views
219 views asked Mar 11, 2017 by avibootz
2 answers 285 views
...