3 Replies - 1154 Views - Last Post: 06 December 2011 - 12:52 PM Rate Topic: -----

#1 ashub  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 01-December 11

how to make an authentication page in vb?

Posted 04 December 2011 - 12:47 AM

I want to make a login page in vb.
Once the user enters the correct username and password then only he will be able to access the software.
Is This A Good Question/Topic? 0
  • +

Replies To: how to make an authentication page in vb?

#2 chuckjessup  Icon User is offline

  • D.I.C Regular

Reputation: 33
  • View blog
  • Posts: 380
  • Joined: 26-October 09

Re: how to make an authentication page in vb?

Posted 04 December 2011 - 10:28 AM

View Postashub, on 03 December 2011 - 11:47 PM, said:

I want to make a login page in vb.
Once the user enters the correct username and password then only he will be able to access the software.


Umm do you have code? what have you tried so far? do you want to use a database system(MSSQL, SQLlight, Access...etc) to control user access, or flatfile(TXT, RAF and other files), or hardcoded information(user info coded into the log in form)?

Please post more information, including codes of what you have tried so far... try searching the site, Google, and others for tuts, and guides, I have one active blog post tut on logins, and am working on one with a more advanced system.

Jesse Fender
Was This Post Helpful? 0
  • +
  • -

#3 ashub  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 01-December 11

Re: how to make an authentication page in vb?

Posted 06 December 2011 - 12:15 AM

View Postchuckjessup, on 04 December 2011 - 10:28 AM, said:

View Postashub, on 03 December 2011 - 11:47 PM, said:

I want to make a login page in vb.
Once the user enters the correct username and password then only he will be able to access the software.


Umm do you have code? what have you tried so far? do you want to use a database system(MSSQL, SQLlight, Access...etc) to control user access, or flatfile(TXT, RAF and other files), or hardcoded information(user info coded into the log in form)?

Please post more information, including codes of what you have tried so far... try searching the site, Google, and others for tuts, and guides, I have one active blog post tut on logins, and am working on one with a more advanced system.

Jesse Fender



I have already made an advance login system..
But the problem is that i'm storing the account details in a particular path as a text file.
As the text file can be easily read by anyone, there will be no security.
I want to know if there is a method by which the storage of details becomes such that no one can easily open it out and get the login details.

My code:

For storage:

Private Sub Command2_Click()
If Text3.Text = "" Then
    MsgBox "Enter a user name.", vbCritical, "Incomplete Input"
Else
If Text4.Text = "" Then
    MsgBox "Ener a password.", vbCritical, "Incomplete Input"
Else
    Open App.Path & "\Accounts\Data\" + Text3.Text + ".txt" For Output As #1
    Print #1, Text3.Text
    Print #1, Text4.Text
    Close #1
    MsgBox "Account Succesfully Created.", vbInformation, "Account"
    Text3.Text = ""
    Text4.Text = ""
End If
End If
End Sub




For Checking The Login Input:

Private Sub Command1_Click()
On Error GoTo message
Dim userfile As String, passfile As String

If Text1.Text = "" Then
    MsgBox "Enter a user name.", vbCritical, "Incomplete Input"
Else
If Text2.Text = "" Then
    MsgBox "Ener a password.", vbCritical, "Incomplete Input"
Else
    Open App.Path & "\Accounts\Data\" + Text1.Text + ".txt" For Input As #2
    Input #2, userfile
    Input #2, passfile
    Close #2
    If userfile = Text1.Text And passfile = Text2.Text Then
        MsgBox "Access Granted", vbInformation, "Account"
        Text1.Text = ""
        Text2.Text = ""
    Else
        MsgBox "Access Denied", vbInformation, "Account"
        Text1.Text = ""
        Text2.Text = ""
    End If
End If
End If
Exit Sub
message:
    MsgBox "No such username or password.", vbCritical, "Invalid Input"
End Sub



For Admin:

Private Sub Command3_Click()
If Text5.Text = "" Then
    MsgBox "Enter a user name.", vbCritical, "Incomplete Input"
Else
If Text6.Text = "" Then
    MsgBox "Ener a password.", vbCritical, "Incomplete Input"
Else
    If Text5.Text = "admin" And Text6.Text = "pass" Then
        MsgBox "Access Granted", vbInformation, "Account"
        Text5.Text = ""
        Text6.Text = ""
    Else
        MsgBox "Access Denied", vbInformation, "Account"
        Text5.Text = ""
        Text6.Text = ""
    End If
End If
End If
End Sub




These are images:

Attached Image


All the suggestions regarding how to store details safely will be appreciated..
thanx for your replies.. :) :)
good day..
Was This Post Helpful? 0
  • +
  • -

#4 chuckjessup  Icon User is offline

  • D.I.C Regular

