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 166 views
166 views asked Jul 21, 2022 by avibootz
1 answer 430 views
430 views asked Jul 12, 2020 by avibootz
1 answer 298 views
2 answers 307 views
1 answer 209 views
...