You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DSWMS/Vue.Net/VOL.WebApi/Program.cs

81 lines
2.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Autofac.Extensions.DependencyInjection;
using AutoMapper;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using VOL.Entity.DomainModels;
using VOL.Core.Configuration;
using System.IO;
namespace VOL.WebApi
{
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.ConfigureKestrel(serverOptions =>
{
serverOptions.Limits.MaxRequestBodySize = 10485760;
// Set properties and call methods on options
DoFirst();
});
//webBuilder.UseKestrel().UseUrls("http://*:9991");//默认端口9991
var filename = "hostporturl.txt";
var hosturl = "http://*:9991";
try
{
using (StreamReader sr = new StreamReader(filename))
{
string line;
// 从文件读取并显示行,直到文件的末尾
while ((line = sr.ReadLine()) != null)
{
hosturl = line.Trim();
}
}
}
catch (Exception e) {
FileStream fs = new FileStream(filename, FileMode.Create, FileAccess.Write);
StreamWriter sr = new StreamWriter(fs);
sr.WriteLine(hosturl);
sr.Close();
fs.Close();
}
webBuilder.UseKestrel().UseUrls(hosturl);
webBuilder.UseIIS();
webBuilder.UseStartup<Startup>();
}).UseServiceProviderFactory(new AutofacServiceProviderFactory());
private static void DoFirst() {
////入库执行明细=>物理库存
//Mapper.Initialize(x => x.CreateMap<VW_OP_WMS_IN_DO_GOODS, OP_WMS_PHYSICS>());
////入库执行明细=>库存变动
//Mapper.Initialize(x => x.CreateMap<VW_OP_WMS_IN_DO_GOODS, Op_Wms_Change>());
////入库执行明细=>物理库存变动
//Mapper.Initialize(x => x.CreateMap<VW_OP_WMS_IN_DO_GOODS, Op_Wms_Physics_Change>());
//Mapper.Initialize(ctx => { });
}
}
}