Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Since my app is going to live on a Windows 2000 SQL Server, I am trying to use the windows username and password for my app. How do I go about using the log in or accessing the username and password for the current user? I have found VB6 code but it doesn't work in my app for .NET. Any suggestions?
Posted

Well, seeing that windows already took care of the authentication by checking your password, I suggest you leave the password and only use the username. You can get the user that created your app thread with the Environment.UserName property.

 

Hope it helps...

Howzit??
  • *Experts*
Posted

If you need the domain and username, use:

System.Security.Principal.WindowsIdentity.GetCurrent().Name

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • 3 weeks later...
Posted
If you need the domain and username, use:

System.Security.Principal.WindowsIdentity.GetCurrent().Name

 

-Ner

this is what i've been searching high and low for.. ;)

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...