I need to get asp.net development server port number in C# method. can you help me?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can get it from Request:
Request.Url.Port
And this is not strictly port of Development web server, this is a port of currently used web server.