<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>HanSolo</title>
        <link>http://geekswithblogs.net/martinw/Default.aspx</link>
        <description>code monkey</description>
        <language>en-US</language>
        <copyright>HanSolo</copyright>
        <managingEditor>themwang1@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>HanSolo</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/martinw/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Writing to a file asynchronously</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/10/15/writing-to-a-file-asynchronously.aspx</link>
            <description>&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt; &lt;font color="#0000ff"&gt;Here is a code snippet for writing to a file asynchronously:&lt;br /&gt;
&lt;br /&gt;
private&lt;/font&gt; &lt;font color="#0000ff"&gt;void&lt;/font&gt; writeFileAsync(&lt;font color="#0000ff"&gt;string&lt;/font&gt; text)&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt;{&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt;      System.Text.&lt;font color="#2b91af"&gt;ASCIIEncoding&lt;/font&gt; encoding = &lt;font color="#0000ff"&gt;new&lt;/font&gt; System.Text.&lt;font color="#2b91af"&gt;ASCIIEncoding&lt;/font&gt;();&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt;      &lt;font color="#0000ff"&gt;byte&lt;/font&gt;[] buffer = encoding.GetBytes(text);&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt;      &lt;font color="#0000ff"&gt;using&lt;/font&gt; (&lt;font color="#2b91af"&gt;FileStream&lt;/font&gt; fs = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#2b91af"&gt;FileStream&lt;/font&gt;(&lt;font color="#a31515"&gt;"temp.txt"&lt;/font&gt;, &lt;font color="#2b91af"&gt;FileMode&lt;/font&gt;.Append, &lt;font color="#2b91af"&gt;FileAccess&lt;/font&gt;.Write, &lt;font color="#2b91af"&gt;FileShare&lt;/font&gt;.ReadWrite, buffer.Length, &lt;font color="#2b91af"&gt;FileOptions&lt;/font&gt;.Asynchronous))&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt;      {&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt;           &lt;font color="#2b91af"&gt;IAsyncResult&lt;/font&gt; asyncResult = fs.BeginWrite(buffer, 0, buffer.Length, &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#2b91af"&gt;AsyncCallback&lt;/font&gt;(EndWriteCallback), &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#2b91af"&gt;State&lt;/font&gt;());&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt;      }&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt; }&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt;&lt;br /&gt;
&lt;font color="#0000ff"&gt;private&lt;/font&gt; &lt;font color="#0000ff"&gt;void&lt;/font&gt; EndWriteCallback(&lt;font color="#2b91af"&gt;IAsyncResult&lt;/font&gt; result)&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt; {&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2" face="Courier New, monospace"&gt; }&lt;/font&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=135491"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=135491" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/135491.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/10/15/writing-to-a-file-asynchronously.aspx</guid>
            <pubDate>Fri, 16 Oct 2009 01:48:45 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/135491.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/10/15/writing-to-a-file-asynchronously.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/135491.aspx</wfw:commentRss>
        </item>
        <item>
            <title>DataGridView upper case textbox column</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/09/15/datagridview-upper-case-textbox-column.aspx</link>
            <description>It's a shame that the DataGridViewTextBoxColumn class doesn't allow you to set the casing so that you can restrict user input to all upper or lower case letters.&lt;br /&gt;
&lt;br /&gt;
Fortunately, it's actually pretty easy to create a custom column class to do just that. &lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;}??\fs20 \cf1 public\cf0  \cf1 class\cf0  \cf4 DataGridViewUpperCaseTextBoxColumn\cf0  : \cf4 DataGridViewTextBoxColumn\par ??\cf0 \{\par ??    \cf1 public\cf0  DataGridViewUpperCaseTextBoxColumn()\par ??        : \cf1 base\cf0 ()\par ??    \{\par ??        CellTemplate = \cf1 new\cf0  \cf4 DataGridViewUpperCaseTextBoxCell\cf0 ();\par ??    \}\par ??\}\par ??\par ??\cf1 public\cf0  \cf1 class\cf0  \cf4 DataGridViewUpperCaseTextBoxCell\cf0  : \cf4 DataGridViewTextBoxCell\par ??\cf0 \{\par ??    \cf1 public\cf0  DataGridViewUpperCaseTextBoxCell()\par ??        : \cf1 base\cf0 ()\par ??    \{\par ??    \}\par ??\par ??    \cf1 public\cf0  \cf1 override\cf0  \cf4 Type\cf0  EditType\par ??    \{\par ??        \cf1 get\par ??\cf0         \{\par ??            \cf1 return\cf0  \cf1 typeof\cf0 (\cf4 DataGridViewUpperCaseTextBoxEditingControl\cf0 );\par ??        \}\par ??    \}\par ??\}\par ??\par ??\cf1 public\cf0  \cf1 class\cf0  \cf4 DataGridViewUpperCaseTextBoxEditingControl\cf0  : \cf4 DataGridViewTextBoxEditingControl\par ??\cf0 \{\par ??    \cf1 public\cf0  DataGridViewUpperCaseTextBoxEditingControl()\par ??        : \cf1 base\cf0 ()\par ??    \{\par ??        \cf1 this\cf0 .CharacterCasing = \cf4 CharacterCasing\cf0 .Upper;\par ??    \}\par ??\}}
--&gt;
&lt;div style="background: white none repeat scroll 0% 0%; font-family: Courier New; font-size: 10pt; color: black; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;DataGridViewUpperCaseTextBoxColumn&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;DataGridViewTextBoxColumn&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; DataGridViewUpperCaseTextBoxColumn()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        : &lt;span style="color: blue;"&gt;base&lt;/span&gt;()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        CellTemplate = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;DataGridViewUpperCaseTextBoxCell&lt;/span&gt;();&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;DataGridViewUpperCaseTextBoxCell&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;DataGridViewTextBoxCell&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; DataGridViewUpperCaseTextBoxCell()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        : &lt;span style="color: blue;"&gt;base&lt;/span&gt;()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Type&lt;/span&gt; EditType&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;get&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;DataGridViewUpperCaseTextBoxEditingControl&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;DataGridViewUpperCaseTextBoxEditingControl&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;DataGridViewTextBoxEditingControl&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; DataGridViewUpperCaseTextBoxEditingControl()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        : &lt;span style="color: blue;"&gt;base&lt;/span&gt;()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;this&lt;/span&gt;.CharacterCasing = &lt;span style="color: rgb(43, 145, 175);"&gt;CharacterCasing&lt;/span&gt;.Upper;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Sweet fancy moses:)&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134822"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134822" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/134822.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/09/15/datagridview-upper-case-textbox-column.aspx</guid>
            <pubDate>Tue, 15 Sep 2009 12:30:37 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/134822.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/09/15/datagridview-upper-case-textbox-column.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/134822.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Scrollable PictureBox control</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/06/21/scrollable-picturebox-control.aspx</link>
            <description>The PictureBox control in .NET does not have scroll bars, however, it is actually really easy to create a PictureBox control with scroll bars enabled. All you have to do is to drop a panel control onto a form, and set the AutoScroll property to true.&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;}??\fs20 \cf1 this\cf0 .panel1.AutoScroll = \cf1 true\cf0 ;}
--&gt;
&lt;div style="background: white none repeat scroll 0% 0%; font-family: Courier New; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;.panel1.AutoScroll = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
And drop a PictureBox control inside the panel and set the SizeMode to AutoSize. &lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;}??\fs20 \cf1 this\cf0 .pictureBox1.SizeMode = System.Windows.Forms.\cf4 PictureBoxSizeMode\cf0 .AutoSize;}
--&gt;
&lt;div style="background: white none repeat scroll 0% 0%; font-family: Courier New; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;.pictureBox1.SizeMode = System.Windows.Forms.&lt;span style="color: rgb(43, 145, 175);"&gt;PictureBoxSizeMode&lt;/span&gt;.AutoSize;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
That's it.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132970"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132970" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/132970.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/06/21/scrollable-picturebox-control.aspx</guid>
            <pubDate>Mon, 22 Jun 2009 10:14:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/132970.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/06/21/scrollable-picturebox-control.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/132970.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Starting a background thread using the Threadpool</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/05/09/starting-a-background-thread-using-the-threadpool.aspx</link>
            <description>Here is a quick and easy way of starting a background process using the Threadpool by way of an inline delegate.&lt;br /&gt;&lt;br /&gt;

&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red43\green145\blue175;\red255\green255\blue255;\red0\green0\blue0;\red0\green0\blue255;}??\fs20 \cf1 ThreadPool\cf0 .QueueUserWorkItem(\cf4 new\cf0  \cf1 WaitCallback\cf0 (\par ??\cf4 delegate\cf0 (\cf4 object\cf0  stateInfo)\par ??\{\par ??    saveToDB();\par ??\}));         \par ??}
--&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;ThreadPool&lt;/span&gt;.QueueUserWorkItem(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;WaitCallback&lt;/span&gt;(&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;delegate&lt;/span&gt;(&lt;span style="color: blue;"&gt;object&lt;/span&gt; stateInfo)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    saveToDB();&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;}));         &lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131927"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131927" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/131927.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/05/09/starting-a-background-thread-using-the-threadpool.aspx</guid>
            <pubDate>Sun, 10 May 2009 01:42:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/131927.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/05/09/starting-a-background-thread-using-the-threadpool.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/131927.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Time enjoyed wasting is not wasted time</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/04/29/time-enjoyed-wasting-is-not-wasted-time.aspx</link>
            <description>&lt;embed src="http://tiq.travelpod.com/bin/flash/container.swf" quality="high" bgcolor="#000000" width="625" height="500" name="TravelerIQ" align="middle" type="application/x-shockwave-flash" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" flashvars="gamexml=http://tiq.travelpod.com/cgi-bin/witw?SessionID=00-traveleriq-game1&amp;amp;gameswf=http://tiq.travelpod.com/bin/flash/witw-00.swf"&gt;&lt;/embed&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131606"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131606" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/131606.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/04/29/time-enjoyed-wasting-is-not-wasted-time.aspx</guid>
            <pubDate>Thu, 30 Apr 2009 09:18:54 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/131606.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/04/29/time-enjoyed-wasting-is-not-wasted-time.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/131606.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Expect: 100-continue Header Problem</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/04/28/expect-100-continue-header-problem.aspx</link>
            <description>Here is a way for you to disable the &lt;strong&gt;&lt;span style="font-weight: normal;"&gt;Expect: 100-continue Header:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; url = &lt;span style="color: #a31515;"&gt;"http://www.myurl.com"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;ServicePoint&lt;/span&gt; sp = &lt;span style="color: #2b91af;"&gt;ServicePointManager&lt;/span&gt;.FindServicePoint(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Uri&lt;/span&gt;(url));&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;sp.Expect100Continue = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;

&lt;br /&gt;
I was getting a 500 http error when I tried to send a post to a Java web service through .Net using HttpWebRequest. Turning off this header did the trick. This will work even if you are using the WebClient class, which goes through HttpWebRequest under the covers. Hope this helps someone, this is a doozy of a problem to debug.&lt;br /&gt;
&lt;/span&gt;&lt;/strong&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131560"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131560" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/131560.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/04/28/expect-100-continue-header-problem.aspx</guid>
            <pubDate>Wed, 29 Apr 2009 11:13:56 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/131560.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/04/28/expect-100-continue-header-problem.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/131560.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Sending key presses to applications</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/04/18/sending-key-presses-to-applications.aspx</link>
            <description>I was working on an UI automation project recently and I had to submit key press messages to a windows forms application. I was looking at ways of writing code to make that possible, but then I found that you can actually just call SendKeys.Send() to send any key press message to the active form. Who knew it could be so easy. &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx&lt;/a&gt;
&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131287"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131287" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/131287.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/04/18/sending-key-presses-to-applications.aspx</guid>
            <pubDate>Sun, 19 Apr 2009 02:38:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/131287.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/04/18/sending-key-presses-to-applications.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/131287.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Microsoft test vouchers</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/04/05/microsoft-test-vouchers.aspx</link>
            <description>I just found out that I can't use the 15% off voucher and the second shot offer voucher on the same MCTS certification test. That's really lame Microsoft. &lt;img src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/angry_smile.gif" alt="" /&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130770"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130770" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/130770.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/04/05/microsoft-test-vouchers.aspx</guid>
            <pubDate>Mon, 06 Apr 2009 10:58:20 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/130770.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/04/05/microsoft-test-vouchers.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/130770.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Searching for an item in a list</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/03/21/searching-for-an-item-in-a-list.aspx</link>
            <description>It's cool to see how the .Net framework has evolved from 1.1 to 2.0 and to 3.5. Searching for items in a list is a pretty common programming task. This is a comparison of how list searching has changed throughout the different .Net framework versions.&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green128\blue0;\red255\green255\blue255;\red0\green0\blue255;\red0\green0\blue0;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \par ??\cf1 //.Net 1.1 search using a foreach statement\par ??\cf3 foreach\cf0  (\cf5 Customer\cf0  cust \cf3 in\cf0  customerList)\par ??\{\par ??    \cf3 if\cf0  (cust.FirstName == \cf6 "Bill"\cf0 )\par ??    \{\par ??        customer = cust;\par ??        \cf3 break\cf0 ;\par ??    \}\par ??\}\par ??\par ??\cf1 //.Net 2.0 search using a inline delegate            \par ??\cf5 Customer\cf0  cust = customers.Find(\par ??    \cf3 delegate\cf0 (\cf5 Customer\cf0  c)\par ??    \{\par ??        \cf3 return\cf0  c.FirstName == \cf6 "Bill"\cf0 ;\par ??    \});\par ??\par ??\cf1 //.Net 3.5 search using a lambda expression\par ??\cf5 Customer\cf0  cust = customers.Find(C =&amp;gt; C.FirstName == \cf6 "Bill"\cf0 );\par ??\par ??}
