I'm getting the error:
"Error when trying to run the project: could not load file or assembly "Filename" or one of it's dependencies. The given assembly name or codebase was invalid.(Exception from HRESULT:0x80131047)
Public Class Form1
Dim Answers() = {"B", "D", "A", "A", "C", "A", "B", "A", "C", "D", "B", "C", "D", "A", "D", "C", "C", "B", "D", "A"}
Dim intScore As Integer
Private Sub btnScore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScore.Click
Try
If txtAns01.Text = Answers(0) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#1 correct")
Else
ResultsForm.lstAnswers.Items.Add("#1 incorrect")
End If
If Me.txtAns2.Text = Answers(1) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#2 correct")
Else
ResultsForm.lstAnswers.Items.Add("#2 incorrect")
End If
If Me.txtAns3.Text = Answers(2) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#3 correct")
Else
ResultsForm.lstAnswers.Items.Add("#3 incorrect")
End If
If Me.txtAns4.Text = Answers(3) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#4 correct")
Else
ResultsForm.lstAnswers.Items.Add("#4 incorrect")
End If
If Me.txtAns5.Text = Answers(4) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#5 correct")
Else
ResultsForm.lstAnswers.Items.Add("#5 incorrect")
End If
If Me.txtAns6.Text = Answers(5) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#6 correct")
Else
ResultsForm.lstAnswers.Items.Add("#6 incorrect")
End If
If Me.txtAns7.Text = Answers(6) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#7 correct")
Else
ResultsForm.lstAnswers.Items.Add("#7 incorrect")
End If
If Me.txtAns8.Text = Answers(7) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#8 correct")
Else
ResultsForm.lstAnswers.Items.Add("#8 incorrect")
End If
If Me.txtAns9.Text = Answers(8) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#9 correct")
Else
ResultsForm.lstAnswers.Items.Add("#9 incorrect")
End If
If Me.txtAns10.Text = Answers(9) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#10 correct")
Else
ResultsForm.lstAnswers.Items.Add("#10 incorrect")
End If
If Me.txtAns11.Text = Answers(10) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#11 correct")
Else
ResultsForm.lstAnswers.Items.Add("#11 incorrect")
End If
If Me.txtAns12.Text = Answers(11) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#12 correct")
Else
ResultsForm.lstAnswers.Items.Add("#12 incorrect")
End If
If Me.txtAns13.Text = Answers(12) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#13 correct")
Else
ResultsForm.lstAnswers.Items.Add("#13 incorrect")
End If
If Me.txtAns14.Text = Answers(13) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#14 correct")
Else
ResultsForm.lstAnswers.Items.Add("#14 incorrect")
End If
If Me.txtAns15.Text = Answers(14) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#15 correct")
Else
ResultsForm.lstAnswers.Items.Add("#15 incorrect")
End If
If Me.txtAns16.Text = Answers(15) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#16 correct")
Else
ResultsForm.lstAnswers.Items.Add("#16 incorrect")
End If
If Me.txtAns17.Text = Answers(16) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#17 correct")
Else
ResultsForm.lstAnswers.Items.Add("#17 incorrect")
End If
If Me.txtAns18.Text = Answers(17) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#18 correct")
Else
ResultsForm.lstAnswers.Items.Add("#18 incorrect")
End If
If Me.txtAns19.Text = Answers(18) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#19 correct")
Else
ResultsForm.lstAnswers.Items.Add("#19 incorrect")
End If
If Me.txtAns20.Text = Answers(19) Then
intScore += 1
ResultsForm.lstAnswers.Items.Add("#20 correct")
Else
ResultsForm.lstAnswers.Items.Add("#20 incorrect")
End If
If intScore >= 15 Then
ResultsForm.lstAnswers.Items.Add("You Passed")
Else
ResultsForm.lstAnswers.Items.Add("You failed. Please retake the test.")
End If
ResultsForm.Show()
Catch
MessageBox.Show("Please only use the answers A, B, C, or D")
End Try
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtAns01.Text = ""
txtAns2.Text = ""
txtAns3.Text = ""
txtAns4.Text = ""
txtAns5.Text = ""
txtAns6.Text = ""
txtAns7.Text = ""
txtAns8.Text = ""
txtAns9.Text = ""
txtAns10.Text = ""
txtAns11.Text = ""
txtAns12.Text = ""
txtAns13.Text = ""
txtAns14.Text = ""
txtAns15.Text = ""
txtAns16.Text = ""
txtAns17.Text = ""
txtAns18.Text = ""
txtAns19.Text = ""
txtAns20.Text = ""
End Sub
End Class
I can remove my code as soon as the problem is solved. I'm not sure if it's an issue with the file or my code.

New Topic/Question
Reply



MultiQuote



|