Call Dispose() on a WindowsIdentity object? C#

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-05-31T18:29:27Z Indexed on 2010/05/31 18:33 UTC
Read the original article Hit count: 226

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms