Results 1 to 2 of 2

Thread: windows service in VB.NET

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    22

    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.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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
  •  



Click Here to Expand Forum to Full Width