Click here to Skip to main content
15,920,614 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: I Just Discovered FXCop Pin
Wendelius19-Dec-08 4:59
mentorWendelius19-Dec-08 4:59 
GeneralRe: I Just Discovered FXCop Pin
Lev Danielyan19-Dec-08 5:17
Lev Danielyan19-Dec-08 5:17 
GeneralRe: I Just Discovered FXCop Pin
#realJSOP19-Dec-08 5:26
professional#realJSOP19-Dec-08 5:26 
GeneralRe: I Just Discovered FXCop Pin
Lev Danielyan19-Dec-08 5:39
Lev Danielyan19-Dec-08 5:39 
GeneralRe: I Just Discovered FXCop Pin
Mark Churchill22-Dec-08 18:59
Mark Churchill22-Dec-08 18:59 
GeneralRe: I Just Discovered FXCop Pin
Wendelius23-Dec-08 3:25
mentorWendelius23-Dec-08 3:25 
QuestionSslStream.AuthenticateAsClient, multiple SslProtocols support and stunnel Pin
Ian Warner19-Dec-08 0:23
Ian Warner19-Dec-08 0:23 
QuestionHow to get WindowsIdentity from domain\ username without password? Pin
Doan Quynh18-Dec-08 23:42
Doan Quynh18-Dec-08 23:42 
I can get WindowsIdentity with this Function:

[DllImport("advapi32.dll", CallingConvention = CallingConvention.StdCall)]
public static extern bool LogonUser(string lpszUsername,
string lpszDomain, string lpszPassword, int dwLogonType,
int dwLogonProvider, ref IntPtr phToken);

private static WindowsIdentity getWindowsIdentity(string userName, string Domain, string Password)
{
bool posix = ((int) Environment.OSVersion.Platform == 128);
WindowsIdentity user = null;
try
{
if (posix)
{
user = new WindowsIdentity(userName);
}
else
{
IntPtr token = IntPtr.Zero;
LogonUser(userName, Domain, Password, 2, 0, ref token);
if (token == IntPtr.Zero)
{
return null;
}
user = new WindowsIdentity(token);
}
}
catch (Exception ex)
{
return null;
}

return user;
}
But I want to get WindowIdentity with only Domain\UserName argument?
Thanks for any idea !

QuynhTD

AnswerRe: How to get WindowsIdentity from domain\ username without password? Pin
Dave Kreskowiak19-Dec-08 4:14
mveDave Kreskowiak19-Dec-08 4:14 
GeneralRe: How to get WindowsIdentity from domain\ username without password? Pin
Doan Quynh19-Dec-08 15:24
Doan Quynh19-Dec-08 15:24 
GeneralRe: How to get WindowsIdentity from domain\ username without password? Pin
Dave Kreskowiak19-Dec-08 15:45
mveDave Kreskowiak19-Dec-08 15:45 
GeneralRe: How to get WindowsIdentity from domain\ username without password? [modified] Pin
Doan Quynh19-Dec-08 16:18
Doan Quynh19-Dec-08 16:18 
GeneralRe: How to get WindowsIdentity from domain\ username without password? Pin
Dave Kreskowiak20-Dec-08 4:17
mveDave Kreskowiak20-Dec-08 4:17 
GeneralRe: How to get WindowsIdentity from domain\ username without password? Pin
Doan Quynh21-Dec-08 19:49
Doan Quynh21-Dec-08 19:49 
Questionvb,net buttons Pin
chathini18-Dec-08 20:35
chathini18-Dec-08 20:35 
AnswerRe: vb,net buttons Pin
Thulasee Shan19-Dec-08 0:54
Thulasee Shan19-Dec-08 0:54 
QuestionVB6.0 to VB.NET Pin
sntkn18-Dec-08 20:11
sntkn18-Dec-08 20:11 
AnswerRe: VB6.0 to VB.NET Pin
Oshtri Deka18-Dec-08 21:13
professionalOshtri Deka18-Dec-08 21:13 
AnswerRe: VB6.0 to VB.NET Pin
Dragonfly_Lee24-Dec-08 19:01
Dragonfly_Lee24-Dec-08 19:01 
NewsFree Help from Microsoft for Your Windows Client Applications Pin
brucedkyle18-Dec-08 19:03
brucedkyle18-Dec-08 19:03 
QuestionThreadPool not executing queued jobs Pin
Helfdane18-Dec-08 3:14
Helfdane18-Dec-08 3:14 
AnswerRe: ThreadPool not executing queued jobs Pin
led mike18-Dec-08 7:05
led mike18-Dec-08 7:05 
GeneralRe: ThreadPool not executing queued jobs Pin
Helfdane18-Dec-08 21:53
Helfdane18-Dec-08 21:53 
GeneralRe: ThreadPool not executing queued jobs Pin
led mike19-Dec-08 7:15
led mike19-Dec-08 7:15 
GeneralRe: ThreadPool not executing queued jobs Pin
Helfdane21-Dec-08 23:27
Helfdane21-Dec-08 23:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.