vicdeveloper vicdeveloper - 1 year ago 46 Question

Getting username after login in visual basic .net

Im new programming using as a programming language, but, the thing is, I want to put the username after a valid login process using a form login.

Something, like this:

Logged User after login - VBNET

See ya,

Answer Source

Like jmcilhinney said, it depends on how you've implemented it.

I, personally, would do something simple... create a class...

Public Class Class1
    Public Shared savedusername As String = Nothing
End Class

When your login form loads, assuming you have a textbox for the login, you can simply save the variable.

Class1.savedusername = textbox1.text

and to retrieve the variable, simply call savedusername

label1.text = class1.savedusername

There are many ways to do what you're wanting, and this is only one way, and not the best way either.