How to get the absolute path 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.AbsolutePath);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}


/*
run:

Host = seek4info.com

*/

 



answered Mar 10, 2017 by avibootz

Related questions

1 answer 214 views
214 views asked Mar 10, 2017 by avibootz
3 answers 759 views
1 answer 113 views
1 answer 204 views
3 answers 278 views
...