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

推荐订阅源

V
Visual Studio Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
A
Arctic Wolf
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
S
Schneier on Security
The Cloudflare Blog
Security Latest
Security Latest
S
SegmentFault 最新的问题
L
Lohrmann on Cybersecurity
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cyber Attacks, Cyber Crime and Cyber Security
K
Kaspersky official blog
Latest news
Latest news
月光博客
月光博客
aimingoo的专栏
aimingoo的专栏
P
Privacy & Cybersecurity Law Blog
F
Fortinet All Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
美团技术团队
博客园 - 叶小钗
H
Help Net Security
博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
A
About on SuperTechFans
WordPress大学
WordPress大学
Cloudbric
Cloudbric
IT之家
IT之家
Last Week in AI
Last Week in AI
S
Securelist
Google Online Security Blog
Google Online Security Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
L
LINUX DO - 最新话题
Know Your Adversary
Know Your Adversary
爱范儿
爱范儿
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
G
Google Developers Blog
C
CERT Recently Published Vulnerability Notes
宝玉的分享
宝玉的分享
博客园 - Franky
TaoSecurity Blog
TaoSecurity Blog
P
Proofpoint News Feed
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
L
LINUX DO - 热门话题
N
News and Events Feed by Topic
B
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)    收藏  举报