Reputation: 9545
In my solution I have 5 websites that run locally on Visual Studios ASP.NET Development Server
.
Is there some code (C# or VB.NET) in the code behind of one of those sites that can find all the ports used by the ASP.NET Development server?
Upvotes: 2
Views: 337
Reputation: 6903
Take a look at the Web Administration API, you will need to look especially at the Site object.
Upvotes: 1
Reputation: 15851
try. Request.Url.Port
Request.Url.Port // will give the port of the server.
Upvotes: 0