Commit e540b712 authored by 罗超's avatar 罗超

变更框架

parent e729ebc3
Pipeline #132 failed with stages
...@@ -6,6 +6,7 @@ using System.Collections.Generic; ...@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using TicketSpider.Model; using TicketSpider.Model;
using TicketSpider.Spiders.EasterLineRule; using TicketSpider.Spiders.EasterLineRule;
......
This diff is collapsed.
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
......
...@@ -8,9 +8,12 @@ using System.Collections.Generic; ...@@ -8,9 +8,12 @@ using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Http;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace TicketSpider.Spiders.EasterLineRule namespace TicketSpider.Spiders.EasterLineRule
......
...@@ -4,6 +4,7 @@ using System; ...@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using TicketSpider.Model; using TicketSpider.Model;
......
...@@ -4,8 +4,10 @@ using System; ...@@ -4,8 +4,10 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Http;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using TicketSpider.Data; using TicketSpider.Data;
using TicketSpider.Uitls; using TicketSpider.Uitls;
...@@ -73,23 +75,23 @@ namespace TicketSpider.Spiders.EasterLineRule ...@@ -73,23 +75,23 @@ namespace TicketSpider.Spiders.EasterLineRule
{ {
Console.WriteLine("未找到机票"); Console.WriteLine("未找到机票");
var newCookies = result.cookies.Split(';',StringSplitOptions.RemoveEmptyEntries); //var newCookies = result.cookies.Split(';',StringSplitOptions.RemoveEmptyEntries);
if (newCookies.Any()) //if (newCookies.Any())
{ //{
var uri = new Uri("https://www.ceair.com"); // var uri = new Uri("https://www.ceair.com");
foreach (var cookie in newCookies) // foreach (var cookie in newCookies)
{ // {
var haveCookies = cookieContainer.GetAllCookies().Where(x => x.Name == cookie.Split("=")[0]); // var haveCookies = cookieContainer.GetAllCookies().Where(x => x.Name == cookie.Split("=")[0]);
if (haveCookies.Any()) // if (haveCookies.Any())
{ // {
haveCookies.First().Value = cookie.Split("=")[1]; // haveCookies.First().Value = cookie.Split("=")[1];
} // }
else // else
{ // {
cookieContainer.SetCookies(uri, cookie); // cookieContainer.SetCookies(uri, cookie);
} // }
} // }
} //}
//TODO 切换代理 //TODO 切换代理
} }
......
...@@ -4,7 +4,9 @@ using System; ...@@ -4,7 +4,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Http;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using TicketSpider.Model; using TicketSpider.Model;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace TicketSpider.Uitls namespace TicketSpider.Uitls
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment