By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

Newbe: login username and passwords

P: n/a
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.
Nov 20 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Cor
Hi Wes,
Is this on a webform or a windowform?
Cor
Nov 20 '05 #2

P: n/a
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
"Wes McCaslin" <no***********@olp.net> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
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.

Nov 20 '05 #3

P: n/a
"Tom Spink" <th**********@ntlworld.com> scripsit:
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...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

P: n/a
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
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bm************@ID-208219.news.uni-berlin.de...
"Tom Spink" <th**********@ntlworld.com> scripsit:
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...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #5

P: n/a
Cor
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

Nov 20 '05 #6

P: n/a
"Tom Spink" <th**********@ntlworld.com> scripsit:
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...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #7

P: n/a
;-) 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
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bm************@ID-208219.news.uni-berlin.de...
"Tom Spink" <th**********@ntlworld.com> scripsit:
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...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #8

P: n/a
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
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader20.wxs.nl...
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

Nov 20 '05 #9

P: n/a
This is just a login form for an application that I am building for my job.
"Tom Spink" <th**********@ntlworld.com> wrote in message
news:Ox*************@TK2MSFTNGP11.phx.gbl...
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
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader20.wxs.nl...
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


Nov 20 '05 #10

P: n/a
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
"Wes McCaslin" <no***********@olp.net> wrote in message
news:uE**************@TK2MSFTNGP09.phx.gbl...
This is just a login form for an application that I am building for my job. "Tom Spink" <th**********@ntlworld.com> wrote in message
news:Ox*************@TK2MSFTNGP11.phx.gbl...
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
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader20.wxs.nl...
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



Nov 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.