![]() |
File encryption center - Main.vb |
Main.vb
- Public Class Main
- Dim MyName As String = My.Application.Info.AssemblyName
- Dim MyDir As String = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) & "\" & MyName
- '16 Byte - Array :
- Dim IntialCryptBytes() As Byte = {115, 63, 40, 66, 225, 205, 99, 160, 199, 185, 180, 170, 160, 39, 10, 1}
- '64 Byte - Array :
- Dim FinalCryptBytes() As Byte = {231, 35, 0, 63, 225, 113, 3, 160, 12, 185, 180, 170, 160, 73, 10, 1, 115, 98, 75, 66, 225, 205, 99, 160, 199, 185, 180, 170, 95, 39, 10, 68, 115, 4, 40, 211, 225, 205, 99, 160, 24, 185, 180, 170, 160, 39, 10, 1, 115, 69, 40, 66, 225, 25, 221, 160, 199, 185, 180, 170, 160, 39, 10, 253}
- '64 Byte - Array :
- Dim SerialNumberBytes(64) As Byte
- 'My Dims :
- Dim Addad As Integer = 0
- Dim AnimateX As Integer = 0
- Dim AnimateY As Integer = 0
- Dim MyOpacity As Integer = 0
- Dim MyCommand As String = "Crypt"
- Dim BytesAdder As Double = 0
- Dim SettingsPath As String = MyDir
- Dim CryptFileName As Boolean = False
- Dim LocalFileName As String = ""
- Dim ExitBecauseNotFound As Boolean = False
- Dim AlphaArr() As String = {"ا", "أ", "إ", "ئ", "ء", "ى", "ة", "ؤ", "ب", "ت", "ث", "ج", "ح", "خ", "د", "ذ", "ر", "ز", "س", "ش", "ص", "ض", "ط", "ظ", "ع", "غ", "ف", "ق", "ك", "ل", "م", "ن", "ه", "و", "ي", "لا", "ّ", "َ", "ً", "ُ", "ٌ", "لإ", "‘", "÷", "؛", "ِ", "ٍ", "[", "]", "لأ", "أ", "ـ", "،", "~", "ْ", "{", "}", "لآ", "آ", "’", ".", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", ",", ".", ";", "'", "[", "]", "!", "@", "#", "$", "%", "^", "&", "(", ")", "-", "=", "_", "+", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " "}
- Dim CryptArr() As String = {"ỹ", "╬", "ỷ", "╫", "ỵ", "╪", "ỳ", "╩", "ự", "╨", "ữ", "╧", "ử", "╦", "ừ", "╥", "ứ", "╤", "ủ", "╣", "ụ", "╢", "ợ", "╡", "ỡ", "╠", "ở", "╟", "ờ", "╞", "ớ", "╝", "ộ", "╛", "ỗ", "╚", "ổ", "╙", "ồ", "╘", "ố", "╗", "ỏ", "╖", "ọ", "╕", "ị", "╔", "ỉ", "╓", "ệ", "╒", "ễ", "║", "ể", "═", "ề", "┼", "ế", "┴", "ẽ", "┬", "ẻ", "┤", "ẹ", "├", "ặ", "┘", "ẵ", "└", "ẳ", "┐", "ằ", "┌", "ắ", "│", "ậ", "─", "ẫ", "◦", "ẩ", "◙", "ầ", "◘", "ấ", "●", "ả", "○", "ạ", "◊", "ẅ", "◄", "ẃ", "▼", "ẁ", "►", "ə", "▲", "Ǿ", "▬", "Ǽ", "▫", "Ǻ", "▪", "Ǜ", "□", "Ǚ", "■", "Ǘ", "▓", "Ǖ", "▒", "Ǔ", "░", "Ǒ", "▐", "Ǐ", "▌", "Ǎ", "█", "Ư", "▄", "Ơ", "ƒ", "☺", "☻", "ž", "▀", "ż", "♫", "ź", "♪", "Ÿ", "♦", "Ŷ", "♥", "ŵ", "♣", "ų", "♠", "ű", "☼", "¤"}
- Dim Clossing As Boolean = False
- Private Sub Main_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
- If Clossing = False Then
- e.Cancel = True
- If MsgBox("هل ترغب حقاً بإنهاء البرنامج ؟", MsgBoxStyle.YesNo, MyName) = MsgBoxResult.Yes Then
- Clossing = True
- End
- End If
- End If
- End Sub
- Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- On Error Resume Next
- If My.Computer.FileSystem.FileExists(MyDir & "\" & MyName & ".exe") = False Then
- Setup.Show()
- Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
- Me.ShowInTaskbar = False
- Me.Width = 1
- Me.Height = 1
- GoTo EndPoint
- End If
- Me.MaximizeBox = False
- Me.Text = MyName
- MyInfoLBL.Text = MyName & System.Environment.NewLine & My.Application.Info.Version.ToString
- If My.Computer.FileSystem.FileExists(SettingsPath & "\wrongpass.dll") = False Then
- SetValues()
- End If
- ReadValues()
- DragList.CopyNJWMGetLink()
- If Microsoft.VisualBasic.Command <> "" Then
- If Microsoft.VisualBasic.Command.ToLower.Contains("/list /") = True Then
- 'We Have List File :
- Dim TargetName As String = Microsoft.VisualBasic.Command.Replace("/list /", "")
- Me.Top = 50
- DragList.Show()
- Main_Move(sender, e)
- DragList.LoadLISTExtention(TargetName)
- Else
- 'We Have Normal Files :
- Dim TargetName As String = Microsoft.VisualBasic.Command
- If My.Computer.FileSystem.DirectoryExists(TargetName) = True Then
- PathTXT.Text = My.Computer.FileSystem.GetDirectoryInfo(TargetName).FullName
- ElseIf My.Computer.FileSystem.FileExists(TargetName) = True Then
- PathTXT.Text = My.Computer.FileSystem.GetFileInfo(TargetName).FullName
- ElseIf TargetName = "/إزالة" Then
- Setting.RemoveProgram(sender, e)
- Else
- PathTXT.Text = TargetName & " !!"
- End If
- PathTXT.ForeColor = Color.Black
- PathTXT.TextAlign = HorizontalAlignment.Left
- End If
- End If
- EndPoint:
- End Sub
- Public Sub GetFiles()
- On Error Resume Next
- InfoLBL.Text = "تحليل مسار ، إنتظر قليلاً"
- AllFiles.Items.Clear()
- If My.Computer.FileSystem.DirectoryExists(PathTXT.Text) = True Then
- AllFiles.Items.AddRange(System.IO.Directory.GetFiles(PathTXT.Text, "*.*", IO.SearchOption.AllDirectories))
- ElseIf My.Computer.FileSystem.FileExists(PathTXT.Text) = True Then
- AllFiles.Items.Add(PathTXT.Text)
- Else
- MsgBox("عذراً ، لكن المسار المكتوب في مربع المسارات غير موجود ... تأكد من صحة المسار", MsgBoxStyle.OkOnly, MyName)
- ExitBecauseNotFound = True
- End If
- End Sub
- Private Sub Manager_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Manager.Tick
- On Error Resume Next
- Dim MyValueProcess As Integer = 0
- If Addad > 0 Then MyValueProcess = Int((Addad * 100) / (AllFiles.Items.Count - 1))
- Me.Text = MyName & "-" & MyValueProcess & " %"
- BytesAdder = BytesAdder + (My.Computer.FileSystem.GetFileInfo(AllFiles.Items.Item(Addad)).Length / 1048576)
- BytesAdder = BytesAdder + 0.00010000001
- If BytesAdder > 1000 Then
- InfoLBL.Text = "تم إنجاز : " & Str(Int(BytesAdder) / 1000).Chars(0) & Str(Int(BytesAdder) / 1000).Chars(1) & Str(Int(BytesAdder) / 1000).Chars(2) & Str(Int(BytesAdder) / 1000).Chars(3) & Str(Int(BytesAdder) / 1000).Chars(4) & " غيغابايت ."
- Else
- InfoLBL.Text = "تم إنجاز : " & Str(BytesAdder).Chars(0) & Str(BytesAdder).Chars(1) & Str(BytesAdder).Chars(2) & Str(BytesAdder).Chars(3) & Str(BytesAdder).Chars(4) & Str(BytesAdder).Chars(5) & Str(BytesAdder).Chars(6) & " ميغابايت ."
- End If
- If MyValueProcess > -1 Then Bar.Value = MyValueProcess
- Dim MyArr() As Byte = My.Computer.FileSystem.ReadAllBytes(AllFiles.Items.Item(Addad))
- Dim TestingByte(15) As Byte
- For Indixer As Integer = 15 To 0 Step -1
- TestingByte(Indixer) = MyArr(15 - Indixer)
- Next
- For indixer As Integer = 0 To 15
- If TestingByte(indixer) <> IntialCryptBytes(indixer) Then
- GoTo CryptFile
- End If
- If indixer = 15 Then GoTo DesCryptFile
- Next
- CryptFile:
- If MyCommand.ToLower = "descrypt" Then GoTo EndPoint
- Dim NewArr(MyArr.Length + SerialNumberBytes.Length - 1 + IntialCryptBytes.Length - 1) As Byte
- Array.Copy(MyArr, NewArr, MyArr.Length)
- For NewAddad As Integer = 0 To 63
- NewArr(MyArr.Length + NewAddad) = SerialNumberBytes(NewAddad)
- Next
- For NewAddad As Integer = 0 To 15
- NewArr(MyArr.Length + SerialNumberBytes.Length - 1 + NewAddad) = IntialCryptBytes(NewAddad)
- Next
- Array.Reverse(NewArr)
- Array.Resize(NewArr, NewArr.Length + 64)
- For NewAddad As Integer = 1 To 64
- NewArr(MyArr.Length + SerialNumberBytes.Length - 1 + IntialCryptBytes.Length - 1 + NewAddad) = FinalCryptBytes(NewAddad - 1)
- Next
- LocalFileName = AllFiles.Items.Item(Addad)
- If CryptFileName = True Then CryptFileNameManager(LocalFileName)
- If My.Computer.FileSystem.FileExists(LocalFileName) = True Then System.IO.File.SetAttributes(LocalFileName, IO.FileAttributes.Normal)
- My.Computer.FileSystem.WriteAllBytes(LocalFileName, NewArr, False)
- GoTo EndPoint
- DesCryptFile:
- If MyCommand.ToLower = "crypt" Then GoTo EndPoint
- 'Testing Password :
- Dim MyPasswordTester(64) As Byte
- Dim Counter As Integer = -1
- For Indixer As Integer = 79 To 16 Step -1
- Counter = Counter + 1
- MyPasswordTester(Counter) = MyArr(Indixer)
- Next
- '...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................
- '...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................
- GoTo PassWithoutTesting
- '...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................
- '...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................
- TestKey:
- If SerialNumber.PassTXT.Text = "free Open FiLe fOR NjWM" Then GoTo PassWithoutTesting
- For indixer As Integer = 0 To 63
- If MyPasswordTester(indixer) <> SerialNumberBytes(indixer) Then
- GoTo EndPoint
- End If
- Next
- PassWithoutTesting:
- Array.Resize(MyArr, MyArr.Length - 64)
- Array.Reverse(MyArr)
- Array.Resize(MyArr, MyArr.Length - 80)
- LocalFileName = AllFiles.Items.Item(Addad)
- DesCryptFileNameManager(LocalFileName)
- If My.Computer.FileSystem.FileExists(LocalFileName) = True Then System.IO.File.SetAttributes(LocalFileName, IO.FileAttributes.Normal)
- My.Computer.FileSystem.WriteAllBytes(LocalFileName, MyArr, False)
- GoTo EndPoint
- EndPoint:
- Addad = Addad + 1
- If Addad > AllFiles.Items.Count - 1 Then
- FinishOperating()
- End If
- End Sub
- Public Sub CryptFileNameManager(ByRef FileName As String)
- On Error Resume Next
- Dim CryptName As String = My.Computer.FileSystem.GetFileInfo(LocalFileName).Name
- Dim DirName As String = My.Computer.FileSystem.GetFileInfo(LocalFileName).DirectoryName
- For MyAddad As Integer = 0 To AlphaArr.Length - 1
- CryptName = CryptName.Replace(AlphaArr(MyAddad), CryptArr(MyAddad))
- Next
- If My.Computer.FileSystem.FileExists(LocalFileName) = True Then
- System.IO.File.SetAttributes(LocalFileName, IO.FileAttributes.Normal)
- If My.Computer.FileSystem.FileExists(DirName & "\" & CryptName) = False Then
- My.Computer.FileSystem.RenameFile(LocalFileName, CryptName)
- End If
- End If
- LocalFileName = DirName & "\" & CryptName
- End Sub
- Public Sub DesCryptFileNameManager(ByRef FileName As String)
- On Error Resume Next
- Dim DesCryptName As String = My.Computer.FileSystem.GetFileInfo(LocalFileName).Name
- Dim DirName As String = My.Computer.FileSystem.GetFileInfo(LocalFileName).DirectoryName
- For MyAddad As Integer = 0 To AlphaArr.Length - 1
- DesCryptName = DesCryptName.Replace(CryptArr(MyAddad), AlphaArr(MyAddad))
- Next
- If My.Computer.FileSystem.FileExists(LocalFileName) = True Then
- System.IO.File.SetAttributes(LocalFileName, IO.FileAttributes.Normal)
- If My.Computer.FileSystem.FileExists(DirName & "\" & DesCryptName) = False Then
- My.Computer.FileSystem.RenameFile(LocalFileName, DesCryptName)
- End If
- End If
- LocalFileName = DirName & "\" & DesCryptName
- End Sub
- Public Sub FinishOperating()
- On Error Resume Next
- Me.Text = MyName
- Manager.Enabled = False
- CryptBTN.Enabled = True
- DesCryptBTN.Enabled = True
- DragList.CryptBTN.Enabled = True
- DragList.DesCryptBTN.Enabled = True
- Bar.Visible = False
- CloseBTN.Text = "إغلاق"
- Addad = 0
- Array.Clear(SerialNumberBytes, 0, SerialNumberBytes.Length - 1)
- MyCommand = ""
- AllFiles.Items.Clear()
- BytesAdder = 0
- InfoLBL.Text = ""
- PathTXT.Enabled = True
- Bar.Value = 0
- LocalFileName = ""
- MyInfoLBL.Visible = True
- End Sub
- Public Sub SetPassword(ByRef Pass As String)
- On Error Resume Next
- For NewAddad As Integer = 0 To Pass.Length - 1
- SerialNumberBytes(NewAddad) = System.Convert.ToByte(Pass.Chars(NewAddad))
- Next
- End Sub
- Public Sub SetValues()
- On Error Resume Next
- My.Computer.FileSystem.WriteAllText(SettingsPath & "\prio.dll", 2, False)
- My.Computer.FileSystem.WriteAllText(SettingsPath & "\interval.dll", 0, False)
- My.Computer.FileSystem.WriteAllText(SettingsPath & "\cryptname.dll", 1, False)
- My.Computer.FileSystem.WriteAllText(SettingsPath & "\rewrpass.dll", 0, False)
- My.Computer.FileSystem.WriteAllText(SettingsPath & "\wrongpass.dll", 0, False)
- My.Computer.FileSystem.WriteAllText(SettingsPath & "\hidepro.dll", 0, False)
- My.Computer.FileSystem.WriteAllText(SettingsPath & "\updateme.dll", 0, False)
- End Sub
- Public Sub ReadValues()
- On Error Resume Next
- Dim MyReader As Integer = 100
- MyReader = Int(My.Computer.FileSystem.ReadAllText(SettingsPath & "\prio.dll"))
- Dim MyProcesses() As System.Diagnostics.Process
- MyProcesses = Process.GetProcessesByName(MyName.Replace(".exe", ""))
- If MyProcesses.Length > 0 Then
- If MyReader = 0 Then MyProcesses(0).PriorityClass = ProcessPriorityClass.High
- If MyReader = 1 Then MyProcesses(0).PriorityClass = ProcessPriorityClass.AboveNormal
- If MyReader = 2 Then MyProcesses(0).PriorityClass = ProcessPriorityClass.Normal
- End If
- '...........................................................................................................................
- MyReader = Int(My.Computer.FileSystem.ReadAllText(SettingsPath & "\interval.dll"))
- If MyReader = 0 Then Manager.Interval = 1
- If MyReader = 1 Then Manager.Interval = 2
- If MyReader = 2 Then Manager.Interval = 4
- '...........................................................................................................................
- MyReader = Int(My.Computer.FileSystem.ReadAllText(SettingsPath & "\cryptname.dll"))
- If MyReader = 0 Then CryptFileName = True
- If MyReader = 1 Then CryptFileName = False
- '...........................................................................................................................
- 'MyReader = Int(My.Computer.FileSystem.ReadAllText(SettingsPath & "\updateme.dll"))
- '...........................................................................................................................
- MyReader = Int(My.Computer.FileSystem.ReadAllText(SettingsPath & "\rewrpass.dll"))
- If MyReader = 0 Then SerialNumber.RePassTXT.Visible = True
- If MyReader = 1 Then SerialNumber.RePassTXT.Visible = False : SerialNumber.RePassLBL.Visible = False
- '...........................................................................................................................
- 'MyReader = Int(My.Computer.FileSystem.ReadAllText(SettingsPath & "\wrongpass.dll"))
- 'MyReader = Int(My.Computer.FileSystem.ReadAllText(SettingsPath & "\hidepro.dll"))
- End Sub
- Public Sub RemoveProgram()
- On Error Resume Next
- If My.Computer.FileSystem.FileExists(System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\Free Crypt Center.lnk") = True Then My.Computer.FileSystem.DeleteFile(System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\Free Crypt Center.lnk", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
- If My.Computer.FileSystem.DirectoryExists(System.Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) & "\\uc1?لبرامج\" & MyName) = True Then System.IO.Directory.Delete(System.Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) & "\\uc1?لبرامج\" & MyName, True)
- If My.Computer.FileSystem.DirectoryExists(System.Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) & "\Programs\" & MyName) = True Then System.IO.Directory.Delete(System.Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) & "\Programs\" & MyName, True)
- My.Computer.Registry.ClassesRoot.DeleteSubKeyTree("*\shell\CryptCenter")
- My.Computer.Registry.ClassesRoot.DeleteSubKeyTree("Folder\shell\CryptCenter")
- My.Computer.Registry.ClassesRoot.DeleteSubKeyTree(".list")
- My.Computer.Registry.CurrentUser.DeleteSubKeyTree("Software\Microsoft\Windows\CurrentVersion\Uninstall\" & MyName)
- Dim MyNewCommand As New TextBox
- '"Del " & GetShift.Text & MyDir & "\*.*" & GetShift.Text & " /q /f" & System.Environment.NewLine & "Del " & GetShift.Text & MyDir & "\*.*" & GetShift.Text & " /q /f" & System.Environment.NewLine & "Del " & GetShift.Text & MyDir & "\*.*" & GetShift.Text & " /q /f" & System.Environment.NewLine & "Del " & GetShift.Text & MyDir & "\*.*" & GetShift.Text & " /q /f" & System.Environment.NewLine & "Del " & GetShift.Text & MyDir & "\*.*" & GetShift.Text & " /q /f" & System.Environment.NewLine &
- MyNewCommand.Text = "RmDir " & GetShift.Text & MyDir & GetShift.Text & " /s /q" & System.Environment.NewLine
- Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False) : Call Shell(System.Environment.SystemDirectory & "\cmd.exe /c " & MyNewCommand.Text, AppWinStyle.NormalFocus, False)
- End
- End Sub
- Private Sub CloseBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseBTN.Click
- On Error Resume Next
- If CloseBTN.Text = "إيقاف مؤقت" Then
- Manager.Enabled = False
- CloseBTN.Text = "متابعة"
- GoTo EndPoint
- ElseIf CloseBTN.Text = "متابعة" Then
- Manager.Enabled = True
- CloseBTN.Text = "إيقاف مؤقت"
- GoTo EndPoint
- ElseIf CloseBTN.Text = "إغلاق" Then
- Me.Close()
- End If
- EndPoint:
- End Sub
- Private Sub PathTXT_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles PathTXT.Click
- On Error Resume Next
- PathTXT.ForeColor = Color.Black
- PathTXT.TextAlign = HorizontalAlignment.Left
- PathTXT.Text = ""
- End Sub
- Private Sub PathTXT_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PathTXT.DragDrop
- Me.Top = 50
- Dim MyArr As String() = CType(e.Data.GetData(DataFormats.FileDrop), String())
- DragList.ListDragTarget.Items.AddRange(MyArr)
- DragList.Show()
- DragList.LoadItems()
- Main_Move(sender, e)
- End Sub
- Private Sub PathTXT_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PathTXT.DragEnter
- e.Effect = DragDropEffects.Copy
- End Sub
- Private Sub PathTXT_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PathTXT.MouseClick
- On Error Resume Next
- If e.Button = Windows.Forms.MouseButtons.Right Then
- PathTXT.ForeColor = Color.Black
- PathTXT.TextAlign = HorizontalAlignment.Left
- PathTXT.Text = ""
- End If
- End Sub
- Private Sub PathTXT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PathTXT.TextChanged
- On Error Resume Next
- Dim windowsroot As String = System.Environment.SystemDirectory.Replace("\system32", "")
- Dim FileError() As String = {"c:\ntldr", "c:\ntdetect.com", "c:\bootmgr"}
- If My.Computer.FileSystem.FileExists(PathTXT.Text) = True Then
- PIC.Image = My.Resources.OK
- CryptBTN.Enabled = True
- DesCryptBTN.Enabled = True
- DragList.CryptBTN.Enabled = True
- DragList.DesCryptBTN.Enabled = True
- ElseIf My.Computer.FileSystem.DirectoryExists(PathTXT.Text) = True Then
- PIC.Image = My.Resources.OK
- CryptBTN.Enabled = True
- DesCryptBTN.Enabled = True
- DragList.CryptBTN.Enabled = True
- DragList.DesCryptBTN.Enabled = True
- Else
- 'Not OK !
- PIC.Image = My.Resources.NotOK
- CryptBTN.Enabled = False
- DesCryptBTN.Enabled = False
- DragList.CryptBTN.Enabled = False
- DragList.DesCryptBTN.Enabled = False
- End If
- 'Testing Dirs :
- If PathTXT.Text.ToLower.Contains(windowsroot.ToLower) = True Then MsgBox("أنت تحاول الإخلال بجذر النظام ، سيتم إغلاق البرنامج فوراً", MsgBoxStyle.OkOnly, MyName) : End
- If PathTXT.Text.ToLower.Contains(FileError(0)) = True Then MsgBox("أنت تحاول الإخلال بجذر النظام ، سيتم إغلاق البرنامج فوراً", MsgBoxStyle.OkOnly, MyName) : End
- If PathTXT.Text.ToLower.Contains(FileError(1)) = True Then MsgBox("أنت تحاول الإخلال بجذر النظام ، سيتم إغلاق البرنامج فوراً", MsgBoxStyle.OkOnly, MyName) : End
- If PathTXT.Text.ToLower.Contains(FileError(2)) = True Then MsgBox("أنت تحاول الإخلال بجذر النظام ، سيتم إغلاق البرنامج فوراً", MsgBoxStyle.OkOnly, MyName) : End
- If PathTXT.Text.ToLower.Contains(MyDir.ToLower.Replace("\" & MyName.ToLower, "")) = True Then MsgBox("أنت تحاول الإخلال بجذر النظام ، سيتم إغلاق البرنامج فوراً", MsgBoxStyle.OkOnly, MyName) : End
- End Sub
- Private Sub CryptBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CryptBTN.Click
- On Error Resume Next
- GetFiles()
- If ExitBecauseNotFound = True Then GoTo EndPoint
- Addad = 0
- MyCommand = "Crypt"
- CryptBTN.Enabled = False
- DesCryptBTN.Enabled = False
- DragList.CryptBTN.Enabled = False
- DragList.DesCryptBTN.Enabled = False
- MyInfoLBL.Visible = False
- Bar.Visible = True
- CloseBTN.Text = "إيقاف مؤقت"
- PathTXT.Enabled = False
- SerialNumber.Show()
- EndPoint:
- ExitBecauseNotFound = False
- End Sub
- Private Sub DesCryptBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DesCryptBTN.Click
- On Error Resume Next
- GetFiles()
- If ExitBecauseNotFound = True Then GoTo EndPoint
- Addad = 0
- MyCommand = "DesCrypt"
- CryptBTN.Enabled = False
- DesCryptBTN.Enabled = False
- DragList.CryptBTN.Enabled = False
- DragList.DesCryptBTN.Enabled = False
- MyInfoLBL.Visible = False
- Bar.Visible = True
- CloseBTN.Text = "إيقاف مؤقت"
- PathTXT.Enabled = False
- SerialNumber.Show()
- EndPoint:
- ExitBecauseNotFound = False
- End Sub
- Private Sub AboutBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutBTN.Click
- On Error Resume Next
- AboutHelp.Close()
- AboutHelp.SetParameters("a")
- AboutHelp.Show()
- End Sub
- Private Sub SettingBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SettingBTN.Click
- On Error Resume Next
- Setting.Show()
- End Sub
- Private Sub HelpBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpBTN.Click
- On Error Resume Next
- AboutHelp.Close()
- AboutHelp.SetParameters("h")
- AboutHelp.Show()
- End Sub
- Private Sub Main_Move(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Move
- DragList.Left = Me.Left + (Me.Width / 2) - (DragList.Width / 2)
- DragList.Top = Me.Top + Me.Height + 10
- End Sub
- Private Sub FilesListBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FilesListBTN.Click
- Me.Top = 50
- DragList.Show()
- Main_Move(sender, e)
- End Sub
- Public Sub CallCryptBTN(ByVal sender As System.Object, ByVal e As System.EventArgs)
- CryptBTN_Click(sender, e)
- End Sub
- Public Sub CallDesCryptBTN(ByVal sender As System.Object, ByVal e As System.EventArgs)
- DesCryptBTN_Click(sender, e)
- End Sub
- End Class