Newbe: login username and passwords

  • Thread starter Thread starter Wes McCaslin
  • Start date Start date
W

Wes McCaslin

I have created a login form where i set the username and password within the
code. I was wondering how could I set a varible so that I could have a form
go back and look at what the user typed in the textboxes on the login form.
 
Hi, you can create a module, and place a public variable inside:

Public Module
Public g_strUser As String
Public g_strPass As String
End Module

When the 'OK' button is clicked on the login form, store the username in
g_strUser and the password in g_strPass... Now you can access those
variables from anywhere.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
 
Tom Spink said:
Hi, you can create a module, and place a public variable inside:

Public Module
Public g_strUser As String
Public g_strPass As String
End Module

When the 'OK' button is clicked on the login form, store the username in
g_strUser and the password in g_strPass... Now you can access those
variables from anywhere.

I prefer properties...
 
Hi Herfried... IMO extra clutter. But...

Public NotInheritable Class MyGlobalSettings
Private m_strUser As String
Private m_strPass As String

Private Sub New()
MyBase.New()
End Sub

Public Property Username() As String
Get
Return m_strUser
End Get
Set (Value As String)
m_strUser = Value
End Set
End Property

Public Property Password As String
Get
Return m_strPass
End Get
Set (Value As String)
m_strPass = Value
End Set
End Property
End Class

Now, access the properties with 'MyGlobalSettings.Username' and
'MyGlobalSettings.Password'.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
 
Hi Tom,
When the 'OK' button is clicked on the login form, store the username in
g_strUser and the password in g_strPass... Now you can access those
variables from anywhere.

When it is a windowform,
But this sentence has the sound from a webform that is sended back
I was wondering how could I set a varible so that I could have a form
go back and look at what the user typed in the textboxes on the login form.

And I said sound not is ;-)

Cor
 
Tom Spink said:
Hi Herfried... IMO extra clutter. But...

Public NotInheritable Class MyGlobalSettings
Private m_strUser As String
Private m_strPass As String

Private Sub New()
MyBase.New()
End Sub

Public Property Username() As String
Get
Return m_strUser
End Get
Set (Value As String)
m_strUser = Value
End Set
End Property

Public Property Password As String
Get
Return m_strPass
End Get
Set (Value As String)
m_strPass = Value
End Set
End Property
End Class

Now, access the properties with 'MyGlobalSettings.Username' and
'MyGlobalSettings.Password'.

Nice...
 
;-) Pretty pictures in Intellisense

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
 
Hi Cor,

True, but IMO it doesn't sound like a WebForm. Of course I could be wrong.

Also, it works the same way in a WebForm ;-)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
 
This is just a login form for an application that I am building for my job.
 
Hi Wes,

Did myself and Herfried's post help you at all?

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top