惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
SecWiki News
SecWiki News
Webroot Blog
Webroot Blog
AI
AI
S
Secure Thoughts
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cloudbric
Cloudbric
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Exploit Database - CXSecurity.com
Latest news
Latest news
N
News and Events Feed by Topic
Simon Willison's Weblog
Simon Willison's Weblog
Scott Helme
Scott Helme
S
Schneier on Security
H
Hacker News: Front Page
Forbes - Security
Forbes - Security
T
Troy Hunt's Blog
Know Your Adversary
Know Your Adversary
S
Security Affairs
V
Visual Studio Blog
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
腾讯CDC
GbyAI
GbyAI
有赞技术团队
有赞技术团队
Last Week in AI
Last Week in AI
N
News and Events Feed by Topic
WordPress大学
WordPress大学
The Register - Security
The Register - Security
Engineering at Meta
Engineering at Meta
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cisco Talos Blog
Cisco Talos Blog
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
Recent Announcements
Recent Announcements
V
V2EX
S
Securelist
Security Archives - TechRepublic
Security Archives - TechRepublic
B
Blog RSS Feed
PCI Perspectives
PCI Perspectives
Security Latest
Security Latest
I
InfoQ
I
Intezer
L
LangChain Blog
雷峰网
雷峰网
NISL@THU
NISL@THU
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志

博客园 - Ace001

win10 频繁蓝屏特别是在微信登录后磁盘读写占用率100%更容易蓝屏的尝试解决办法 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 c# 获取cpu温度 xshell把界面转发到xming ida 操作 mstsc带用户名密码自动登录 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 nuget控制台乱码的解决办法 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 chrome打开网站突然变的很卡的解决办法(可能是*** verge导致) - Ace001 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 ros1-编译并启动仿真环境
netcore如何在启动时拿到web运行端口
Ace001 · 2026-04-30 · via 博客园 - Ace001
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    var lifetime = app.ApplicationServices
        .GetRequiredService<IHostApplicationLifetime>();

    lifetime.ApplicationStarted.Register(() =>
    {
        var addresses = app.ServerFeatures
            .Get<Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature>()
            ?.Addresses;

        if (addresses != null)
        {
            foreach (var address in addresses)
            {
                Console.WriteLine($"Listening on: {address}");
            }
        }
    });
}

Listening on: http://localhost:5000

posted @ 2026-04-30 13:50  Ace001  阅读(15)  评论(0)    收藏  举报