Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. I Need Help On Vb.net Smart Devices [modified]

I Need Help On Vb.net Smart Devices [modified]

Scheduled Pinned Locked Moved Visual Basic
csharphelpdatabasetutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bernard tang
    wrote on last edited by
    #1

    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 IfThis is the login button

            If 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

    J R 2 Replies Last reply
    0
    • B bernard tang

      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 IfThis is the login button

              If 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

      J Offline
      J Offline
      jerryj
      wrote on last edited by
      #2

      Why don't you try telling us what you want it to do?

      B 1 Reply Last reply
      0
      • B bernard tang

        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 IfThis is the login button

                If 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

        R Offline
        R Offline
        Rick Shaub
        wrote on last edited by
        #3

        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 Try

        If 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.

        B 1 Reply Last reply
        0
        • J jerryj

          Why don't you try telling us what you want it to do?

          B Offline
          B Offline
          bernard tang
          wrote on last edited by
          #4

          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,

          1 Reply Last reply
          0
          • R Rick Shaub

            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 Try

            If 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.

            B Offline
            B Offline
            bernard tang
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups