Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
Kookaku
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
Kookaku
Commits
68e94102
Commit
68e94102
authored
Jun 15, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化部分功能
parent
5d8a0cf6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
.suo
.vs/kookaku/v16/.suo
+0
-0
Form1.Designer.cs
robot/Form1.Designer.cs
+3
-2
Form1.cs
robot/Form1.cs
+19
-2
No files found.
.vs/kookaku/v16/.suo
View file @
68e94102
No preview for this file type
robot/Form1.Designer.cs
View file @
68e94102
...
@@ -32,9 +32,10 @@
...
@@ -32,9 +32,10 @@
//
//
// Form1
// Form1
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17
F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
9F
,
20
F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
228
,
69
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
293
,
81
);
this
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
4
,
4
,
4
,
4
);
this
.
Name
=
"Form1"
;
this
.
Name
=
"Form1"
;
this
.
Opacity
=
0D
;
this
.
Opacity
=
0D
;
this
.
ShowIcon
=
false
;
this
.
ShowIcon
=
false
;
...
...
robot/Form1.cs
View file @
68e94102
...
@@ -103,6 +103,7 @@ namespace robot
...
@@ -103,6 +103,7 @@ namespace robot
Thread
thread
=
new
Thread
(
CkeckUploadFailed
);
Thread
thread
=
new
Thread
(
CkeckUploadFailed
);
thread
.
IsBackground
=
true
;
thread
.
IsBackground
=
true
;
thread
.
Start
();
thread
.
Start
();
//OpenCamera();
}
}
public
void
connectionServer
()
public
void
connectionServer
()
...
@@ -169,6 +170,19 @@ namespace robot
...
@@ -169,6 +170,19 @@ namespace robot
//TODO: 启动进程
//TODO: 启动进程
if
(
websocket
.
State
!=
WebSocketState
.
Open
&&
websocket
.
State
!=
WebSocketState
.
Connecting
)
if
(
websocket
.
State
!=
WebSocketState
.
Open
&&
websocket
.
State
!=
WebSocketState
.
Connecting
)
{
{
keybd_event
((
byte
)
Keys
.
F7
,
0
,
0
,
0
);
Thread
.
Sleep
(
5000
);
Process
[]
processes
=
Process
.
GetProcessesByName
(
"Captura"
);
foreach
(
Process
p
in
processes
)
{
//执行kill命令
p
.
Kill
();
//等待被杀死的进程退出
p
.
WaitForExit
();
//跳出foreach循环,可有可无
break
;
}
System
.
Environment
.
Exit
(
0
);
System
.
Environment
.
Exit
(
0
);
//connectionServer();
//connectionServer();
}
}
...
@@ -196,7 +210,6 @@ namespace robot
...
@@ -196,7 +210,6 @@ namespace robot
Thread
.
Sleep
(
5000
);
Thread
.
Sleep
(
5000
);
Process
[]
processes
=
Process
.
GetProcessesByName
(
"Captura"
);
Process
[]
processes
=
Process
.
GetProcessesByName
(
"Captura"
);
//在进程列表中查找指定的QQ进程
foreach
(
Process
p
in
processes
)
foreach
(
Process
p
in
processes
)
{
{
//执行kill命令
//执行kill命令
...
@@ -260,6 +273,7 @@ namespace robot
...
@@ -260,6 +273,7 @@ namespace robot
File
.
Delete
(
uploadTempPath
);
File
.
Delete
(
uploadTempPath
);
File
.
Delete
(
video
.
LocalFilePath
);
File
.
Delete
(
video
.
LocalFilePath
);
websocket
.
Send
(
$"UPLOAD_VIDEO_RESULT:
{
video
.
VideoId
}
"
);
}
}
public
static
void
CkeckUploadFailed
()
public
static
void
CkeckUploadFailed
()
...
@@ -505,7 +519,10 @@ namespace robot
...
@@ -505,7 +519,10 @@ namespace robot
var
videoDevices
=
new
FilterInfoCollection
(
FilterCategory
.
VideoInputDevice
);
var
videoDevices
=
new
FilterInfoCollection
(
FilterCategory
.
VideoInputDevice
);
foreach
(
FilterInfo
device
in
videoDevices
)
foreach
(
FilterInfo
device
in
videoDevices
)
{
{
devs
.
Add
(
device
.
Name
);
if
(!
device
.
Name
.
Equals
(
"OBS Virtual Camera"
))
{
devs
.
Add
(
device
.
Name
);
}
}
}
...
...
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