<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Impersonation code in C#</title><link>http://blogs.msdn.com/b/joncole/archive/2009/09/21/impersonation-code-in-c.aspx</link><description>While investigating a customer issue, I needed code to impersonate a different user on the current thread. A quick search of the msdn blogs turned up this post , which got me most of the way there. I decided to wrap the code into a class that inherits</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Impersonation code in C#</title><link>http://blogs.msdn.com/b/joncole/archive/2009/09/21/impersonation-code-in-c.aspx#9897762</link><pubDate>Tue, 22 Sep 2009 01:04:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9897762</guid><dc:creator>JonCole</dc:creator><description>&lt;P&gt;Gareth,&lt;/P&gt;
&lt;P&gt;I believe you are right about the SuppressFinalize call. &amp;nbsp;I pounded this code out pretty quickly and didn't consider that fact. &amp;nbsp;I have removed the unnecssary code.&amp;nbsp; Thanks for the comment.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9897762" width="1" height="1"&gt;</description></item><item><title>re: Impersonation code in C#</title><link>http://blogs.msdn.com/b/joncole/archive/2009/09/21/impersonation-code-in-c.aspx#9897742</link><pubDate>Mon, 21 Sep 2009 23:56:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9897742</guid><dc:creator>Gareth</dc:creator><description>&lt;P&gt;Would I be right in saying that as the ImpersonatedUser class does not have a finalizer there is no pint in calling "GC.SuppressFinalize(this);"? And there would be no point in adding a finalizer as it would run on a different thread?&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9897742" width="1" height="1"&gt;</description></item></channel></rss>