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

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

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

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

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

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

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

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

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.