Reputation: 1550
I am reading the Asp.net security documentation on msdn.I come across these tow terms and get really confused.
# WindowsIdentity = WindowsIdentity.GetCurrent()
which returns the identity of the security context of the currently executing Win32 thread.
# Thread = Thread.CurrentPrincipal
which returns the principal of the currently executing .NET thread which rides on top of the Win32 thread.
Upvotes: 1
Views: 112
Reputation: 838796
There isn't guaranteed to be a one-to-one mapping between operating system threads and .NET threads. Usually you only need to care about the .NET thread. Which OS thread your .NET Thread happens to be running on right now is an implementation detail which you shouldn't rely on.
Upvotes: 2