Reputation: 33
  • View blog
  • Posts: 380
  • Joined: 26-October 09

Re: how to make an authentication page in vb?

Posted 06 December 2011 - 12:52 PM

View Postashub, on 05 December 2011 - 11:15 PM, said:

View Postchuckjessup, on 04 December 2011 - 10:28 AM, said:

View Postashub, on 03 December 2011 - 11:47 PM, said:

I want to make a login page in vb.
Once the user enters the correct username and password then only he will be able to access the software.


Umm do you have code? what have you tried so far? do you want to use a database system(MSSQL, SQLlight, Access...etc) to control user access, or flatfile(TXT, RAF and other files), or hardcoded information(user info coded into the log in form)?

Please post more information, including codes of what you have tried so far... try searching the site, Google, and others for tuts, and guides, I have one active blog post tut on logins, and am working on one with a more advanced system.

Jesse Fender



I have already made an advance login system..
But the problem is that i'm storing the account details in a particular path as a text file.
As the text file can be easily read by anyone, there will be no security.
I want to know if there is a method by which the storage of details becomes such that no one can easily open it out and get the login details.

My code:

For storage:

Private Sub Command2_Click()
If Text3.Text = "" Then
    MsgBox "Enter a user name.", vbCritical, "Incomplete Input"
Else
If Text4.Text = "" Then
    MsgBox "Ener a password.", vbCritical, "Incomplete Input"
Else
    Open App.Path & "\Accounts\Data\" + Text3.Text + ".txt" For Output As #1
    Print #1, Text3.Text
    Print #1, Text4.Text
    Close #1
    MsgBox "Account Succesfully Created.", vbInformation, "Account"
    Text3.Text = ""
    Text4.Text = ""
End If
End If
End Sub




For Checking The Login Input:

Private Sub Command1_Click()
On Error GoTo message
Dim userfile As String, passfile As String

If Text1.Text = "" Then
    MsgBox "Enter a user name.", vbCritical, "Incomplete Input"
Else
If Text2.Text = "" Then
    MsgBox "Ener a password.", vbCritical, "Incomplete Input"
Else
    Open App.Path & "\Accounts\Data\" + Text1.Text + ".txt" For Input As #2
    Input #2, userfile
    Input #2, passfile
    Close #2
    If userfile = Text1.Text And passfile = Text2.Text Then
        MsgBox "Access Granted", vbInformation, "Account"
        Text1.Text = ""
        Text2.Text = ""
    Else
        MsgBox "Access Denied", vbInformation, "Account"
        Text1.Text = ""
        Text2.Text = ""
    End If
End If
End If
Exit Sub
message:
    MsgBox "No such username or password.", vbCritical, "Invalid Input"
End Sub



For Admin:

Private Sub Command3_Click()
If Text5.Text = "" Then
    MsgBox "Enter a user name.", vbCritical, "Incomplete Input"
Else
If Text6.Text = "" Then
    MsgBox "Ener a password.", vbCritical, "Incomplete Input"
Else
    If Text5.Text = "admin" And Text6.Text = "pass" Then
        MsgBox "Access Granted", vbInformation, "Account"
        Text5.Text = ""
        Text6.Text = ""
    Else
        MsgBox "Access Denied", vbInformation, "Account"
        Text5.Text = ""
        Text6.Text = ""
    End If
End If
End If
End Sub




These are images:

Attachment 1.JPG


All the suggestions regarding how to store details safely will be appreciated..
thanx for your replies.. :) :)
good day..


IMHO you would likely need to come up with a string cipher, or encryption There are tons of tuts and snippets through out the web on how to do this. The key though is to see what you want to do with it... The best file storage i have come up with thus far is use of a RAF file(Random Access File) which is basically the table file from a database. you can store data there, and recover more information from the file while making it more difficult to deal with from the outside world... It prints strings in straight text though, this would be where you would want to have a string encryption... I use a variety of methods to keep my records fairly safe... they are not hard to overcome if some one really wanted in... But it would be near impossible for simply snooping eyes to see what is going on... My preferred method is a multi-pass with several reverse strings and and cipher types... tends to make it hard for the general person to crack, and a little bit harder for hackers, But not impossible either...

You will have to experiment in the ways of encryption... The RAF file handling can be a bit tricky as well as easier... it all depends on what you want to do with the file...

What attempts have you made in ciphering? have you researched it?... I know there are some snippets here on this site that can work... My string encryption method is in my blog... it works pretty well, but i didnt post my reverse menthod.
You should be able to find that here too, there are other sites for vbcode, which has more items than here. you have to google them as i dont have them off the top of my head. Play with the code see how they work, and then see if you can get them to work together. I recommend that you do it in a separate project...

Best of luck...
Jesse Fender
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1