| | |
| | | thread.Start(); |
| | | |
| | | |
| | | //Thread thread1 = new Thread(new ThreadStart(obj.Method2)); |
| | | //thread1.Start(); |
| | | Thread thread1 = new Thread(new ThreadStart(obj.Method2)); |
| | | thread1.Start(); |
| | | |
| | | |
| | | //Thread thread2 = new Thread(new ThreadStart(obj.Method3)); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | void Method2() |
| | | { |
| | | while (true) |
| | | { |
| | | //ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; |
| | | var dbContextOptionBuilder = new DbContextOptionsBuilder<WebCrawlerContext>(); |
| | | var cccontext = new WebCrawlerContext(dbContextOptionBuilder.UseSqlServer(connection2).Options); |
| | | |
| | | //var dbContextOptionBuilder1 = new DbContextOptionsBuilder<zhengcaioaContext>(); |
| | | //var cccontext1 = new zhengcaioaContext(dbContextOptionBuilder1.UseSqlServer(connection1).Options); |
| | | |
| | | sichuantousuoperation.operations1(cccontext); |
| | | //Console.WriteLine("这个暂停"); |
| | | Thread.CurrentThread.Join(1000 * 60 * 60 * 2);//阻止设定时间 |
| | | } |
| | | } |
| | | |
| | | //void Method1() |
| | | //{ |
| | | // while (true) |