By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,456 Members | 1,372 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,456 IT Pros & Developers. It's quick & easy.

Re: How to obtain current credentials?

P: n/a
try this:
Imports System.Security.Principal

Public Function currentId() As String
Dim strReturn As String

strReturn = WindowsIdentity.GetCurrent().Name()

'strReturn = User.Identity.Name

Return strReturn

End Function
How would you express the same hint in C#?

Regards
Konrad Viltersten
Jul 10 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"K Viltersten" <tm**@viltersten.comwrote:
How would you express the same hint in C#?
using System.Security.Principal;

// ...then, within a class...

public string CurrentId()
{
return WindowsIdentity.GetCurrent().Name;
}

Eq.
Jul 10 '08 #2

P: n/a
>How would you express the same hint in C#?
>
using System.Security.Principal;

// ...then, within a class...

public string CurrentId()
{
return WindowsIdentity.GetCurrent().Name;
}
Thanks. I should have thought of it myself... :)

Regards
Konrad Viltersten
Jul 11 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.