none
Use Windows Username in Windows Application RRS feed

  • Question

  • Dear Team,

    I am developing an application, in which I want to use Windows Authentication for login application.

    For Example: If user is logged in on WINDOWS OS with username "CX.MIKE" and he runs my application, than my application login screen should show same Windows Login username (CX.MIKE) in username textbox of application

    User login my application with Windows username and a generic password, and windows username should automatically be displayed in username textbox of my application Login Form when use run my application.

    Saturday, December 31, 2011 6:40 AM

Answers

  • Hi 

    You can get this information from.

    System.Environment.UserName
    


    And for domain name you can use

    System.Environment.UserDomainName
    

    Put \ between them :)

    • Marked as answer by anwar.mustafa Saturday, December 31, 2011 7:31 AM
    Saturday, December 31, 2011 6:46 AM