2024-09-23 09:14:22 +08:00
|
|
|
|
using Infrastructure.Helper;
|
|
|
|
|
|
using JinianNet.JNTemplate;
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using System;
|
2024-09-23 09:35:41 +08:00
|
|
|
|
using System.Net;
|
2024-09-23 09:14:22 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Infrastructure
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class LogoExtension
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void AddLogo(this IServiceCollection services)
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.ForegroundColor = ConsoleColor.Blue;
|
|
|
|
|
|
var contentTpl = JnHelper.ReadTemplate("", "logo.txt");
|
|
|
|
|
|
var content = contentTpl?.Render();
|
|
|
|
|
|
var url = AppSettings.GetConfig("urls");
|
|
|
|
|
|
Console.WriteLine(content);
|
|
|
|
|
|
Console.ForegroundColor = ConsoleColor.Blue;
|
2024-09-23 09:35:41 +08:00
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("苏州道安自动化技术有限公司成立于2009年7月,公司在苏州新加坡工业园区注册成立,是一家专业从事于装配和测试的民营企业。");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取本地主机名
|
|
|
|
|
|
string hostName = Dns.GetHostName();
|
|
|
|
|
|
|
|
|
|
|
|
// 获取本地主机的 IP 地址列表
|
|
|
|
|
|
IPAddress[] localIPs = Dns.GetHostAddresses(hostName);
|
|
|
|
|
|
|
|
|
|
|
|
// 设置控制台输出颜色为蓝色
|
|
|
|
|
|
Console.ForegroundColor = ConsoleColor.Blue;
|
|
|
|
|
|
|
|
|
|
|
|
// 打印本地主机的 IP 地址
|
2025-09-11 16:24:41 +08:00
|
|
|
|
Console.WriteLine($"主机IP地址为: {hostName}:");
|
2024-09-23 09:35:41 +08:00
|
|
|
|
foreach (IPAddress ip in localIPs)
|
|
|
|
|
|
{
|
2025-09-11 16:24:41 +08:00
|
|
|
|
Console.WriteLine("主机配置的IP地址列表:"+ip);
|
2024-09-23 09:35:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 重置控制台输出颜色为默认颜色
|
|
|
|
|
|
Console.ResetColor();
|
2024-09-23 09:14:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|