How to get the absolute Uri from URL in C#

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.AbsoluteUri);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}


/*
run:

http://seek4info.com/index.php?query=web+hosting

*/

 



answered Mar 10, 2017 by avibootz

Related questions

1 answer 191 views
191 views asked Mar 10, 2017 by avibootz
1 answer 130 views
130 views asked Oct 13, 2023 by avibootz
2 answers 288 views
1 answer 125 views
...