static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Information() .MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .MinimumLevel.Override("System", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Console().WriteTo.File("logs/spiders.log") .CreateLogger(); Console.WriteLine("Hello World!"); DBSet.Init(); //OpenCvFaceProcess.Do(); //return; var task = AVListSpider.RunAsync(); task.Wait(); Console.WriteLine("finish."); }
static void Main(string[] args) { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json") .AddJsonFile("appsettings.Development.json", true); var config = builder.Build(); AIBase.APP_ID = config["BaiduAI:APP_ID"]; AIBase.API_KEY = config["BaiduAI:API_KEY"]; AIBase.SECRET_KEY = config["BaiduAI:SECRET_KEY"]; Console.WriteLine("Hello World!"); DBSet.Init(); SpiderRun.DownZaiwu(0, 3, 154); // SpiderRun.Do(); return; SpiderRun.DetectFace(50); SpiderRun.AddUPToFaceDb(20); }