username@email.com
2022-12-01 db227144dedfb5fb5b1e94e8c8b14eab9eb7462f
zhengcaioa/Crawler/Program.cs
@@ -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 * 60 * 2);//阻止设定时间
            }
        }