Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please look at my Visual basic project and correct the code error. I posted the code at the bottom of this post. THank

Can someone please look at my Visual basic project and correct the code error. I posted the code at the bottom of this post. THank you.

image text in transcribedimage text in transcribed

image text in transcribed

Public Class Form1

Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click

End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TxtboxEncryptionKey.TextChanged

End Sub End Class

Public Class HomeScreen

Private Sub ButtonExit_Click(sender As Object, e As EventArgs) Handles BtnExit.Click Me.Close() End Sub 'Button Go that Generates Random Number Private Sub ButtonGo_Click(sender As Object, e As EventArgs) Handles BtnGo.Click() E

Dim random As New Random()

TxtboxEncryptionKey.Text = random.Next(10000, 99999).ToString() End Sub

'Event to open file and Read the text and put it into TextBox Private Sub ButtonOpenTextFile_Click(sender As Object, e As EventArgs) Handles BtnOpenTextFile.Click TxtboxDecryptedText.Clear() TxtBoxEncryptedText.Clear() TxtBoxPlainText.Clear() TxtboxEncryptionKey.Clear() BtnGo.Enabled = True Dim openfileDialog As New OpenFileDialog() openfileDialog.ShowDialog() Dim fileReader As System.IO.StreamReader fileReader = My.Computer.FileSystem.OpenTextFileReader(openfileDialog.FileName) Dim stringReader As String Do stringReader = fileReader.ReadLine() TxtBoxPlainText.Text += (stringReader) + Environment.NewLine

Loop Until stringReader Is Nothing If openfileDialog.FileName IsNot "" Then BtnEncrypt.Enabled = True End If BtnEncrypt.Enabled = True End Sub 'Function to Encrypt Text Public Function EncryptText(plainText As String) As String Dim count As Integer = 0 Dim EncryptedText As String = "" Try For i As Integer = 0 To plainText.Length - 1 If count > TxtboxEncryptionKey.Text.Length - 1 Then count = 0 End If Dim ascii As Integer = Asc(plainText.ElementAt(i)) Dim a As Integer = Asc(TxtboxEncryptionKey.Text.ElementAt(count)) - 48 count += 1 ascii += a EncryptedText += Chr(ascii) Next BtnGo.Enabled = False BtnDecryptText.Enabled = True Catch ex As Exception MessageBox.Show("Please Generate the Encryption Key", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try

Return EncryptedText End Function 'Function to Decrypt Text Public Function DecryptText(encryptedText As String) Dim count As Integer = 0 Dim DecryptedText As String = "" For i As Integer = 0 To encryptedText.Length - 1 If count > TxtboxEncryptionKey.Text.Length - 1 Then count = 0 End If Dim ascii As Integer = Asc(encryptedText.ElementAt(i)) Dim a As Integer = Asc(TxtboxEncryptionKey.Text.ElementAt(count)) - 48 count += 1 ascii -= a DecryptedText += Chr(ascii) Next

Return DecryptedText End Function 'Button Encrypted Text click eevent to show the Encrypted Text in TextBox Private Sub ButtonEncrypt_Click(sender As Object, e As EventArgs) Handles BtnEncrypt.Click TxtBoxEncryptedText.Text = EncryptText(TxtBoxPlainText) .Text) End Sub 'Button Decrypted Text to display the Dycrypted Text in TextBox Private Sub ButtonDecryptText_Click(sender As Object, e As EventArgs) Handles BtnDecryptText.Click TxtboxDecryptedText.Text = DecryptText(TxtBoxEncryptedText.Text) End Sub

Private Sub HomeScreen_Load(sender As Object, e As EventArgs) Handles MyBase.Load BtnEncrypt.Enabled = False BtnDecryptText.Enabled = False End Sub

Private Sub Close() Throw New NotImplementedException End Sub

Private Function TxtboxEncryptionKey() As Object Throw New NotImplementedException End Function

Private Function TxtboxDecryptedText() As Object Throw New NotImplementedException End Function

Private Function TxtBoxEncryptedText() As Object Throw New NotImplementedException End Function

Private Function TxtBoxPlainText() As Object Throw New NotImplementedException End Function

Private Function BtnGo() As Object Throw New NotImplementedException End Function

Private Function BtnEncrypt() As Object Throw New NotImplementedException End Function

Private Function BtnDecryptText() As Object Throw New NotImplementedException End Function

End Class

CPT 341 Visual Basic.NET Project 2-Spring Semester 2019 Basic Encryption Develop a Windows Forms application that wil generate a random key used to shift a string from one character to another. The application must also reverse the shited characters back to their original characters uine the same key. Text is to be entered directly into a textbox or by selecting an existing text file using the OpenFileDialog control. Upon application startup, a splash pge must be displayed for a few seconds to display the application name and version before the Windows Form for encryption Visyal Bask Topiks and Contrel Chiects Random number generation, string manipulation and conversion, fise WO, sequential text file, OpenFileDiaolcnrl object, ANS character set, AseO function, chrO function substingtnction, Mod operater, Timer Control, Msltiple Forms, arrays, looping Tample Windown Form and Controh Splash Page Windows Form) Basic Encpption Spring Semessar, 2015 Gonerate Random Encryption Key PictureBox Control Text in the Clear Encrypted Text Textbox Control Open a Teat Fle Button Control Enorypt Text Decrypted Tex Decryst Text Exit Button Exit n the Clr Decrypted Tead Deceypt Ted Open a Test File Decrypt Ted DT9Quick Launch (Ctri c D WindowsApplication1 Microsoft Visual Studic FILE EDIT WIEW PROJECT BUILD DEBUG TEAM TOOLS TEST ARCHITECTURE ANALYZE WINDOW HELP Kevin Iwardowski VB CPT project 2.vb [Design] Solution Explorer Search loolbox All Windows Fonms Search Solution Explorer (Ctr tPointer Gcnaratc Random Encryption Kay BindingScurce Button CheckBox My Project Appcontig DVBCPprj 2vb Tex in Cear EE CheckedListBox Open Text File Encrypted Toxt DataGridView DataSet DateTimePicker DirectoryEntry Encrypt Txt Decrypt Taxt Decrypted Tex DirectorySearcher B Eventlog FilesystemWatcher Frrar l ist GroupBor * 11 Errors 0 Warnings 0 Messages Search Eror List Column Project 1 Handles clause requires a WithEvents vandbl 2 Hand es clause requires a WithEvents vanable detined in the containing type or one of its base types 3 End ot statement expected 4 Expression is not a mathod 5 Handles clause requines a WithEvents vanable defined in the containing type or cne of its base types 6 Haniles clause requires a WithEle defined in the containing type or cne of its base types defined in the containing iype or cne of its base types. VB CPT project 2.vb 20 VB CPT project 2.vb 24 VB CPI project 2vo 24 VB CPT project 2vb 25 VB CPT project 2 33 VB CPT project2v 97 VB CPT pruject 2v 99 VB CPT project 2.vb 99 WindowsApplication A Label A LinkLabe ListBex ListView WindowsApplication1 Server Explorer 37 Leading urly appear inse a ith'stateL Salutian Team Ex... Class vi... 8 End of statement expected

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

1. Define the nature of interviews

Answered: 1 week ago

Question

2. Outline the different types of interviews

Answered: 1 week ago