C# Program to Check Whether a Given URI Is Accessed Through HTTP Protocol

You are currently viewing C# Program to Check Whether a Given URI Is Accessed Through HTTP Protocol

C# program to check whether a given Uri is accessed through http protocol

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        Uri uriAddress = new Uri("http://www.includehelp.com/");

        Console.WriteLine(uriAddress.Scheme);
        Console.WriteLine(Uri.UriSchemeHttp);

        if (uriAddress.Scheme == Uri.UriSchemeHttp)
            Console.WriteLine("Given Uri is access through http protocol");
    }
}
http
http
Given Uri is access through http protocol
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply