Hallo mensen,
Ik zit weer met een vaag probleem. Ik heb een vb.net script gemaakt:
Maar als ik op dat play knopje druk om hem te testen krijg ik de volgende fout:
Wat doe ik fout?
Ik zit weer met een vaag probleem. Ik heb een vb.net script gemaakt:
Code:
Imports System.Net
Public Class signin
Dim con As New WebClient
Public website As String = "http://localhost/dmm/"
Public usrs As String = usr.Text
Private Sub loggon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim online2 As String = con.DownloadString(website & "core.php?act=test")
If online2 = "false" Then
register.Enabled = False
login.Enabled = False
er2.Text = "Verbindings fout! Probeer het later nog eens!"
Timer2.Enabled = True
Else
If login.Enabled = False Then
login.Enabled = True
End If
If register.Enabled = False Then
register.Enabled = True
End If
If Timer2.Enabled = True Then
Timer2.Enabled = False
End If
If er2.Visible = True Then
er2.Visible = False
End If
End If
End Sub
Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click
Dim pass As String = w8.Text
Dim res As String = con.DownloadString(website & "core.php?act=login&u=" & usrs & "&p=" & pass)
If usrs = "" Then
MsgBox("Je hebt geen gebruikersnaam ingevuld.", MsgBoxStyle.Critical, "DualMind Messenger")
ElseIf pass = "" Then
MsgBox("Je hebt geen wachtwoord ingevuld.")
Else
If Not res = "true" Then
MsgBox("De inloggevens kloppen niet", MsgBoxStyle.Critical, "DualMind Messenger")
usr.Text = ""
w8.Text = ""
Else
con.DownloadString(website & "core.php?act=update&u=" & usrs)
Me.Hide()
main.Show()
End If
End If
End Sub
Private Sub register_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles register.Click
Dim usr As String = user1.Text
Dim pass3 As String = pass1.Text
Dim pas As String = pass2.Text
Dim email As String = email1.Text
If usr = "" Then
MsgBox("Je hebt geen gebruikersnaam ingevuld.", MsgBoxStyle.Critical, "DualMind Messenger")
ElseIf pass3 = "" Then
MsgBox("Je hebt geen wachtwoord ingevuld.", MsgBoxStyle.Critical, "DualMind Messenger")
ElseIf email = "" Then
MsgBox("Je hebt geen e-mailadres ingevuld.", MsgBoxStyle.Critical, "DualMind Messenger")
ElseIf Not pass3 = pas Then
MsgBox("De wachtwoorden komen niet met elkaar overeen!", MsgBoxStyle.Critical, "DualMind Messenger")
pass1.Text = ""
pass2.Text = ""
Else
Dim res As String = con.DownloadString(website & "core.php?act=reg&u=" & usr & "&p=" & pass3 & "&e=" & email)
If res = "e1" Then
MsgBox("De gekozen gebruikersnaam bestaat al.", MsgBoxStyle.Critical, "DualMind Messenger")
user1.Text = ""
ElseIf res = "false" Then
MsgBox("Fout tijdens het aanmaken van je account, probeer het later nog eens!", MsgBoxStyle.Critical, "DualMind Messenger")
ElseIf res = "true" Then
MsgBox("Je account is succesvol aangemaakt. Je kunt nu inloggen.", MsgBoxStyle.Information, "DualMind Messenger")
user1.Text = ""
pass1.Text = ""
pass2.Text = ""
email1.Text = ""
End If
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim online As String = con.DownloadString(website & "core.php?act=test")
If online = "false" Then
register.Enabled = False
login.Enabled = False
er2.Text = "Verbindings fout! Probeer het later nog eens!"
Timer2.Enabled = True
Else
If login.Enabled = False Then
login.Enabled = True
End If
If register.Enabled = False Then
register.Enabled = True
End If
If Timer2.Enabled = True Then
Timer2.Enabled = False
End If
If er2.Visible = True Then
er2.Visible = False
End If
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If er2.Visible = False Then
er2.Visible = True
ElseIf er2.Visible = True Then
er2.Visible = False
End If
End Sub
End Class
Maar als ik op dat play knopje druk om hem te testen krijg ik de volgende fout:
Code:
System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object."
Source="DualMind Messenger"
StackTrace:
at DualMind.nl.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at DualMind.nl.My.MyProject.MyForms.get_signin()
at DualMind.nl.My.MyApplication.OnCreateMainForm() in C:\Documents and Settings\UserName\Mijn documenten\Visual Studio 2008\Projects\dualmind messenger\dualmind messenger\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at DualMind.nl.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.NullReferenceException
Message="Object reference not set to an instance of an object."
Source="DualMind Messenger"
StackTrace:
at DualMind.nl.signin..ctor() in C:\Documents and Settings\UserName\Mijn documenten\Visual Studio 2008\Projects\dualmind messenger\dualmind messenger\loggon.vb:line 5
InnerException:
Wat doe ik fout?