Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EduSpider
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
EduSpider
Commits
3c1435a8
Commit
3c1435a8
authored
May 24, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移除文件
parent
04a24e06
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
51 deletions
+0
-51
.suo
.vs/TicketSpider/v17/.suo
+0
-0
CityService.cs
Spiders/CityService.cs
+0
-51
No files found.
.vs/TicketSpider/v17/.suo
View file @
3c1435a8
No preview for this file type
Spiders/CityService.cs
deleted
100644 → 0
View file @
04a24e06
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
TicketSpider.Model
;
namespace
TicketSpider.Spiders
{
public
class
CityService
{
public
static
List
<
City
>
CITIES
=
new
List
<
City
>();
public
static
bool
Load
()
{
string
cityJsonFile
=
Environment
.
CurrentDirectory
+
"\\zh_CN.json"
;
if
(
File
.
Exists
(
cityJsonFile
))
{
using
(
StreamReader
file
=
File
.
OpenText
(
cityJsonFile
))
{
using
(
JsonTextReader
reader
=
new
JsonTextReader
(
file
))
{
try
{
var
o
=
(
JArray
)
JToken
.
ReadFrom
(
reader
);
CITIES
=
JsonConvert
.
DeserializeObject
<
List
<
City
>>(
JsonConvert
.
SerializeObject
(
o
));
return
true
;
}
catch
(
Exception
){
}
}
}
}
return
false
;
}
public
static
City
?
GetCityHandler
(
string
city
)
{
return
CITIES
.
Where
(
x
=>
x
.
cityName
==
city
).
FirstOrDefault
();
}
public
static
bool
Container
(
string
city
)
{
return
CITIES
.
Where
(
x
=>
x
.
cityName
==
city
).
Count
()
>
0
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment