Click here to Skip to main content
15,879,326 members
Articles / Programming Languages / C# 3.5

Find an open port on a machine using C#

Rate me:
Please Sign up or sign in to vote.
4.79/5 (13 votes)
13 Oct 2011CPOL 67.2K   8  
How to find an open port in a machine using C#.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
15 Oct 2011George Swan
The tcpEndPoints array has duplicates and members outside the required range. It may be better to restrict the array members to the required range, sort them, and remove the duplicates. The first free port can then be found by finding the first non-sequential value.using...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
India India
Software developer by profession, working for a service and product based organisation in India.

Career graph:
Software Programmer since 2002.
Web Developer in ASP.NET since 2004.

Interests:
I love reading the blogs and articles of technology experts. I love codeproject and stackoverflow .

I love to share knowledge and help the programmers. I appreciate if some body corrects my code or my concepts which helps me learn.

Comments and Discussions