75 lines
3.0 KiB
C#
75 lines
3.0 KiB
C#
|
|
using Autofac.Extensions.DependencyInjection;
|
|||
|
|
using Microsoft.AspNetCore.Hosting;
|
|||
|
|
using Microsoft.Extensions.Configuration;
|
|||
|
|
using Microsoft.Extensions.Hosting;
|
|||
|
|
using Microsoft.Extensions.Logging;
|
|||
|
|
using Serilog;
|
|||
|
|
using Serilog.Events;
|
|||
|
|
using Serilog.Sinks.SystemConsole.Themes;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
|
|||
|
|
namespace PictureFilesApi
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>api
|
|||
|
|
/// Desc:<3A><><EFBFBD><EFBFBD>ͼƬ<CDBC>ϴ<EFBFBD><CFB4><EFBFBD>ͼƬ<CDBC>鿴<EFBFBD><E9BFB4><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>
|
|||
|
|
/// <20><><EFBFBD>е<EFBFBD>ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// <20><>Ŀ¼<C4BF><C2BC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ
|
|||
|
|
/// ·<><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼\\<5C><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>\\<5C><>\\<5C><><EFBFBD><EFBFBD>\\ͼƬ
|
|||
|
|
/// ʾ<><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼\\taxmanager\\2021\\20211201\\2021120122542214870032.jpeg
|
|||
|
|
/// </summary>
|
|||
|
|
public class Program
|
|||
|
|
{
|
|||
|
|
public static void Main(string[] args)
|
|||
|
|
{
|
|||
|
|
CreateHostBuilder(args).Build().Run();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|||
|
|
// Host.CreateDefaultBuilder(args)
|
|||
|
|
// .ConfigureWebHostDefaults(webBuilder =>
|
|||
|
|
// {
|
|||
|
|
// webBuilder.UseUrls("http://*:9090").UseStartup<Startup>();
|
|||
|
|
// });
|
|||
|
|
|
|||
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|||
|
|
Host.CreateDefaultBuilder(args)
|
|||
|
|
.ConfigureLogging((hostingContext, logging) =>
|
|||
|
|
{
|
|||
|
|
//logging.ClearProviders(); //ȥ<><C8A5>Ĭ<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>־
|
|||
|
|
// logging.AddLog4Net();
|
|||
|
|
}).UseSerilog((context, configuration) =>
|
|||
|
|
{
|
|||
|
|
configuration
|
|||
|
|
.MinimumLevel.Error()
|
|||
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
|
|||
|
|
.MinimumLevel.Override("System", LogEventLevel.Warning)
|
|||
|
|
.MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Information)
|
|||
|
|
.Enrich.FromLogContext()
|
|||
|
|
.WriteTo.File("logs/log.txt", rollingInterval: RollingInterval.Day);
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
.UseServiceProviderFactory(
|
|||
|
|
new AutofacServiceProviderFactory()) //<2F><>Ĭ<EFBFBD><C4AC>ServiceProviderFactoryָ<79><D6B8>ΪAutofacServiceProviderFactory
|
|||
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|||
|
|
{
|
|||
|
|
//webBuilder.UseUrls("http://*:9158").UseStartup<Startup>();
|
|||
|
|
//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>˿ں<CBBF>
|
|||
|
|
webBuilder
|
|||
|
|
//.UseUrls($"http://*:9091")
|
|||
|
|
//.UseKestrel(options =>
|
|||
|
|
//{
|
|||
|
|
// options.Listen(IPAddress.Loopback, 443, listenOptions =>
|
|||
|
|
// {
|
|||
|
|
// listenOptions.UseHttps(AppContext.BaseDirectory + @"\lisence\5803009_cloud.hopetrytech.com.pfx", "dWSs46OU");
|
|||
|
|
// });
|
|||
|
|
//})
|
|||
|
|
.UseStartup<Startup>().UseIIS();
|
|||
|
|
//webBuilder.UseStartup<Startup>();
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|