Imports System.IO

Public Class EncryptVideoForm

    Private Sub buttonBrowseSourceVideo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim dlg As OpenFileDialog = New OpenFileDialog

        If dlg.ShowDialog() = DialogResult.OK Then
            textBoxSourceVideoPath.Text = dlg.FileName
        End If
    End Sub

    Private Sub buttonBrowseEncryptedVideo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim dlg As SaveFileDialog = New SaveFileDialog

        If dlg.ShowDialog() = DialogResult.OK Then
            textBoxEncryptedVideoPath.Text = dlg.FileName
        End If
    End Sub

    Private Sub buttonEncrypt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Using InputVideoFile As FileStream = New FileStream(textBoxSourceVideoPath.Text, FileMode.Open, FileAccess.Read, FileShare.Read)
            Using EncryptedVideoFile As FileStream = New FileStream(textBoxEncryptedVideoPath.Text, FileMode.Create)
                Dim ProgressForm As ProgressForm = New ProgressForm(InputVideoFile, EncryptedVideoFile)
                ProgressForm.ShowDialog()
            End Using
        End Using
    End Sub
End Class