From d4431c7e89865a506af8662244004d0baa7ed609 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期三, 11 六月 2025 12:24:15 +0800
Subject: [PATCH] 投诉处理,爬

---
 zhengcaioa/Crawler/Program.cs |  107 ++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 84 insertions(+), 23 deletions(-)

diff --git a/zhengcaioa/Crawler/Program.cs b/zhengcaioa/Crawler/Program.cs
index b992baf..e7394ab 100644
--- a/zhengcaioa/Crawler/Program.cs
+++ b/zhengcaioa/Crawler/Program.cs
@@ -1,11 +1,15 @@
-锘縰sing Crawler.sichuan;
+锘縰sing AngleSharp.Html.Parser;
+using Crawler.sichuan;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.DependencyInjection;
 using Newtonsoft.Json;
 using OpenQA.Selenium;
 using OpenQA.Selenium.Chrome;
 using System;
+using System.Linq;
+using System.Net;
 using System.Net.Http;
+using System.Net.Http.Headers;
 using System.Threading;
 using zhengcaioa.Models;
 
@@ -13,11 +17,21 @@
 {
     class Program
     {
+
+        //public static string connection = @"server=.;database=WebCrawler;uid=sa;pwd=123456;";
+        //public static string connection1 = @"server=.;database=zhengcaioa;uid=sa;pwd=123456;";
+        //public static string connection2 = @"server=.;database=FZCZTB;uid=sa;pwd=123456;";
+        //public static string api_domain = "http://192.168.0.9:9200";
+
+        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 connection2 = @"server=172.26.97.184;database=FZCZTB;uid=sa;pwd=Za20222812;";
+        public static string api_domain = "http://172.26.97.184:9200";
         static void Main(string[] args)
         {
-           
 
 
+       
 
 
 
@@ -128,43 +142,90 @@
 
             Program obj = new Program();
             //鏂规硶涓�锛氳皟鐢ㄧ嚎绋嬫墽琛屾柟娉曪紝鍦ㄦ柟娉曚腑瀹炵幇姝诲惊鐜紝姣忎釜寰幆Sleep璁惧畾鏃堕棿
-            Thread thread = new Thread(new ThreadStart(obj.Method1));
+            Thread thread = new Thread(new ThreadStart(obj.Method));
             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));
+            //thread2.Start();
 
             Console.WriteLine("Hello World!");
         }
 
-        void Method1()
+        void Method()
         {
             while (true)
             {
-                string connection = @"server=.;database=WebCrawler;uid=sa;pwd=123456;";
+                //ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                 var dbContextOptionBuilder = new DbContextOptionsBuilder<WebCrawlerContext>();
-                var cccontext = new WebCrawlerContext(dbContextOptionBuilder.UseSqlServer(connection).Options);
-                //鑾峰彇鍥涘窛鐨勬斂閲囨暟鎹�
-                sichuanoperation.operations(cccontext);
-                //Console.WriteLine("杩欎釜鏆傚仠");
-                Thread.CurrentThread.Join(1000*60*60*2);//闃绘璁惧畾鏃堕棿
-            }
-        }
+                var cccontext = new WebCrawlerContext(dbContextOptionBuilder.UseSqlServer(connection2).Options);
 
-        void Method2()
-        {
-            while (true)
-            {
-                string connection = @"server=.;database=WebCrawler;uid=sa;pwd=123456;";
-                var dbContextOptionBuilder = new DbContextOptionsBuilder<WebCrawlerContext>();
-                var cccontext = new WebCrawlerContext(dbContextOptionBuilder.UseSqlServer(connection).Options);
-                //鑾峰彇鍥涘窛鐨勬斂閲囨暟鎹�
-                OldSichuanoperation.operations(cccontext);
+                //var dbContextOptionBuilder1 = new DbContextOptionsBuilder<zhengcaioaContext>();
+                //var cccontext1 = new zhengcaioaContext(dbContextOptionBuilder1.UseSqlServer(connection1).Options);
+
+                //鑾峰彇鍥涘窛鐨勬姇璇夊鐞嗘暟鎹�
+                sichuantousuoperation.operations(cccontext);
+                //Console.WriteLine("杩欎釜鏆傚仠");
                 Thread.CurrentThread.Join(1000 * 60 * 60 * 2);//闃绘璁惧畾鏃堕棿
             }
         }
 
+        //void Method1()
+        //{
+        //    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);
+
+        //        //鑾峰彇鍥涘窛鐨勬斂閲囨暟鎹�
+        //        sichuanoperation.operations(cccontext, cccontext1);
+        //        //Console.WriteLine("杩欎釜鏆傚仠");
+        //        Thread.CurrentThread.Join(1000 * 60 * 60 * 2);//闃绘璁惧畾鏃堕棿
+        //    }
+        //}
+
+        //void Method2()
+        //{
+        //    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);
+
+        //        //鑾峰彇鍥涘窛鐨勬斂閲囨暟鎹�
+        //        OldSichuanoperation.operations(cccontext, cccontext1);
+        //        Thread.CurrentThread.Join(1000 * 60 * 60 * 2);//闃绘璁惧畾鏃堕棿
+        //    }
+        //}
+
+
+        //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