How to get the URL Scheme 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://www.collectivesolver.com/");

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


/*
run:
 
http

*/

 



answered Mar 10, 2017 by avibootz

Related questions

1 answer 160 views
160 views asked Jul 21, 2022 by avibootz
1 answer 419 views
419 views asked Jul 12, 2020 by avibootz
1 answer 293 views
2 answers 300 views
1 answer 205 views
...