29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
using Coravel;
|
|
using Learn.Archives.Core.Common;
|
|
using Microsoft.Extensions.Configuration;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Learn.Archives.Core.Common.Expand
|
|
{
|
|
public static class AppConfigExpand
|
|
{
|
|
public static void AddAppConfig(this IConfigurationManager cm, string[] args)
|
|
{
|
|
Console.WriteLine($"{DateTime.Now}=>初始化 AppConfig");
|
|
cm.GetSection("AppConfig").Bind(AppCommon.Config);
|
|
var argList = args.ToList();
|
|
var eArgs = Environment.GetEnvironmentVariable("va_args");
|
|
if (!string.IsNullOrEmpty(eArgs))
|
|
argList.AddRange(eArgs.Split(","));
|
|
|
|
Console.WriteLine("===========================================");
|
|
Console.WriteLine("启动参数如下:");
|
|
Console.WriteLine(string.Join(',', args));
|
|
Console.WriteLine("===========================================");
|
|
|
|
if (args.Contains("IS_Server"))
|
|
AppCommon.Config.TaskSetting.IS_Server = true;
|
|
}
|
|
}
|
|
}
|