简体   繁体   中英

Code to get all ports used by ASP.NET Development Server

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?

看一下Web Administration API ,您将需要特别看一下Site对象。

try. Request.Url.Port

Request.Url.Port // will give the port of the server. 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM