C# Program to Demonstrate the Use of Port Property of URI Class

You are currently viewing C# Program to Demonstrate the Use of Port Property of URI Class

C# program to demonstrate the use of Port property of Uri class

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        Uri domainUri;

        domainUri = new Uri("http://www.includehelp.com:8082?Query1=101&Query2=102");
        
        Console.WriteLine("Port Number: "+domainUri.Port);
    }
}
Port Number: 8082
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