0
votes
1answer
146 views

Programmatically determine free port in a webpart

When we create a new web application in SharePoint from Central Admin,we see that a free port is automatically populated. Is there a good way to determine the free ports like SharePoint does?