NT Login

P

Phil Barber

I have a Windows App,
Using the Win32's I used "WNetGetUser" (winsock API ) to get the NT login
name.
what is the best way to achive this in C#?
thanks
Phil.
 
J

Jan Tielens

1) System.Threading.Thread.CurrentPrincipal.Identity.Name

2) To get the current credentials:
system.Net.CredentialCache.DefaultCredentials

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
W

Willy Denoyette [MVP]

This is not the same, WNetGetUser returns the user associated with a network
resource (Network share).

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top