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
703a941d
Commit
703a941d
authored
Sep 09, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
eba90070
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
136 deletions
+136
-136
Program.cs
EduSpider/Program.cs
+0
-55
ClassInAccountManager.cs
EduSpider/Spiders/ClassInRule/ClassInAccountManager.cs
+136
-81
No files found.
EduSpider/Program.cs
View file @
703a941d
...
...
@@ -54,60 +54,5 @@ namespace EduSpider
Console
.
ReadLine
();
Environment
.
Exit
(
0
);
}
#
region
异常
退出
chromedriver
[
DllImport
(
"user32.dll"
,
EntryPoint
=
"FindWindow"
)]
private
extern
static
IntPtr
FindWindow
(
string
lpClassName
,
string
lpWindowName
);
[
DllImport
(
"user32.dll"
,
EntryPoint
=
"SendMessage"
)]
public
static
extern
int
SendMessage
(
IntPtr
hWnd
,
int
Msg
,
int
wParam
,
int
lParam
);
public
const
int
SW_HIDE
=
0
;
public
const
int
SW_SHOW
=
5
;
[
DllImport
(
"user32.dll"
,
EntryPoint
=
"ShowWindow"
)]
public
static
extern
int
ShowWindow
(
IntPtr
hwnd
,
int
nCmdShow
);
/// <summary>
/// 获取窗口句柄
/// </summary>
/// <returns></returns>
public
IntPtr
GetWindowHandle
()
{
string
name
=
(
Environment
.
CurrentDirectory
+
"\\chromedriver.exe"
);
IntPtr
hwd
=
FindWindow
(
null
,
name
);
return
hwd
;
}
/// <summary>
/// 关闭chromedriver窗口
/// </summary>
public
void
CloseWindow
()
{
try
{
IntPtr
hwd
=
GetWindowHandle
();
SendMessage
(
hwd
,
0x10
,
0
,
0
);
}
catch
{
}
}
/// <summary>
/// 退出chromedriver
/// </summary>
/// <param name="driver"></param>
public
void
CloseChromeDriver
(
IWebDriver
driver
)
{
try
{
driver
.
Quit
();
driver
.
Dispose
();
}
catch
{
}
CloseWindow
();
}
#
endregion
异常
退出
chromedriver
}
}
\ No newline at end of file
EduSpider/Spiders/ClassInRule/ClassInAccountManager.cs
View file @
703a941d
This diff is collapsed.
Click to expand it.
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