gpt4 book ai didi

asp.net-core - 如何获取 ASP.NET Core 应用程序名称?

转载 作者:行者123 更新时间:2023-12-03 18:38:04 25 4
gpt4 key购买 nike

我想在 ASP.NET Core 1.1 的页脚中显示

© 2017 MyApplication


<p>&copy; 2017 @(ApplicationName)</p>

如何获取应用程序名称?

我在这个主题上找到了 an article 但它对 PlatformServices.Default.Application.ApplicationName 感到困惑,因为它说不要使用 Microsoft.Extensions.PlatformAbstractions ,但没​​有说明应用程序名称要使用什么......

最佳答案

你可以试试:

@using System.Reflection;
<!DOCTYPE html>
<html>
....

<footer>
<p>&copy; 2017 - @Assembly.GetEntryAssembly().GetName().Name</p>
</footer>
</html>

我不确定这是一个好方法,但它对我有用:)

enter image description here

关于asp.net-core - 如何获取 ASP.NET Core 应用程序名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45287061/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com