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

keeping track of user in a Windows App

P: 23
I know in ASP.NET, I can use the User.Identity to keep track of the logged in user. How can I accomplish the same task with a windows app short of passing the id to each form.

Thank you in advance!
Apr 21 '07 #1
Share this Question
Share on Google+
3 Replies


P: 5
Try this

Imports System.Security.Principal

Dim CurIdentity As WindowsIdentity
CurIdentity = WindowsIdentity.GetCurrent()
login_name = CurIdentity.Name
Apr 21 '07 #2

P: 23
LLM
I want to pull it from a login window and the database. Some may not be on a domain or have a user name to track. But if I log them in via a form and comparing against the database, how can I store that user ID and the fact that they are logged in?
Apr 21 '07 #3

P: 23
LLM
Try this

Imports System.Security.Principal

Dim CurIdentity As WindowsIdentity
CurIdentity = WindowsIdentity.GetCurrent()
login_name = CurIdentity.Name

To be more explicit, I want to know if I can store their user ID in a way that I can get to it from every form? I need to store their userid every time something is written to the database on every form.

Do I have to pass it to each form or is there a way I can store it for the entire app and retrieve it from anywhere?
Apr 21 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.