--&gt;
&lt;div style="background: white none repeat scroll 0% 0%; font-family: Courier New; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//.Net 1.1 search using a foreach statement&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: rgb(43, 145, 175);"&gt;Customer&lt;/span&gt; cust &lt;span style="color: blue;"&gt;in&lt;/span&gt; customerList)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;if&lt;/span&gt; (cust.FirstName == &lt;span style="color: rgb(163, 21, 21);"&gt;"Bill"&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        customer = cust;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//.Net 2.0 search using a inline delegate            &lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Customer&lt;/span&gt; cust = customers.Find(&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;delegate&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Customer&lt;/span&gt; c)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;return&lt;/span&gt; c.FirstName == &lt;span style="color: rgb(163, 21, 21);"&gt;"Bill"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    });&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//.Net 3.5 search using a lambda expression&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Customer&lt;/span&gt; cust = customers.Find(C =&amp;gt; C.FirstName == &lt;span style="color: rgb(163, 21, 21);"&gt;"Bill"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130299"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130299" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/130299.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/03/21/searching-for-an-item-in-a-list.aspx</guid>
            <pubDate>Sun, 22 Mar 2009 06:30:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/130299.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/03/21/searching-for-an-item-in-a-list.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/130299.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Refresh AppSettings keys</title>
            <link>http://geekswithblogs.net/martinw/archive/2009/03/07/refresh-appsettings-keys.aspx</link>
            <description>The .Net runtime caches the app.config file, therefore, when the app.config file is updated, you often need to restart the application in order for the changes to show up. Sure, you can get the keys by calling ConfigurationManager.OpenExeConfiguration() and you would be getting the latest version of the config file every time, but it's probably not the most efficient way to do it.  &lt;br /&gt;
&lt;br /&gt;
Here is how I like to do it. I call ConfigurationManager.AppSettings["MyAppSetting"] to get my key, which gets the cached version of the key so it's very fast. And I use a file system watcher to watch for changes in the config file. Whenever the config file is updated, I call ConfigurationManager.RefreshSection("AppSettings") to refresh the app settings keys. This way, the application would not have to be restarted whenever the config file changes.  &lt;br /&gt;
&lt;br /&gt;
Here is what the class might look like.  &lt;br /&gt;&lt;br /&gt;

&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red128\green128\blue128;\red0\green128\blue0;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf1 using\cf0  System;\par ??\cf1 using\cf0  System.Configuration;\par ??\cf1 using\cf0  System.IO;\par ?? \par ??\cf1 namespace\cf0  myApp\par ??\{\par ??    \cf4 ///\cf5  \cf4 &amp;lt;summary&amp;gt;\par ??\cf0     \cf4 ///\cf5  This class will refresh the cached version of the config file when it is changed.\par ??\cf0     \cf4 ///\cf5  \cf4 &amp;lt;/summary&amp;gt;\par ??\cf0     \cf1 public\cf0  \cf1 static\cf0  \cf1 class\cf0  \cf6 ConfigurationWatcher\par ??\cf0     \{  \par ??        \cf1 private\cf0  \cf1 static\cf0  \cf6 FileSystemWatcher\cf0  _fileWatcher;   \par ?? \par ??        \cf1 internal\cf0  \cf1 static\cf0  \cf1 void\cf0  Start()\par ??        \{\par ??            \cf1 if\cf0  (_fileWatcher == \cf1 null\cf0 )\par ??            \{ \par ??                \cf6 Configuration\cf0  config = \cf6 ConfigurationManager\cf0 .OpenExeConfiguration(\cf6 ConfigurationUserLevel\cf0 .None);\par ??                \cf1 string\cf0  path = \cf6 Path\cf0 .GetDirectoryName(config.FilePath);\par ??                \cf1 string\cf0  filename = \cf6 Path\cf0 .GetFileName(config.FilePath);                   \par ?? \par ??                _fileWatcher = \cf1 new\cf0  \cf6 FileSystemWatcher\cf0 ();\par ??                _fileWatcher.Path = path;\par ??                _fileWatcher.Filter = filename;\par ??                _fileWatcher.NotifyFilter = (\cf6 NotifyFilters\cf0 .CreationTime | \cf6 NotifyFilters\cf0 .LastWrite |\par ??                                \cf6 NotifyFilters\cf0 .FileName);\par ??                _fileWatcher.Changed += OnChange;\par ??                _fileWatcher.EnableRaisingEvents = \cf1 true\cf0 ;\par ??            \}           \par ??        \}\par ?? \par ??        \cf1 private\cf0  \cf1 static\cf0  \cf1 void\cf0  OnChange(\cf1 object\cf0  source, \cf6 FileSystemEventArgs\cf0  e)\par ??        \{\par ??            \cf6 ConfigurationManager\cf0 .RefreshSection(\cf7 "AppSettings"\cf0 );\par ??        \}\par ??    \}\par ??\}}
--&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Configuration;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.IO;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; myApp&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; This class will refresh the cached version of the config file when it is changed.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ConfigurationWatcher&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    {  &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;FileSystemWatcher&lt;/span&gt; _fileWatcher;   &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;internal&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Start()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;if&lt;/span&gt; (_fileWatcher == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;            { &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                &lt;span style="color: #2b91af;"&gt;Configuration&lt;/span&gt; config = &lt;span style="color: #2b91af;"&gt;ConfigurationManager&lt;/span&gt;.OpenExeConfiguration(&lt;span style="color: #2b91af;"&gt;ConfigurationUserLevel&lt;/span&gt;.None);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                &lt;span style="color: blue;"&gt;string&lt;/span&gt; path = &lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt;.GetDirectoryName(config.FilePath);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                &lt;span style="color: blue;"&gt;string&lt;/span&gt; filename = &lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt;.GetFileName(config.FilePath);                   &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                _fileWatcher = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;FileSystemWatcher&lt;/span&gt;();&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                _fileWatcher.Path = path;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                _fileWatcher.Filter = filename;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                _fileWatcher.NotifyFilter = (&lt;span style="color: #2b91af;"&gt;NotifyFilters&lt;/span&gt;.CreationTime | &lt;span style="color: #2b91af;"&gt;NotifyFilters&lt;/span&gt;.LastWrite |&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                                &lt;span style="color: #2b91af;"&gt;NotifyFilters&lt;/span&gt;.FileName);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                _fileWatcher.Changed += OnChange;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;                _fileWatcher.EnableRaisingEvents = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;            }           &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; OnChange(&lt;span style="color: blue;"&gt;object&lt;/span&gt; source, &lt;span style="color: #2b91af;"&gt;FileSystemEventArgs&lt;/span&gt; e)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;            &lt;span style="color: #2b91af;"&gt;ConfigurationManager&lt;/span&gt;.RefreshSection(&lt;span style="color: #a31515;"&gt;"AppSettings"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;        }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129909"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129909" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/martinw/aggbug/129909.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>HanSolo</dc:creator>
            <guid>http://geekswithblogs.net/martinw/archive/2009/03/07/refresh-appsettings-keys.aspx</guid>
            <pubDate>Sun, 08 Mar 2009 05:11:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/martinw/comments/129909.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/martinw/archive/2009/03/07/refresh-appsettings-keys.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/martinw/comments/commentRss/129909.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>