我收到错误(BC30451),我的代码,但我似乎无法弄清楚它是什么。我已经在这方面工作了一段时间,而且我无法编译它真的很烦人。
代码:
Imports System.Net
Imports System.Net.NetworkInformation
Public Class Login1
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
Me.Close()
End Sub
Private Sub Label4_Click(sender As Object, e As EventArgs) Handles Label4.Click
Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If My.Computer.Network.Ping("www.Google.com") Then
MsgBox("Your Computer is currently connected to our database.", "Success!")
Else
MsgBox("Your Computer is currently not connected to our servers.", "Fatal Error")
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If TextBox8.Text = My.Settings.username AndAlso TextBox9.Text = My.Settings.password Then
MsgBox("You have successfully been logged in!")
Close()
Main.Show()
Else
MsgBox("That username or password is incorrect, please try again.")
Me.Close()
Form1.Show()
End If
End Sub
End Class
在Main.Show()
中,它表示Main
未声明,即使它是我正在使用的Visual Studio中的有效项目。
另外,出于某种原因,在'Main.vb'旁边,你应该得到的是一个蓝色标志,而不是正常的软件盒。这是一个截图: