Commit e540b712 authored by 罗超's avatar 罗超

变更框架

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