Imports System.Net Imports System.Text Imports System.IO Imports Microsoft.Win32 Imports System.ComponentModel Public Class SoftSub #Region "UI" #Region " Move Form " ' [ Move Form ] ' ' // By Elektro Public MoveForm As Boolean Public MoveForm_MousePosition As Point Public Sub MoveForm_MouseDown(sender As Object, e As MouseEventArgs) Handles _ MyBase.MouseDown ' Add more handles here (Example: PictureBox1.MouseDown) If e.Button = MouseButtons.Left Then MoveForm = True Me.Cursor = Cursors.NoMove2D MoveForm_MousePosition = e.Location End If End Sub Public Sub MoveForm_MouseMove(sender As Object, e As MouseEventArgs) Handles _ MyBase.MouseMove ' Add more handles here (Example: PictureBox1.MouseMove) If MoveForm Then Me.Location = Me.Location + (e.Location - MoveForm_MousePosition) End If End Sub Public Sub MoveForm_MouseUp(sender As Object, e As MouseEventArgs) Handles _ MyBase.MouseUp ' Add more handles here (Example: PictureBox1.MouseUp) If e.Button = MouseButtons.Left Then MoveForm = False Me.Cursor = Cursors.Default End If End Sub #End Region Private Sub PictureBox2_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox2.MouseEnter PictureBox2.Image = My.Resources.download_subs_hover End Sub Private Sub PictureBox2_MouseLeave(sender As Object, e As EventArgs) Handles PictureBox2.MouseLeave PictureBox2.Image = My.Resources.download_subs End Sub Private Sub pictureBox4_MouseEnter(sender As Object, e As EventArgs) Handles pictureBox4.MouseEnter pictureBox4.Image = My.Resources.crdSettings_Button_SafeExit_hover End Sub Private Sub pictureBox4_MouseLeave(sender As Object, e As EventArgs) Handles pictureBox4.MouseLeave pictureBox4.Image = My.Resources.crdSettings_Button_SafeExit End Sub Private Sub pictureBox1_MouseEnter(sender As Object, e As EventArgs) Handles pictureBox1.MouseEnter pictureBox1.BackColor = SystemColors.Control End Sub Private Sub pictureBox1_MouseLeave(sender As Object, e As EventArgs) Handles pictureBox1.MouseLeave pictureBox1.BackColor = Color.Transparent End Sub Private Sub textBox1_Click(sender As Object, e As EventArgs) Handles textBox1.Click If textBox1.Text = "URL" Then textBox1.Text = Nothing End If End Sub #End Region Dim LocalSoftSubs As New List(Of String) Private Sub pictureBox1_Click(sender As Object, e As EventArgs) Handles pictureBox1.Click Me.Close() End Sub Private Sub pictureBox4_Click(sender As Object, e As EventArgs) Handles pictureBox4.Click Main.SoftSubs.Clear() If CBdeDE.Checked = True Then Main.SoftSubs.Add("deDE") End If If CBenUS.Checked = True Then Main.SoftSubs.Add("enUS") End If If CBptBR.Checked = True Then Main.SoftSubs.Add("ptBR") End If If CBesLA.Checked = True Then Main.SoftSubs.Add("esLA") End If If CBfrFR.Checked = True Then Main.SoftSubs.Add("frFR") End If If CBarME.Checked = True Then Main.SoftSubs.Add("arME") End If If CBruRU.Checked = True Then Main.SoftSubs.Add("ruRU") End If If CBitIT.Checked = True Then Main.SoftSubs.Add("itIT") End If If CBesES.Checked = True Then Main.SoftSubs.Add("esES") End If Dim SaveString As String = Nothing For ii As Integer = 0 To Main.SoftSubs.Count - 1 If SaveString = Nothing Then SaveString = Main.SoftSubs(ii) Else SaveString = SaveString + "," + Main.SoftSubs(ii) End If Next If SaveString = Nothing Then SaveString = "none" End If Dim rk As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\CRDownloader") rk.SetValue("AddedSubs", SaveString, RegistryValueKind.String) Me.Close() End Sub Private Sub SoftSubs_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.Icon = My.Resources.icon Me.Location = New Point(Main.Location.X + Main.Width / 2 - Me.Width / 2, Main.Location.Y + Main.Height / 2 - Me.Height / 2) For i As Integer = 0 To Main.SoftSubs.Count - 1 If Main.SoftSubs(i) = "deDE" Then CBdeDE.Checked = True ElseIf Main.SoftSubs(i) = "enUS" Then CBenUS.Checked = True ElseIf Main.SoftSubs(i) = "ptBR" Then CBptBR.Checked = True ElseIf Main.SoftSubs(i) = "esLA" Then CBesLA.Checked = True ElseIf Main.SoftSubs(i) = "frFR" Then CBfrFR.Checked = True ElseIf Main.SoftSubs(i) = "arME" Then CBarME.Checked = True ElseIf Main.SoftSubs(i) = "ruRU" Then CBruRU.Checked = True ElseIf Main.SoftSubs(i) = "itIT" Then CBitIT.Checked = True ElseIf Main.SoftSubs(i) = "esES" Then CBesES.Checked = True End If Next End Sub Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click Try LocalSoftSubs.Clear() If CBdeDE.Checked = True Then LocalSoftSubs.Add("deDE") End If If CBenUS.Checked = True Then LocalSoftSubs.Add("enUS") End If If CBptBR.Checked = True Then LocalSoftSubs.Add("ptBR") End If If CBesLA.Checked = True Then LocalSoftSubs.Add("esLA") End If If CBfrFR.Checked = True Then LocalSoftSubs.Add("frFR") End If If CBarME.Checked = True Then LocalSoftSubs.Add("arME") End If If CBruRU.Checked = True Then LocalSoftSubs.Add("ruRU") End If If CBitIT.Checked = True Then LocalSoftSubs.Add("itIT") End If If CBesES.Checked = True Then LocalSoftSubs.Add("esES") End If Catch ex As Exception MsgBox(ex.ToString) End Try If LocalSoftSubs.Count > 0 Then If CBool(InStr(textBox1.Text, "crunchyroll.com")) Then GeckoFX.WebBrowser1.Navigate(textBox1.Text) GeckoFX.c = False Label2.Text = "Status: looking for sub file" PictureBox2.Visible = False End If Else 'Label2.Text = "Status: Error - nothing selected" MsgBox("Error: no language selected", MsgBoxStyle.Information, "CRD Subtitel") PictureBox2.Visible = True End If End Sub Public Sub DownloadSubs() Try #Region "Name + Pfad" Dim NameTextBox As Boolean = False Dim Pfad2 As String Dim CR_FilenName As String Dim Bug_Deutsch As String = "-" Dim CR_Anime_Titel As String Dim CR_Anime_Staffel As String Dim CR_Anime_Folge As String 'Dim CR_Name_by_Titel As String() = GeckoFX.WebBrowser1.Document.Body.OuterHtml.Split(New String() {"