-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bef87d7
commit a060ebf
Showing
15 changed files
with
378 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup><requestedExecutionLevel level="asInvoker" uiAccess="false" /> | ||
</configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Namespace My | ||
' MyApplication 可以使用下列事件: | ||
' Startup:在應用程式啟動時,但尚未建立啟動表單之前引發。 | ||
' Shutdown:在所有應用程式表單關閉之後引發。如果應用程式不正常終止,就不會引發此事件。 | ||
' UnhandledException:在應用程式發生未處理的例外狀況時引發。 | ||
' StartupNextInstance:在啟動單一執行個體應用程式且應用程式已於使用中時引發。 | ||
' NetworkAvailabilityChanged:在建立或中斷網路連線時引發。 | ||
Partial Friend Class MyApplication | ||
End Class | ||
End Namespace |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
Imports System.IO | ||
Imports System.Net | ||
|
||
Public Class KILLTWG_form | ||
Private Sub Setup() Handles Me.Activated | ||
KILLTWGver_linklabel.Text = AppVersion() | ||
StatusValue() | ||
End Sub | ||
Function AppVersion() | ||
Try | ||
Dim request As HttpWebRequest = WebRequest.Create("https://api.github.com/repos/Anonymous-AAAA/KILLTWG-App/releases/latest") | ||
request.Method = "GET" | ||
request.UserAgent = "request" | ||
Dim response As WebResponse = request.GetResponse() | ||
Dim dataStream = response.GetResponseStream() | ||
Dim reader As New StreamReader(dataStream) | ||
Dim responseFromServer As String = reader.ReadToEnd() | ||
reader.Close() | ||
dataStream.Close() | ||
response.Close() | ||
Return Mid(responseFromServer, InStr(responseFromServer, """tag_name""") + 12, InStr(responseFromServer, """target_commitish""") - InStr(responseFromServer, """tag_name""") - 14) | ||
Catch ex As Exception | ||
Return "Can't get latest version" | ||
Exit Try | ||
End Try | ||
End Function | ||
|
||
Public Sub StatusValue() | ||
If Process.GetProcessesByName("REDAgent").Count > 0 Then | ||
StatusValue_label.Text = "ON" | ||
StatusValue_label.ForeColor = Color.Green | ||
Else | ||
StatusValue_label.Text = "OFF" | ||
StatusValue_label.ForeColor = Color.Red | ||
End If | ||
End Sub | ||
Private Sub KILL_Click(sender As Object, e As EventArgs) Handles KILL_button.Click | ||
Try | ||
Dim dir = My.Computer.FileSystem.GetDirectories("C:\Program Files (x86)\TWG")(0) | ||
My.Computer.FileSystem.RenameDirectory(dir, "Classroom") | ||
Catch ex As Exception | ||
Exit Try | ||
End Try | ||
Try | ||
If Process.GetProcessesByName("REDAgent").Count > 0 Then | ||
For Each proc As Process In Process.GetProcessesByName("REDAgent") | ||
proc.Kill() | ||
Next | ||
Threading.Thread.Sleep(100) | ||
StatusValue() | ||
Else | ||
StatusValue_label.Text = "OFF" | ||
StatusValue_label.ForeColor = Color.Red | ||
End If | ||
Catch ex As Exception | ||
Exit Try | ||
End Try | ||
End Sub | ||
|
||
Private Sub RESUME_button_Click(sender As Object, e As EventArgs) Handles RESUME_button.Click | ||
Try | ||
Dim dir = My.Computer.FileSystem.GetDirectories("C:\Program Files (x86)\TWG")(0) | ||
My.Computer.FileSystem.RenameDirectory(dir, "eClassroom") | ||
Catch ex As Exception | ||
Exit Try | ||
End Try | ||
Threading.Thread.Sleep(200) | ||
Try | ||
If Process.GetProcessesByName("REDAgent").Count = 0 Then | ||
Dim redagent As New ProcessStartInfo With { | ||
.FileName = "C:\Program Files (x86)\TWG\eClassroom\REDAgent.exe" | ||
} | ||
Dim redagentStats = Process.Start(redagent) | ||
Threading.Thread.Sleep(100) | ||
StatusValue() | ||
Else | ||
StatusValue_label.Text = "ON" | ||
StatusValue_label.ForeColor = Color.Green | ||
End If | ||
Catch ex As Exception | ||
Exit Try | ||
End Try | ||
End Sub | ||
|
||
Private Sub KILLTWGver_linklabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles KILLTWGver_linklabel.LinkClicked | ||
If AppVersion() <> "Can't get latest version" Then | ||
Process.Start("https://github.com/Anonymous-AAAA/KILLTWG-App/releases/tag/" + AppVersion()) | ||
Else | ||
Process.Start("https://www.youtube.com/watch?v=dQw4w9WgXcQ") | ||
End If | ||
End Sub | ||
|
||
Private Sub WrittenBy_linklabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles WrittenBy_linklabel.LinkClicked | ||
Process.Start("https://github.com/Anonymous-AAAA") | ||
End Sub | ||
|
||
Private Sub GithubRepo_linklabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles GithubRepo_linklabel.LinkClicked | ||
Process.Start("https://github.com/Anonymous-AAAA/KILLTWG-App") | ||
End Sub | ||
End Class |
Oops, something went wrong.