From e7b84fe17bca18fe7715c2078883fe0999a296d6 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期四, 05 一月 2023 12:39:17 +0800 Subject: [PATCH] 提交 --- zhengcaioa/Crawler/Program.cs | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/zhengcaioa/Crawler/Program.cs b/zhengcaioa/Crawler/Program.cs index b72b4fe..a492aaa 100644 --- a/zhengcaioa/Crawler/Program.cs +++ b/zhengcaioa/Crawler/Program.cs @@ -24,7 +24,7 @@ public static string connection = @"server=172.26.97.184;database=WebCrawler;uid=sa;pwd=Za20222812;"; public static string connection1 = @"server=172.26.97.184;database=zhengcaioa;uid=sa;pwd=Za20222812;"; - public static string api_domain = "http://localhost:9200"; + public static string api_domain = "http://172.26.97.184:9200"; static void Main(string[] args) { @@ -147,6 +147,10 @@ Thread thread1 = new Thread(new ThreadStart(obj.Method2)); thread1.Start(); + + Thread thread2 = new Thread(new ThreadStart(obj.Method3)); + thread2.Start(); + Console.WriteLine("Hello World!"); } @@ -186,6 +190,23 @@ } + void Method3() + { + while (true) + { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; + var dbContextOptionBuilder = new DbContextOptionsBuilder<WebCrawlerContext>(); + var cccontext = new WebCrawlerContext(dbContextOptionBuilder.UseSqlServer(connection).Options); + + //var dbContextOptionBuilder1 = new DbContextOptionsBuilder<zhengcaioaContext>(); + //var cccontext1 = new zhengcaioaContext(dbContextOptionBuilder1.UseSqlServer(connection1).Options); + + //鑾峰彇涓浗鏀块噰缃戠殑鍥涘窛鏀块噰鏁版嵁 + CcgpSichuanoperation.operations(cccontext); + Thread.CurrentThread.Join(1000 * 60 * 10);//闃绘璁惧畾鏃堕棿 + } + } + -- Gitblit v1.9.1