I Need Help On Vb.net Smart Devices [modified]
-
Ok i am doing a login and creating account form i need help with the coding I will show you guys what i have hopefully could get some guide on modifying the code This is The Create Button...
If TextBox1.Text = "" Then MsgBox("ERROR,Your Account/Username must have one letter in it!", MsgBoxStyle.Critical) Else If TextBox2.Text = "" Then MsgBox("ERROR,Your Account/Password must have one letter in it!", MsgBoxStyle.Critical) Else Try MkDir("C:\ACCOUNTS" + TextBox1.Text) Dim username As New System.IO.StreamWriter("C:\ACCOUNTS" + TextBox1.Text + "\" + "username.txt") username.Write(TextBox1.Text) username.Close() Dim password As New System.IO.StreamWriter("C:\ACCOUNTS" + TextBox1.Text + "\" + "password.txt") password.Write(TextBox2.Text) password.Close() Catch ex As Exception MsgBox("ACCOUNT CREATED", MsgBoxStyle.Information, "ACCOUNT CREATED") End Try End If End If
This is the login buttonIf My.Computer.FileSystem.DirectoryExists(" C:\ACCOUNTS" + TextBox1.Text + "\") Then Dim USERREAD As System.IO.StreamReader = New System.IO.StreamReader("C:\ACCOUNTS" + TextBox1.Text + "\" + "USERNAME.TXT") Dim userline As String Dim PASSREAD As System.IO.StreamReader = New System.IO.StreamReader("C:\ACCOUNTS" + TextBox1.Text + "\" + "PASSWORD.TXT") Dim PASSLINE As String Do PASSLINE = TextBox2.Text userline = USERREAD.ReadLine Console.WriteLine(PASSLINE) Console.WriteLine(userline) Loop Until userline Is Nothing MainScreen.Show() Me.Hide() If TextBox2.Text = "" Then MsgBox("error, PLEASE INPUT A PASSWORD", MsgBoxStyle.Critical) Else If PASSLINE = PASSREAD.ReadLine() = True Then End If End If Else MsgBox("THE USERNAME DONT EXIT", MsgBoxStyle.Critical) End If
I don need the database the information can be save in the mobile itself thanks There is 1 using C# to make the login form but unfortunately my range is only on VB.net itself and i can't touch
-
Ok i am doing a login and creating account form i need help with the coding I will show you guys what i have hopefully could get some guide on modifying the code This is The Create Button...
If TextBox1.Text = "" Then MsgBox("ERROR,Your Account/Username must have one letter in it!", MsgBoxStyle.Critical) Else If TextBox2.Text = "" Then MsgBox("ERROR,Your Account/Password must have one letter in it!", MsgBoxStyle.Critical) Else Try MkDir("C:\ACCOUNTS" + TextBox1.Text) Dim username As New System.IO.StreamWriter("C:\ACCOUNTS" + TextBox1.Text + "\" + "username.txt") username.Write(TextBox1.Text) username.Close() Dim password As New System.IO.StreamWriter("C:\ACCOUNTS" + TextBox1.Text + "\" + "password.txt") password.Write(TextBox2.Text) password.Close() Catch ex As Exception MsgBox("ACCOUNT CREATED", MsgBoxStyle.Information, "ACCOUNT CREATED") End Try End If End If
This is the login buttonIf My.Computer.FileSystem.DirectoryExists(" C:\ACCOUNTS" + TextBox1.Text + "\") Then Dim USERREAD As System.IO.StreamReader = New System.IO.StreamReader("C:\ACCOUNTS" + TextBox1.Text + "\" + "USERNAME.TXT") Dim userline As String Dim PASSREAD As System.IO.StreamReader = New System.IO.StreamReader("C:\ACCOUNTS" + TextBox1.Text + "\" + "PASSWORD.TXT") Dim PASSLINE As String Do PASSLINE = TextBox2.Text userline = USERREAD.ReadLine Console.WriteLine(PASSLINE) Console.WriteLine(userline) Loop Until userline Is Nothing MainScreen.Show() Me.Hide() If TextBox2.Text = "" Then MsgBox("error, PLEASE INPUT A PASSWORD", MsgBoxStyle.Critical) Else If PASSLINE = PASSREAD.ReadLine() = True Then End If End If Else MsgBox("THE USERNAME DONT EXIT", MsgBoxStyle.Critical) End If
I don need the database the information can be save in the mobile itself thanks There is 1 using C# to make the login form but unfortunately my range is only on VB.net itself and i can't touch
-
Ok i am doing a login and creating account form i need help with the coding I will show you guys what i have hopefully could get some guide on modifying the code This is The Create Button...
If TextBox1.Text = "" Then MsgBox("ERROR,Your Account/Username must have one letter in it!", MsgBoxStyle.Critical) Else If TextBox2.Text = "" Then MsgBox("ERROR,Your Account/Password must have one letter in it!", MsgBoxStyle.Critical) Else Try MkDir("C:\ACCOUNTS" + TextBox1.Text) Dim username As New System.IO.StreamWriter("C:\ACCOUNTS" + TextBox1.Text + "\" + "username.txt") username.Write(TextBox1.Text) username.Close() Dim password As New System.IO.StreamWriter("C:\ACCOUNTS" + TextBox1.Text + "\" + "password.txt") password.Write(TextBox2.Text) password.Close() Catch ex As Exception MsgBox("ACCOUNT CREATED", MsgBoxStyle.Information, "ACCOUNT CREATED") End Try End If End If
This is the login buttonIf My.Computer.FileSystem.DirectoryExists(" C:\ACCOUNTS" + TextBox1.Text + "\") Then Dim USERREAD As System.IO.StreamReader = New System.IO.StreamReader("C:\ACCOUNTS" + TextBox1.Text + "\" + "USERNAME.TXT") Dim userline As String Dim PASSREAD As System.IO.StreamReader = New System.IO.StreamReader("C:\ACCOUNTS" + TextBox1.Text + "\" + "PASSWORD.TXT") Dim PASSLINE As String Do PASSLINE = TextBox2.Text userline = USERREAD.ReadLine Console.WriteLine(PASSLINE) Console.WriteLine(userline) Loop Until userline Is Nothing MainScreen.Show() Me.Hide() If TextBox2.Text = "" Then MsgBox("error, PLEASE INPUT A PASSWORD", MsgBoxStyle.Critical) Else If PASSLINE = PASSREAD.ReadLine() = True Then End If End If Else MsgBox("THE USERNAME DONT EXIT", MsgBoxStyle.Critical) End If
I don need the database the information can be save in the mobile itself thanks There is 1 using C# to make the login form but unfortunately my range is only on VB.net itself and i can't touch
I'm not sure about the rest of the code, but this block concerns me:
Catch ex As Exception
MsgBox("ACCOUNT CREATED", MsgBoxStyle.Information, "ACCOUNT CREATED")
End TryIf an exception is caugth, that most likely means an error was encountered, which may mean that the account was not created. Catching all exceptions is probably not a great idea either, but that is beyond the scope of this question. I would suggest moving the "Account Created" message to immediately before the
catch
block and using the cath block to report any errors. -
Ok i just want a login system or let's say an login application for smart devices it like when the application is activate it will prompt you to sign in to ur account and at the same time a form to create account for the login system . . . but i don wan the normal source i want some source code for vb.net smart devices that's something that makes me very headache about Sorry About That, Thanks For Helping Out,
-
I'm not sure about the rest of the code, but this block concerns me:
Catch ex As Exception
MsgBox("ACCOUNT CREATED", MsgBoxStyle.Information, "ACCOUNT CREATED")
End TryIf an exception is caugth, that most likely means an error was encountered, which may mean that the account was not created. Catching all exceptions is probably not a great idea either, but that is beyond the scope of this question. I would suggest moving the "Account Created" message to immediately before the
catch
block and using the cath block to report any errors.Thanks For The Advice, My Main problem is i wanna create a login application that is for vb.net smart devices,cus i am totally new to vb.net smart device. that code that i provide is the normal application i wan it to be the vb.net smart devices version. . . maybe you can give some guide or like provide some source code for me for making the login system on vb.net smart devices. Thanks