如何.NET开发服务器设置的本地主机端口号?端口号、主机、服务器、NET

2023-09-03 04:48:20 作者:爷就是很拽

我看到,不时本地主机端口号改变(的http://本地主机:1519 / ....)。

I see that time to time localhost port number changes (http://localhost:1519/ ....).

基本上它是如何被设置或选择?而当它改变呢?

Basically how does it being set or chosen? And when does it change?

谢谢!

推荐答案

这只是一个随机数:

当您使用ASP.NET开发   服务器来运行的一个文件系统的网站,   默认情况下,Web服务器的引用   随机选择的端口作为   本地主机。

When you use the ASP.NET Development Server to run a file-system Web site, by default, the Web server is invoked on a randomly selected port for localhost.

虽然你可以自己通过禁用动态端口指定。

Although you can specify it yourself by disabling dynamic ports.

看看:如何:指定端口用于ASP.NET开发服务器