Call Dispose() on a WindowsIdentity object? C#
- by Andy
I am retrieving a WindowsIdentity object by calling:
win_id = System.Security.Principal.WindowsIdentity.GetCurrent();
with the intention of getting the currently logged on user name, which works fine.
WindowsIdentity implements IDisposable, but since I din't create the object myself, do I still need to call .Dispose() on it when I am finished with it or not?
Thanks.