How to get Username from Login Form

Posted by Nkkppp under C# on 12/28/2012 | Points: 10 | Views : 2840 | Status : [Member] | Replies : 3
Hi,

I am new to windows application as I was always working on Webapps.I have a Login Form and when user enters USername and Password & if Successful, MDI menu form will be appearing.

So i need to get this Username in all the MDI forms.Tried with few methods on net, but didn't get wat i needed.

Can u please help me with this.

--Prathap




Responses

Posted by: Shubham on: 12/29/2012 [Member] Starter | Points: 25

Up
0
Down
bro !!!!!
first of all you use delegate its good for moving name from one page to another.....
if not
so plzz use
global string
make method on class-file and make a global string on it and store user name on that at log-in time!!!!
from it you will access name on all page.

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Nkkppp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shipramaurya on: 12/29/2012 [Member] Starter | Points: 25

Up
0
Down
If you are not familiar with Delegates ,You can use a variable that is declare as

e.g.

Public static int a ;


Declare it as global in You Code..
On Next Form to access it U can write

int myvalue=Form1.a;


@Shipra - S.M. Techie

Nkkppp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rrana on: 1/4/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,
Try this code,

Use the below code in login page while redirecting the MDI file*********************

Dim frmParent As New MDIParent()
frmParent.User = username.text
Me.Hide()
frmParent .show()

***************************************************************************************************
Use this code in MDI file************************

Public User , Usermdi As String

Usermdi = User


***********************************


Sucharitha Goud
Bank Of America..

Nkkppp, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response