|
-
Mar 6th, 2004, 01:28 AM
#1
Thread Starter
Junior Member
windows service in VB.NET
hi,
I am writing a windows service. I want to have the user name and password of the user account that will have service running in my code. I want to have it as global variable and use it in my code.
any one can give me a clue where in code I can get that?
thanks in advance.
roseta.
-
Mar 6th, 2004, 01:38 AM
#2
I don't know of any way to get the password, what would you need it for?
You can get the username via the Environmental variable:
MsgBox(Environment.UserName)
Or you can get the current Principal and Identity via the GetCurrent method of the WindowsIdentity object:
MsgBox(Security.Principal.WindowsIdentity.GetCurrent.Name)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|