943,925 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 3057
  • VB.NET RSS
Sep 2nd, 2008
0

Creating a Login Text file

Expand Post »
i want to create a login text file at each login , that will be stored in system folder that can be viewed but not modified....so that the person who logged last can be traced...

here is my code : Is the code correct ??? if not what are the modifications ? i get a file created but am some how not convinced....

FILENAME = "LOGIN.TXT"

FileOpen(1, "LOGIN.TXT", OpenMode.Append)
WriteLine(1, username, password, role)
FileClose(1)

cya
Rohan
Similar Threads
Reputation Points: 10
Solved Threads: 2
Junior Poster
laghaterohan is offline Offline
170 posts
since Aug 2008
Sep 4th, 2008
0

Re: Creating a Login Text file

So you would like to use the "login.txt" file as the place where the username and password are stored?

That's not very good login system, anyone could search the computer for login (which is quite obvious). Try renaming the file to something completely random i.e. "4ty47rhegi.txt"

As far as the code goes you used
FILENAME = "LOGIN.TXT"

FileOpen(1, "LOGIN.TXT", OpenMode.Append)
WriteLine(1, username, password, role)
FileClose(1)

My amendment's for you are simply follow this person's tutorial Here. Its so simple and goes right into depth, I take no credit and pass it all onto him
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lukechris is offline Offline
17 posts
since Aug 2008
Sep 5th, 2008
0

Re: Creating a Login Text file

thanks but can i get a proper code for d same ? i am unable to watch video properly prob. due to my slow connection....can u plz help me out soon ! cya, wating for ur reply


Click to Expand / Collapse  Quote originally posted by lukechris ...
So you would like to use the "login.txt" file as the place where the username and password are stored?

That's not very good login system, anyone could search the computer for login (which is quite obvious). Try renaming the file to something completely random i.e. "4ty47rhegi.txt"

As far as the code goes you used
FILENAME = "LOGIN.TXT"

FileOpen(1, "LOGIN.TXT", OpenMode.Append)
WriteLine(1, username, password, role)
FileClose(1)

My amendment's for you are simply follow this person's tutorial Here. Its so simple and goes right into depth, I take no credit and pass it all onto him
Reputation Points: 10
Solved Threads: 2
Junior Poster
laghaterohan is offline Offline
170 posts
since Aug 2008
Sep 7th, 2008
0

Re: Creating a Login Text file

thanks but can i get a proper code for d same ? i am unable to watch video properly prob. due to my slow connection....can u plz help me out soon ! cya, wating for ur reply
Hi sorry your waiting on my reply

Right.

I will write the code for you now, ok, so
textbox1 is username field, textbox2 is password

This is the code for the button (Login button)
  Dim password As String
        Dim username As String
        password = "yourpassword"
        username = "yourusername"
        If TextBox1.Text = username And textbox2.text = password Then
            form2.show()
            Me.Close()
        ElseIf TextBox1.Text = username = False Then
            MsgBox("Wrong username", MsgBoxStyle.Critical)
        ElseIf textbox2.text = password = False Then
            MsgBox("Wrong password", MsgBoxStyle.Critical)
        ElseIf TextBox1.Text = username = False And textbox2.text = password = False Then
            MsgBox("Wrong username and password", MsgBoxStyle.Critical)
        End If
yourusername = Should be changed to your username
yourpassword = Should be changed to your password
form2.show = The form you want to show when the correct username and password are entered

Sorry for the late reply, any probs/questions let me know
Also let me know if it works as well lol

Thanks,
Luke

also you could have a change login button which would work by overwriting the other login

Code for change login button:
username = TextBox1.Text
password = textbox2.text
Last edited by lukechris; Sep 7th, 2008 at 1:04 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lukechris is offline Offline
17 posts
since Aug 2008
Sep 9th, 2008
0

Re: Creating a Login Text file

thanks a lot for ur response....

Btw...do u hv ne info about listview option in vb.net.... ?? i want to create attendance form
in which when i select a particular date all admission id , names should be listed and then besides them there should be a check box where in i can check/uncheck depending upon present or absent ? how to do it ?? is list view option gud or check box in datagrid ??? i dont know about both of dem ?? can u help me out ?? plzzz
Click to Expand / Collapse  Quote originally posted by lukechris ...
Hi sorry your waiting on my reply

Right.

I will write the code for you now, ok, so
textbox1 is username field, textbox2 is password

This is the code for the button (Login button)
  Dim password As String
        Dim username As String
        password = "yourpassword"
        username = "yourusername"
        If TextBox1.Text = username And textbox2.text = password Then
            form2.show()
            Me.Close()
        ElseIf TextBox1.Text = username = False Then
            MsgBox("Wrong username", MsgBoxStyle.Critical)
        ElseIf textbox2.text = password = False Then
            MsgBox("Wrong password", MsgBoxStyle.Critical)
        ElseIf TextBox1.Text = username = False And textbox2.text = password = False Then
            MsgBox("Wrong username and password", MsgBoxStyle.Critical)
        End If
yourusername = Should be changed to your username
yourpassword = Should be changed to your password
form2.show = The form you want to show when the correct username and password are entered

Sorry for the late reply, any probs/questions let me know
Also let me know if it works as well lol

Thanks,
Luke

also you could have a change login button which would work by overwriting the other login

Code for change login button:
username = TextBox1.Text
password = textbox2.text
Reputation Points: 10
Solved Threads: 2
Junior Poster
laghaterohan is offline Offline
170 posts
since Aug 2008
Sep 9th, 2008
0

Re: Creating a Login Text file

hey but is code is not about creating a login text file...i mean at each login i want a text file to be created in the system...which admin can check out....do u hv ne idea about i...btw i hve written code ias above (check above) is correct ??
cya
Reply sn,
Rohan

Click to Expand / Collapse  Quote originally posted by lukechris ...
Hi sorry your waiting on my reply

Right.

I will write the code for you now, ok, so
textbox1 is username field, textbox2 is password

This is the code for the button (Login button)
  Dim password As String
        Dim username As String
        password = "yourpassword"
        username = "yourusername"
        If TextBox1.Text = username And textbox2.text = password Then
            form2.show()
            Me.Close()
        ElseIf TextBox1.Text = username = False Then
            MsgBox("Wrong username", MsgBoxStyle.Critical)
        ElseIf textbox2.text = password = False Then
            MsgBox("Wrong password", MsgBoxStyle.Critical)
        ElseIf TextBox1.Text = username = False And textbox2.text = password = False Then
            MsgBox("Wrong username and password", MsgBoxStyle.Critical)
        End If
yourusername = Should be changed to your username
yourpassword = Should be changed to your password
form2.show = The form you want to show when the correct username and password are entered

Sorry for the late reply, any probs/questions let me know
Also let me know if it works as well lol

Thanks,
Luke

also you could have a change login button which would work by overwriting the other login

Code for change login button:
username = TextBox1.Text
password = textbox2.text
Reputation Points: 10
Solved Threads: 2
Junior Poster
laghaterohan is offline Offline
170 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Image stored in sqlserver
Next Thread in VB.NET Forum Timeline: paint w/ vb.net





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC