<rss version="2.0"><channel><title>Scott Cate .net Knowledge Base and Weblog</title><link>http://scottcate.mykb.com</link><description>&lt;OL&gt;
&lt;LI&gt;To have a central repository of information, kind of a dumping ground for things I need to remember &lt;/LI&gt;
&lt;LI&gt;To help support the ASP.NET and general programming community with tips and tricks &lt;/LI&gt;
&lt;LI&gt;Promote &lt;a href="http://www.myKB.com" title="Click here to visit myKB.com"&gt;myKB.com&lt;/a&gt; knowledge base software&lt;/LI&gt;
&lt;LI&gt;To have a little fun with the hobbies in my life. You find ideas &amp; comments on subjects ranging from programming to travel to scuba diving to gambling to .... whatever.&lt;/LI&gt;&lt;/OL&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;Font Class="kbmaintableheaderfont"&gt;Here are some tips on using the knowledge base.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;RSS Feeds&lt;/B&gt;&lt;BR&gt;This site has two kinds of RSS feeds.A global feed and category feeds. Anywhere you see the orange XML icon, you can click that page to consume data in XML/RSS format.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Search&lt;/B&gt;&lt;BR&gt;Enter your search term and click the &lt;I&gt;Search&lt;/I&gt; button. You can search for dates, words, or article IDs. Further control your search by selecting &lt;I&gt;All Words, Any Word&lt;/I&gt; or &lt;I&gt;Exact Phrase&lt;/I&gt; from the drop-down list. Entering a date in MM/DD/YYYY format will search for all articles created or modified since a particular date.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Browse&lt;/B&gt;&lt;BR&gt;Click a category name to view the sub-categories and articles it contains. To open an article click on its title.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Ask a Question!&lt;/B&gt;&lt;BR&gt;If you can't find the information you are looking for, click the &lt;I&gt;Submit a Question&lt;/I&gt; button at the bottom of every search or browse page.&lt;/P&gt;</description><lastBuildDate>Fri, 04 Jul 2008 18:09:40 GMT</lastBuildDate><language>en-us</language><item><title>ASP.NET DevConnection Samples</title><link>http://scottcate.mykb.com/Article_B4223.aspx</link><description>&lt;p&gt;The Samples that I ran/demo'd in Orlando for the April 2008 DevConnections can be downloaded from the following zip file.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.ScottCate.com/Ajax2008.zip"&gt;http://www.ScottCate.com/Ajax2008.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><guid isPermaLink="false">4b8c2d6c-464d-47b9-9e19-eef6714ebcf8</guid><pubDate>Mon, 05 May 2008 09:13:28 GMT</pubDate></item><item><title>Scott Cate Ajax Demo Code</title><link>http://scottcate.mykb.com/Article_37B3F.aspx</link><description>&lt;p&gt;If you've seen me present&amp;nbsp;in a user group or VSLive or any other event, and the topic was on Microsoft ASP.NET Ajax extenstions, chances are you're looking for this code link :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.scottcate.com/downloads/scottcateajax.zip"&gt;http://www.scottcate.com/downloads/scottcateajax.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><guid isPermaLink="false">9a253917-1887-465a-86dc-72fb517437ea</guid><pubDate>Mon, 05 Nov 2007 15:37:45 GMT</pubDate></item><item><title>Steve Smith's Awesome Caching Pattern</title><link>http://scottcate.mykb.com/Article_5CB26.aspx</link><description>&lt;p&gt;My friend Steve Smith who wrote &lt;a href="http://weblogs.asp.net/ssmith/archive/2003/06/20/9062.aspx"&gt;this article&lt;/a&gt; has solved a major problem for me. With his permission I'm duplicating some of&amp;nbsp;his code here.&lt;/p&gt;
&lt;p&gt;About one in 50,000 page views, I was getting an "Object Not Set" exception being thrown in &lt;a href="http://www.kbalertz.com/"&gt;kbAlertz.com&lt;/a&gt;. This was a mystery for a very long time, and it's finally solved (Thanks Steve :). Here is&amp;nbsp;( IMHO )&amp;nbsp;how the typical developer retreives something from the cache in an ASP.NET application.&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt; 
&lt;style type="text/css"&gt;PRE.ShowCode {BACKGROUND-COLOR:#ffffff;PADDING-RIGHT: 3px;Border: 0px;FONT-SIZE: 11px;PADDING-BOTTOM: 0px;PADDING-TOP: 0px;FONT-FAMILY: "Courier New";}.ColorLineNumber { color:red; }.DefaultFontFace { color:arial; }.DefaultFontSize { size:3; }.ColorBackGroundLine { color:#EEEECC; }.ColorAlternatingBackGroundLine { color:#FFFFEE; }.ColorComment { color:green; }.ColorServerSideTag { color:green; }.ColorDataBinding { color:dodgerblue; }.ColorControlTag { color:maroon; }.ColorAspTemplateTag { color:green; }.ColorStartHtmlTag { color:blue; }.ColorEndHtmlTag { color:blue; }.ColorVBKeyword { color:blue; }.ColorVBComment { color:green; }.ColorCSKeyword { color:blue; }.ColorSQLKeyword { color:blue; }.ColorCSComment { color:green; }.ColorSQLComment { color:green; }.ColorSQLFunctions { color:maroon; }.ColorSQLDataTypes { color:green; }&lt;/style&gt;
&lt;/p&gt;&lt;pre class="ShowCode"&gt;&lt;span class="ColorLineNumber"&gt;1:     &lt;/span&gt;HttpContext ctx = HttpContext.Current;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;2:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(ctx.Cache["myCacheDataSet"] != &lt;span class="ColorCSKeyword"&gt;null&lt;/span&gt;)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;3:     &lt;/span&gt;{
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;4:     &lt;/span&gt;    DataSet ds = (DataSet)ctx.Cache["myCacheDataSet"];
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;5:     &lt;/span&gt;    &lt;span class="ColorCSKeyword"&gt;return&lt;/span&gt; ds;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;6:     &lt;/span&gt;}
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;7:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;else&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;8:     &lt;/span&gt;{
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;9:     &lt;/span&gt;    &lt;span class="ColorCSComment"&gt;//Go build myCacheItem
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;10:    &lt;/span&gt;    DataSet ds = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; DataSet;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;11:    &lt;/span&gt;    &lt;span class="ColorCSComment"&gt;//Set ds Properties
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;12:    &lt;/span&gt;    ctx.Cache.Insert("myCacheDataSet",ds,&lt;span class="ColorCSKeyword"&gt;null&lt;/span&gt;,DateTime.Now.AddHours(1), TimeSpan.Zero);
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;13:    &lt;/span&gt;    &lt;span class="ColorCSKeyword"&gt;return&lt;/span&gt; ds;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;14:    &lt;/span&gt;}&lt;/pre&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;Steve Smith suggests that you should actually create your object, from the cache, and then check your object != null. This means that you only hit the cache object once, vs. the above method of checking the if the cache item is there, and if so, then hit the cache again, and get your object. Once in a blue moon, the object acually falls from cache in the time between (Is it there = true) and (ok it's there, give it to me), thereby creating a null reference exception.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ShowCode"&gt;&lt;span class="ColorLineNumber"&gt;1:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;//Steve Smith's Caching Pattern
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;2:     &lt;/span&gt;Object cacheItem = Cache[key] as DataTable; 
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;3:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(cacheItem == &lt;span class="ColorCSKeyword"&gt;null&lt;/span&gt;) 
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;4:     &lt;/span&gt;{
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;5:     &lt;/span&gt;  cacheItem = GetData();
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;6:     &lt;/span&gt;  Cache.Insert(key, cacheItem, &lt;span class="ColorCSKeyword"&gt;null&lt;/span&gt;, DateTime.Now.AddHours(1), TimeSpan.Zero);
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;7:     &lt;/span&gt;}
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;8:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;return&lt;/span&gt; (DataTable)cacheItem;&lt;/pre&gt;&lt;pre class="ShowCode"&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;&lt;style type="text/css"&gt;PRE.ShowCode {BACKGROUND-COLOR:#ffffff;PADDING-RIGHT: 3px;Border: 0px;FONT-SIZE: 11px;PADDING-BOTTOM: 0px;PADDING-TOP: 0px;FONT-FAMILY: "Courier New";}.ColorLineNumber { color:red; }.DefaultFontFace { color:arial; }.DefaultFontSize { size:3; }.ColorBackGroundLine { color:#EEEECC; }.ColorAlternatingBackGroundLine { color:#FFFFEE; }.ColorComment { color:green; }.ColorServerSideTag { color:green; }.ColorDataBinding { color:dodgerblue; }.ColorControlTag { color:maroon; }.ColorAspTemplateTag { color:green; }.ColorStartHtmlTag { color:blue; }.ColorEndHtmlTag { color:blue; }.ColorVBKeyword { color:blue; }.ColorVBComment { color:green; }.ColorCSKeyword { color:blue; }.ColorSQLKeyword { color:blue; }.ColorCSComment { color:green; }.ColorSQLComment { color:green; }.ColorSQLFunctions { color:maroon; }.ColorSQLDataTypes { color:green; }&lt;/style&gt;&lt;/pre&gt;
&lt;p&gt;So I built a couple of static helper methods that will let me easily get object from the cache.&lt;/p&gt;&lt;pre class="ShowCode"&gt;&lt;span class="ColorLineNumber"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="ShowCode"&gt;&lt;span class="ColorLineNumber"&gt;1:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// &amp;lt;summary&amp;gt;
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;2:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// All objects being pulled from Cache should be used by this method. This method
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;3:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// is code safe, and ensures if an object is in the cache, it's used, and it can't
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;4:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// (or won't) be removed before the reference is set to it. This was causing random
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;5:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// Null Exceptions throughout code, because if you check for Cache["Whatever"] != null
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;6:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// and then set string whatever = Cache["Whatever"].ToString(), there is a possibility
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;7:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// that the cached item, could expire and not be available by the time the reference is set.
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;8:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// &amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;9:     &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// &amp;lt;param name="CacheName"&amp;gt;String Name of Cached Item&amp;lt;/param&amp;gt;
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;10:    &lt;/span&gt;&lt;span class="ColorCSComment"&gt;/// &amp;lt;returns&amp;gt;Object: If object is not found, then null is returned, so ALWAYS check for != null&amp;lt;/returns&amp;gt;
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;11:    &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;public&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;static&lt;/span&gt; object RetrieveObjectFromCache(&lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; CacheName, HttpContext ctx)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;12:    &lt;/span&gt;{
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;13:    &lt;/span&gt;    object cacheItem = ctx.Cache[CacheName.ToLower()];
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;14:    &lt;/span&gt;    &lt;span class="ColorCSKeyword"&gt;return&lt;/span&gt; cacheItem;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;15:    &lt;/span&gt;}
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;16:    &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;public&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;static&lt;/span&gt; object RetrieveObjectFromCache(&lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; CacheName)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;17:    &lt;/span&gt;{
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;18:    &lt;/span&gt;    object cacheItem = Global.RetreiveObjectFromCache(CacheName, HttpContext.Current);
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;19:    &lt;/span&gt;    &lt;span class="ColorCSKeyword"&gt;return&lt;/span&gt; cacheItem;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;20:    &lt;/span&gt;}
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;21:    &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;And Finally, I would use these static methods through out my code like the following ...&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;&lt;/p&gt;&lt;pre class="ShowCode"&gt;&lt;span class="ColorLineNumber"&gt;1:     &lt;/span&gt;DataSet dsTmp = (DataSet)Global.RetrieveObjectFromCache("myCachedDataSet");
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;2:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(dsTmp != &lt;span class="ColorCSKeyword"&gt;null&lt;/span&gt;)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;3:     &lt;/span&gt;{
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;4:     &lt;/span&gt;    &lt;span class="ColorCSComment"&gt;//DataSet found
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;5:     &lt;/span&gt;}
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;6:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;else&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;7:     &lt;/span&gt;{
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;8:     &lt;/span&gt;    &lt;span class="ColorCSComment"&gt;//No DataSet in Cache
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;9:     &lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;
&lt;p&gt;&lt;/p&gt;</description><guid isPermaLink="false">82676611-f57d-47f2-89eb-81e17aa1ef16</guid><pubDate>Sat, 06 Oct 2007 16:26:37 GMT</pubDate></item><item><title>The Honorable Ray Borane is awarded the 2007 "Cesar E. Chavez" award from the state of Arizona.</title><link>http://scottcate.mykb.com/Article_8C6EC.aspx</link><description>&lt;p&gt;I had a great time this week with my best friend, &lt;a href="http://myspace.com/laughingsinner"&gt;Joey Borane&lt;/a&gt;. His father is the &lt;a href="http://www.douglasaz.gov/MayorCouncil/Mayor.htm"&gt;Mayor of Douglas&lt;/a&gt; Arizona. The Honorable Ray Borane was awarded the &lt;a href="http://www.douglasdispatch.com/articles/2007/04/04/news/news2.txt"&gt;Cesar E. Chavez award&lt;/a&gt; from the State of Arizona.&lt;/p&gt;
&lt;p&gt;The session was opened by the &lt;a href="http://azgovernor.gov/BioJN.asp"&gt;Arizona Governor &lt;b&gt;Janet Napolitano&lt;/b&gt;&lt;/a&gt;, she gave a nice introduction, that I was able to grab on video.&lt;/p&gt;
&lt;p&gt;
&lt;object height="350" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/XT0F4hXZS6I"&gt;
&lt;embed src="http://www.youtube.com/v/XT0F4hXZS6I" type="application/x-shockwave-flash" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;Then a few others spoke, and Joey's father was brought up on stage.&lt;/p&gt;
&lt;p&gt;
&lt;object height="350" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/r1COy6lzLbw"&gt;
&lt;embed src=http://www.youtube.com/v/r1COy6lzLbw type="application/x-shockwave-flash" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;Thank you Joey for inviting me to this great event. I had a blast.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><guid isPermaLink="false">d7ae6d83-f98f-430e-b04c-05488f9df894</guid><pubDate>Fri, 06 Apr 2007 23:34:40 GMT</pubDate></item><item><title>RaisedLaptop Pricing.</title><link>http://scottcate.mykb.com/Article_F6252.aspx</link><description>&lt;h1&gt;
&lt;p&gt;&lt;font color="red" size="38"&gt;The laptop stands are currently out of stock&lt;/font&gt;&lt;/p&gt;&lt;/h1&gt;
&lt;h1&gt;Shipping Charges&lt;br /&gt;&lt;strike&gt;$6.00 for the first item.&lt;br /&gt;$2.00 for each additional item.&lt;/strike&gt;&lt;/h1&gt;
&lt;p&gt;&lt;font color="red" size="38"&gt;&lt;strike&gt;$19.99 Each unit.&lt;/strike&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Laptop Stands&lt;/p&gt;
&lt;p&gt;Rasied Laptop&lt;/p&gt;
&lt;p&gt;Raise your Laptop&lt;/p&gt;
&lt;p&gt;Save your back&lt;/p&gt;
&lt;p&gt;Get your 10 Key back.&lt;/p&gt;</description><guid isPermaLink="false">d2b96712-64f6-4714-9112-5f12fd02c7fa</guid><pubDate>Fri, 09 Jun 2006 15:02:09 GMT</pubDate></item><item><title>Raise Your Laptop, with our Laptop Stands! Lift it to Eye Level!</title><link>http://scottcate.mykb.com/Article_BB743.aspx</link><description>&lt;h1&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/cimg2515.jpg"&gt;Is your back killing you?&lt;/h1&gt;
&lt;p&gt;Lift your laptop or notebook up to eye level. This works really great for laptops when you're using an external mouse and keyboard, and an external monitor. Take a look at our pictures of the laptop stands, being raised to eye level, and to match the level of the flat panel monitor. &lt;/p&gt;
&lt;h1 align="right"&gt;&lt;img style="CLEAR: left; FLOAT: right" src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/laptopstandsonly.jpg"&gt; Raise your laptop!&lt;/h1&gt;
&lt;p&gt;Raising your laptop to eye level has a ton of great advantages. Using an external keyboard and mouse, will make you much faster and more productive with your work. Blah Blah Blah, the pictures tell it all. You know you need this.&amp;nbsp; &lt;/p&gt;
&lt;h1&gt;&lt;img style="CLEAR: right; FLOAT: left" src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/cimg2513.jpg"&gt;Do you hate using a mini keyboard?&lt;/h1&gt;
&lt;p&gt;Your fingers are too fast for the mini keys offered by your laptop. Set yourself free with a full size keyboard and mouse. With your laptop at eye level, and a full size keyboard, you don't have to worry about cramped fingers, and a touch pad. Truly make your laptop a desktop replacement.&lt;/p&gt;
&lt;h1 align="right"&gt;&lt;img style="CLEAR: left; FLOAT: right" src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/cimg2520.jpg"&gt; Match the height of your external monitor!&lt;/h1&gt;
&lt;p&gt;Lift your laptop or notebook up to eye level. This works really great for laptops when you're using an external mouse and keyboard, and an external monitor. Take a look at our pictures of the laptop stands, being raised to eye level, and to match the level of the flat panel monitor. &lt;/p&gt;
&lt;h1&gt;&lt;img style="CLEAR: right; FLOAT: left" src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/cimg2513.jpg"&gt; Where is your 10 key?&lt;/h1&gt;
&lt;p&gt;Your external keyboard will make it easier and faster, and you'll get your 10 key back.&lt;/p&gt;
&lt;h1 align="right"&gt;&lt;img style="CLEAR: left; FLOAT: right" src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/cimg2525.jpg"&gt; Stop reading! Buy now!&lt;/h1&gt;
&lt;p&gt;If you're still reading this, the pictures haven't don their job. The pictures are supposed to distract you enoguh, to not read all this stuff. They say a picture is worth 1000 words, are these pictures working? &lt;/p&gt;
&lt;h1&gt;&lt;img style="CLEAR: right; FLOAT: left" src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/cimg2517.jpg"&gt; CD/DVD on the Side?&lt;/h1&gt;
&lt;p&gt;Your raised laptop stands will work best if your laptop has a CD/DVD drive on the side. If the CD/DVD door is on the front, then it's facing down when in the stand, and must be taken out of the stand to access. My laptop loads in the front, but I don't use the CD/DVD that often, so it's not a big deal. But to be fair, your should know that if you use your CD/DVD alot, and it's a front loaded, then you will not be happy wtih these stands. Keep looking :)&lt;/p&gt;</description><guid isPermaLink="false">ac2c4bf0-bcc4-4f46-b3e6-3dc1ae47f607</guid><pubDate>Wed, 02 Nov 2005 09:07:24 GMT</pubDate></item><item><title>Laptop Stands :: Pictures Page 2</title><link>http://scottcate.mykb.com/Article_FC6AC.aspx</link><description>&lt;table id="Table1" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;100% &lt;a href="http://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback&amp;amp;userid=shoope&amp;amp;ssPageName=STRK:ME:UFS"&gt;Ebay Feedback Rating&lt;/a&gt;&lt;br /&gt;Money Back Guarantee&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2500.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2472.jpg" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2518.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2522.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;Fast Shipping!!!&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2505.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2506.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2508.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2512.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</description><guid isPermaLink="false">f3e5a201-43ef-45fb-86e1-8a051c49e3ea</guid><pubDate>Tue, 25 Oct 2005 09:52:58 GMT</pubDate></item><item><title>Laptop Stands :: Pictures Page 1</title><link>http://scottcate.mykb.com/Article_8B53A.aspx</link><description>&lt;table id="Table1" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="4"&gt;
&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2471.jpg" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2482.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2479.jpg" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2502.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;Fast Shipping!!! Works with All Brands!!!&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2480.jpg" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2486.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2490.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2523.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;100% Ebay Feedback Rating&lt;br /&gt;Money Back Guarantee&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;div id="tipDiv" style="Z-INDEX: 100; VISIBILITY: hidden; POSITION: absolute"&gt;&lt;/div&gt;</description><guid isPermaLink="false">77279bad-f52d-40ac-b049-8a72681c1937</guid><pubDate>Tue, 25 Oct 2005 09:52:28 GMT</pubDate></item><item><title>The Famous Laptop Stands</title><link>http://scottcate.mykb.com/Article_9485C.aspx</link><description>&lt;table id="Table1" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="4"&gt;
&lt;h3&gt;&lt;font size="3"&gt;Will ship within 1 business day.&lt;/font&gt;&lt;/h3&gt;
&lt;h3&gt;&lt;a href="http://scottcate.url123.com/LaptopStands"&gt;Buy through PayPal :: 19.99&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;This is a copy of a regular running ebay Auction. The price is the same, but this page is always available.&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2471.jpg" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2482.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2479.jpg" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2502.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;Mouse Over Images to see Instant Larger Picture &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;Fast Shipping!!! Works with All Brands!!!&lt;br /&gt;
&lt;h3&gt;&lt;a href="http://scottcate.url123.com/LaptopStands"&gt;Buy through&lt;br /&gt;PayPal :: 19.99&lt;/a&gt;&lt;/h3&gt;&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2480.jpg" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2486.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2490.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2523.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;Mouse Over Images to see Instant Larger Picture &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;100% Feedback Rating&lt;br /&gt;Money Back Guarantee&lt;br /&gt;
&lt;h3&gt;&lt;a href="http://scottcate.url123.com/LaptopStands"&gt;Buy through&lt;br /&gt;PayPal :: 19.99&lt;/a&gt;&lt;/h3&gt;&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2500.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2472.jpg" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2518.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2522.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;Mouse Over Images to see Larger Picture, Works best with images in middle of screen &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;Fast Shipping!!!&lt;br /&gt;
&lt;h3&gt;&lt;a href="http://scottcate.url123.com/LaptopStands"&gt;Buy through&lt;br /&gt;PayPal :: 19.99&lt;/a&gt;&lt;/h3&gt;&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2505.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2506.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2508.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2512.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;Mouse Over Images to see Instant Larger Picture &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;Stop Neck Strain -- Stop Hunching Over&lt;br /&gt;
&lt;h3&gt;&lt;a href="http://scottcate.url123.com/LaptopStands"&gt;Buy through&lt;br /&gt;PayPal :: 19.99&lt;/a&gt;&lt;/h3&gt;&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2513.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2515.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2516.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2517.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;Mouse Over Images to see Instant Larger Picture &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;Put Your Laptop At Eye Level&lt;br /&gt;
&lt;h3&gt;&lt;a href="http://scottcate.url123.com/LaptopStands"&gt;Buy through&lt;br /&gt;PayPal :: 19.99&lt;/a&gt;&lt;/h3&gt;&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2520.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2501.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2503.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2504.JPG" border="0"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;Mouse Over Images to see Instant Larger Picture &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h1&gt;&lt;font color="#ff0000"&gt;Not Recommended For Front &lt;br /&gt;CD-ROM Machines&lt;br /&gt;
&lt;h3&gt;&lt;a href="http://scottcate.url123.com/LaptopStands"&gt;Buy through&lt;br /&gt;PayPal :: 19.99&lt;/a&gt;&lt;/h3&gt;&lt;/font&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2524.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2525.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&lt;img src="http://www.scottcate.com/photoalbum/my%20stuff/laptop%20stand/tn/CIMG2526.JPG" border="0"&gt;&lt;/td&gt;
&lt;td align="middle"&gt;&amp;nbsp; 
&lt;h3&gt;&lt;a href="http://scottcate.url123.com/LaptopStands"&gt;Buy through&lt;br /&gt;PayPal :: 19.99&lt;/a&gt;&lt;/h3&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="middle" colspan="4"&gt;
&lt;h3&gt;&lt;a href="http://scottcate.url123.com/LaptopStands"&gt;Buy through&lt;br /&gt;PayPal :: 19.99&lt;/a&gt;&lt;/h3&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;div id="tipDiv" style="Z-INDEX: 100; VISIBILITY: hidden; POSITION: absolute"&gt;&lt;/div&gt;</description><guid isPermaLink="false">a18f94f2-8a7c-4192-bb1e-5d9f19a063eb</guid><pubDate>Sun, 23 Oct 2005 19:31:58 GMT</pubDate></item><item><title>We finally made Channel 9</title><link>http://scottcate.mykb.com/Article_475D9.aspx</link><description>&lt;p&gt;PDC this year was a lot of fun. The weekend prior to PDC, we were able to have some fun sailing in the Pacific Ocean. While on deck, my friend Lorin Thwaits, whips out a video camera, and convinced me that the PDC ShowOff would be a quick and fun video to put together.&lt;/p&gt;
&lt;p&gt;So with a little improv, screen capture, and a few takes, this is the final result.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=121812"&gt;http://channel9.msdn.com/Showpost.aspx?postid=121812&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.hundhausen.com/AJAX+On+The+High+Sees.aspx"&gt;Richard Hundausen&lt;/a&gt; (Microsoft RD), is the background.&lt;/p&gt;
&lt;p&gt;It was a great day, and none of us got sun burned ...&lt;/p&gt;
&lt;p&gt;
&lt;hr id="null"&gt;
&lt;/p&gt;
&lt;p&gt;Lorin Thwaits (the camera man) also had his video published on Channel 9. He did a GREAT JOB editing his. It was by far the most polished, and comes with a great sense of humor as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=121809"&gt;http://channel9.msdn.com/Showpost.aspx?postid=121809&lt;/a&gt;&lt;/p&gt;</description><guid isPermaLink="false">febcb216-33b6-4927-b650-a9cbd71f891d</guid><pubDate>Thu, 29 Sep 2005 11:40:34 GMT</pubDate></item><item><title>Visual Studio Keyboard Shortcuts</title><link>http://scottcate.mykb.com/Article_9BB34.aspx</link><description>&lt;p&gt;My good friend Michael Palermo today showed me the best keyboard shortcut ever. In fact, this is to a feature I didn't even know existed. When in a code window for Visual Studio, you can go full screen, hiding all the other windows, tool bars, title bars, and even your start bar. This is the same effect that Internet Explorer has when it's in "Full Screen" mode.&lt;/p&gt;
&lt;p&gt;[SHIFT ]+ [ALT] + [ENTER] = Toggle Full Screen Mode&lt;/p&gt;
&lt;p&gt;I'm sure this works in all versions, but I haven't tested it, as I'm running the 1.1 framework. I'm told it also continues to work in Whidbey.&lt;/p&gt;
&lt;p&gt;[CTRL]+[i] = Incremental Search. I've stopped using [CTRL]+[F] to find. Incremental search works without a dialog box, and searches as you type. So you're in a class, and you want to find the word public. [CTRL]+[i] puts you into Incremental Search Mode, now just start typing. When you've found what you're looking for press [ESC] to get out of incremental search mode. Remember the famous [F3] is find again, and works with this incremental search also. : ) I love this one..... Thanks Simon.&lt;/p&gt;
&lt;p&gt;[CTRL] + [-] = Move cursor back to it's last position. This works great when working with large pages. I commonly will [CTRL]+[Home] to enter a Using statement, then [CTRL]+[-] brings me rights back to my previous edit point.&lt;/p&gt;
&lt;p&gt;[CTRL] + [}] = Toggle to Open/Close { }. This is great. If you're working with nested code (who doesn't) then you'll use this constantly. Place your cursor on any { or } and press [CTRL] + [}] and your cursor will jump to the opposite end of your code block.&lt;/p&gt;
&lt;p&gt;[CTRL] + [C] =&amp;nbsp;Copy.&lt;br /&gt;[CTRL] + [V] = Paste.&lt;br /&gt;Of course we all know that combination, but here's the trick. Copy two items in succession. You might know that these items are placed on a "Clipboard Ring" You can access them from the UI but that entails thinking, and clicking and dragging.&lt;/p&gt;
&lt;p&gt;[CTRL]+[SHIFT]+[V] = Paste whatever is on top of the "Clipboard Ring". If you press [CTRL]+[SHIFT]+[V] again, since your pasted code is still highlighted, it will be replaced with the second item, and again, will be the third, etc. I love this. How many times do you have to copy two or three items from one page to another (none if you're refactoring; right)?&lt;/p&gt;
&lt;p&gt;(Thanks Sreenth for this tip)&lt;br /&gt;[CTRL]+[ALT]+[P] = Show Processes. This is a great, fast way to open the processes window. Why do that? I use it daily to attach to the ASP.net worker process. This let's me dive 15 pages deep into my web application, and attach to the process, so I don't have to run through the 15 pages every time I debug.&lt;/p&gt;
&lt;p&gt;(Thanks Sreenth for this tip)&lt;br /&gt;[CTRL]+[ALT]+[R] = Launch MSDN Home Page&lt;/p&gt;
&lt;p&gt;If you have a favorite shortcut, you want me to list, e-mail me (see e-mail in header), and I'll get it up on this page.&lt;br /&gt;&lt;/p&gt;</description><guid isPermaLink="false">797e1a9e-3251-44f2-b820-741c81cc3e40</guid><pubDate>Tue, 14 Jun 2005 12:19:07 GMT</pubDate></item><item><title>Looking for the new ConfigurationManager?</title><link>http://scottcate.mykb.com/Article_9C988.aspx</link><description>&lt;p&gt;I was just spinning up a little console application, as a utility, and I'm pulling an encrypted connection string from the app.config file. Using 1.1 code that I'm used to, I used....&lt;/p&gt;
&lt;p&gt;&lt;font color="red"&gt;System.Configuration.ConfigurationSettings.AppSettings["connstr"].ToString();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;And the compiler gave me the following error.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Warning&amp;nbsp;1&amp;nbsp;'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by ConfigurationManager.AppSettings'&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So I try and change my Code to the following ...&lt;/p&gt;
&lt;p&gt;&lt;font color="red"&gt;System.Configuration.ConfigurationManager.AppSettings["connstr"].ToString();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;and I get a compiler error, saying the compiler can't find ConfigurationManager.&lt;/p&gt;
&lt;p&gt;Well here's the confusion.... The Original System.Configuration.ConfigurationSettings class is found in the System.dll assembly. There is a new assembly with all the new ConfigurationManager classes as System.Configuration.dll. Before using the ConfigurationManager class, you must first set a reference to the new System.Configuration.dll.&lt;/p&gt;
&lt;p&gt;-=- Hope this helps someone&amp;nbsp;....&lt;/p&gt;</description><guid isPermaLink="false">28839ed0-4ebc-481d-9dd5-f9e532590550</guid><pubDate>Mon, 13 Jun 2005 17:55:17 GMT</pubDate></item><item><title>Securing Trace.axd - Remote &amp; Local</title><link>http://scottcate.mykb.com/Article_D5C6F.aspx</link><description>&lt;p&gt;In the Arizona .NET User Group (&lt;a href="http://www.azdnug.com/"&gt;http://www.AZDNUG.com&lt;/a&gt;) that I run we were talking about tracing and all the awesome features and abilities it has and we ran into a problem.&lt;/p&gt;
&lt;p&gt;You may know that if tracing is enabled and is not specifically flagged as &lt;font color="#ff0000"&gt;LocalOnly="True"&lt;/font&gt; then you can access Trace.axd from anywhere. This can be very dangerous if your are &lt;font color="#ff0000"&gt;Trace.Write&lt;/font&gt;(ing) things like&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Configuration/Connection Strings (which is a terrible idea) 
&lt;li&gt;SQL Strings 
&lt;li&gt;Variable Name/Value Pairs 
&lt;li&gt;Whatever&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;So we figured out a way to secure the Trace.axd file. It's pretty simple actually. The ASP.NET Worker Process is in charge of rendering the Trace.axd file so that means we can secure the file through the web.config file.&lt;/p&gt;
&lt;p&gt;Add the following additions and/or modifications to your web.config file.
&lt;style type="text/css"&gt;PRE.ShowCode {BACKGROUND-COLOR:#ffffff;PADDING-RIGHT: 3px;Border: 0px;FONT-SIZE: 11px;PADDING-BOTTOM: 0px;PADDING-TOP: 0px;FONT-FAMILY: "Courier New";}.ColorLineNumber { color:red; }.DefaultFontFace { color:arial; }.DefaultFontSize { size:3; }.ColorBackGroundLine { color:#EEEECC; }.ColorAlternatingBackGroundLine { color:#FFFFEE; }.ColorComment { color:green; }.ColorServerSideTag { color:green; }.ColorDataBinding { color:dodgerblue; }.ColorControlTag { color:maroon; }.ColorAspTemplateTag { color:green; }.ColorStartHtmlTag { color:blue; }.ColorEndHtmlTag { color:blue; }.ColorVBKeyword { color:blue; }.ColorVBComment { color:green; }.ColorCSKeyword { color:blue; }.ColorSQLKeyword { color:blue; }.ColorCSComment { color:green; }.ColorSQLComment { color:green; }.ColorSQLFunctions { color:maroon; }.ColorSQLDataTypes { color:green; }&lt;/style&gt;
&lt;/p&gt;&lt;pre class="ShowCode"&gt;&lt;span class="ColorLineNumber"&gt;1:     &lt;/span&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;location&lt;/span&gt; path="trace.axd"&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;2:     &lt;/span&gt;  &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;system.web&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;3:     &lt;/span&gt;    &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;authorization&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;4:     &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;allow&lt;/span&gt; users="ScottCate" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;5:     &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;deny&lt;/span&gt; users="*" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;6:     &lt;/span&gt;    &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;authorization&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;7:     &lt;/span&gt;  &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;system.web&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;8:     &lt;/span&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;location&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;
&lt;p&gt;and then modify your Trace Statement&lt;/p&gt;&lt;pre class="ShowCode"&gt;&lt;span class="ColorLineNumber"&gt;1:     &lt;/span&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;trace&lt;/span&gt; enabled="True" requestLimit="10" pageOutput="False"
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;2:     &lt;/span&gt;       traceMode="SortByTime" localOnly="False" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;
&lt;p align="left"&gt;Because your web.config turns on the tracing, the Trace.axd file is activated and then because your location security only allow certain users, you've now secured your trace.axd file&lt;/p&gt;
&lt;p align="left"&gt;Happy Coding.&lt;br /&gt;&lt;a href="mailto:scottc@myKBPro.com"&gt;scottc@myKBPro.com&lt;/a&gt;&lt;/p&gt;</description><guid isPermaLink="false">da0b7e04-5c7c-463c-b655-1e504319a35d</guid><pubDate>Tue, 01 Mar 2005 17:14:17 GMT</pubDate></item><item><title>Looking for System.Web.Ui.Design ?</title><link>http://scottcate.mykb.com/Article_6F499.aspx</link><description>&lt;p&gt;I just inherited a project where one of the class files was "using System.Web.UI.Design;" My project did not compile of course, because I didn't have the assembly referenced. I had System.Web already referenced, so naturally I thought I'd add a reference to System.Web.UI and everything would be peachy.&lt;/p&gt;
&lt;p&gt;Right?&lt;/p&gt;
&lt;p&gt;Wrong.&lt;/p&gt;
&lt;p&gt;There is not a System.Web.UI.dll or System.Web.UI.Design.dll to reference. After 5 wasted minutes I found the namespace in System.Design.dll.&lt;/p&gt;
&lt;p&gt;So I decided to waste another 5 minutes writing this, and hopefully help someone else, in the future.&lt;/p&gt;</description><guid isPermaLink="false">63d363de-c869-41c3-b7c8-7f71d9d87611</guid><pubDate>Wed, 02 Feb 2005 15:29:50 GMT</pubDate></item><item><title>Announcement: 2005 MVP Award</title><link>http://scottcate.mykb.com/Article_77F7D.aspx</link><description>&lt;p&gt;Thank you to Microsoft for awarding my community efforts with another MVP award. My first MVP award came one year ago in January 2004. The award is given for community work done the year before. I'll continue to devote as much time as possible to ASP.NET with a goal of helping as many people as possible in 2005.&lt;/p&gt;
&lt;p&gt;Thank you Microsoft for the recognition, and thank you to all the people who've asked me for ASP.NET help, including all the members of my User Group ( &lt;a href="http://www.azgroups.com/"&gt;http://www.AZGroups.com&lt;/a&gt; ) that have helped to make this award possible.&lt;/p&gt;</description><guid isPermaLink="false">86c8f28a-b044-4d73-b604-b08ec394a445</guid><pubDate>Tue, 04 Jan 2005 23:08:13 GMT</pubDate></item><item><title>November 2004 -- AZGroups.com Tips/Tricks</title><link>http://scottcate.mykb.com/Article_83248.aspx</link><description>&lt;p&gt;For my user group ( &lt;a href="http://www.azgroups.com/"&gt;www.AZGroups.com&lt;/a&gt;&amp;nbsp;) ( November 2004 Session ) I will&amp;nbsp;be showing&amp;nbsp;ASP.NET tips and tricks. The Parentheses give hints to the files in the project that contain the code samples. Session highlights will include ... &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using String.Format() with Web.Config 
&lt;li&gt;&lt;a href="/Article_56A56.aspx"&gt;URL and Path Variables&lt;/a&gt; 
&lt;li&gt;&lt;a href="/Article_9BB34.aspx"&gt;Advanced keyboard maneuvers inside the Visual Studio IDE&lt;/a&gt; 
&lt;li&gt;Configuration: Get outside the Web.Config with better performance 
&lt;ul&gt;
&lt;li&gt;( /Config/ShowConfig.aspx )&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;Caching Patterns to Guarantee Object Existence 
&lt;ul&gt;
&lt;li&gt;( /CachePatterns/BadCacheExample.aspx ) 
&lt;li&gt;( /CachePatterns/GoodCacheExample.aspx )&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;My Favorite: Using Context.Items – Caching Per Request. 
&lt;li&gt;Storing Passwords. 
&lt;ul&gt;
&lt;li&gt;Bad -- Plain Text ( /Password/Password1.aspx ) 
&lt;li&gt;Better -- Hashed ( /Password/Password2.aspx ) 
&lt;li&gt;Best -- Hashed and Salted. ( /Password/Password3.aspx )&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;URL Rewriting, Turn Default.aspx?myValue=5 into Article5.aspx 
&lt;ul&gt;
&lt;li&gt;( /Rewrite/Article.aspx )&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;&lt;a href="/Article_D5C6F.aspx"&gt;Secure Trace.AXD for local and remote access.&lt;/a&gt; 
&lt;li&gt;Time Allotted there are many more items I can put into this category.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;The project I created and sampled can be downloaded here.&lt;br /&gt;&lt;a href="http://www.scottcate.com/Downloads/Talks/AspNetTipTricks-Nov2004.zip"&gt;http://www.scottcate.com/Downloads/Talks/AspNetTipTricks-Nov2004.zip&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;And the Database that is used in the Password Encryption/Decryption Routines&lt;br /&gt;&lt;a href="http://www.scottcate.com/Downloads/Talks/AspNetTipTricks-DB-Nov2004.zip"&gt;http://www.scottcate.com/Downloads/Talks/AspNetTipTricks-DB-Nov2004.zip&lt;/a&gt; &lt;/p&gt;</description><guid isPermaLink="false">83846f46-55c9-453a-a333-c29b2d6fdaa9</guid><pubDate>Wed, 17 Nov 2004 13:06:13 GMT</pubDate></item><item><title>Retrieving File and Request Path Information </title><link>http://scottcate.mykb.com/Article_56A56.aspx</link><description>&lt;p&gt;It seems to be a very common practice to check the URL and File paths. Many, Many scenarios require this information, and it seems that a lot of native classes are commonly overlooked. To bring awareness to classes that you may or may not know exist, I've thrown together a little table that shows several ways to get path information.&lt;/p&gt;
&lt;table style="BORDER-COLLAPSE: collapse" bordercolor="#800000" cellpadding="3" width="751" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bordercolor="#800000" width="431" bgcolor="#800000"&gt;&lt;b&gt;&lt;font color="#ffffff" size="4"&gt;Syntax to Request Path Information&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td bordercolor="#800000" bgcolor="#800000"&gt;&lt;b&gt;&lt;font color="#ffffff" size="4"&gt;Result&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;Request.ApplicationPath&lt;/td&gt;
&lt;td&gt;/MyWebSite&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;Request.CurrentExecutionFilePath&lt;/td&gt;
&lt;td&gt;/MyWebSite/Paths/Paths.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;Request.FilePath&lt;/td&gt;
&lt;td&gt;/MyWebSite/Paths/Paths.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;Request.PhysicalApplicationPath&lt;/td&gt;
&lt;td&gt;c:\inetpub\wwwRoot\MyWebSite\&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;Request.Physicalpath&lt;/td&gt;
&lt;td&gt;c:\inetpub\wwwRoot\MyWebSite\Path\Paths.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;Request.MapPath("/")&lt;/td&gt;
&lt;td&gt;c:\inetpub\wwwRoot\&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;Request.RawUrl&lt;/td&gt;
&lt;td&gt;/MyWebSite/Paths/Paths.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;System.IO.Path.GetFileNameWithoutExtension(Request.PhysicalPath)&lt;/td&gt;
&lt;td&gt;Paths&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;System.IO.Path.GetExtension(Request.PhysicalPath)&lt;/td&gt;
&lt;td&gt;.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="431"&gt;System.IO.Path.GetDirectoryName(Request.PhysicalPath)&lt;/td&gt;
&lt;td&gt;c:\inetpub\wwwRoot\MyWebSite\Path&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Enjoy!!&lt;/p&gt;</description><guid isPermaLink="false">f87ede77-4aef-4dd3-ba61-f3ea2f687302</guid><pubDate>Mon, 15 Nov 2004 15:47:50 GMT</pubDate></item><item><title>Poor Bird. You thought you were having a bad day?</title><link>http://scottcate.mykb.com/Article_F528E.aspx</link><description>&lt;p&gt;Ever see a bid hit the windshield of a car? How about stuck in a store, airport, hotel lobby, or other public place? How about a plate glass window?&lt;/p&gt;
&lt;p&gt;My friend J. lives on the second floor, and has a wall of windows. Each plate glass window is about 14 feet tall, and brings a nice view of the city. It's easy for us to see out, but unfortunately it's not so easy for the bird to see.&lt;/p&gt;
&lt;p&gt;This poor bird actually left an impression in the dust on the outside of the glass, and I was able to capture it. It was able to fly away, but I'm sure he had a headache.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img alt="Outline of Poor Bird in Window Dust" src="http://www.scottcate.com/PhotoAlbum/showImage.aspx?img=/photoalbum/friends/joey+borane/poor+bird/cimg1575.jpg"&gt;&lt;/p&gt;</description><guid isPermaLink="false">0887b911-3ca0-47e9-bd4b-0caa3903caf5</guid><pubDate>Sun, 14 Nov 2004 20:24:40 GMT</pubDate></item><item><title>2004 Nov 08 -- Fun Fact: How To tell if glass is dual pane glass</title><link>http://scottcate.mykb.com/Article_63872.aspx</link><description>&lt;p&gt;myKB.com has recently moved into new office space in Scottsdale, Arizona. The building we've moved into is newly constructed and is pretty fancy looking with an all glass exterior. Our entire office is frame with external windows, needless to say we have a lot of light.&lt;/p&gt;
&lt;p&gt;Anyway, to the fun fact.&lt;/p&gt;
&lt;p&gt;Due to the building shifting and settling, one of the huge sheets of glass has cracked. being lazy, and not wanting to walk outside the question was asked. "I wonder if it's dual pain safety glass?". The Answer: Get a lighter, hold it up to the glass.&lt;/p&gt;
&lt;p&gt;Any old piece of glass will show you two flame reflections. This is due to one reflection from the front of the glass, and another from the other side of the glass.&lt;/p&gt;
&lt;p&gt;If it's dual pane glass, you'll actually see four flame reflections. Once for each side of "both" pieces of glass that have been sandwiched together.&lt;/p&gt;
&lt;p&gt;See, I told you it was useless information ...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><guid isPermaLink="false">503d0b73-9750-4df7-b966-5e4e4613f9ef</guid><pubDate>Mon, 08 Nov 2004 11:41:33 GMT</pubDate></item><item><title>My Big Ride at the Arizona State Fair</title><link>http://scottcate.mykb.com/Article_5AE46.aspx</link><description>&lt;p&gt;Once a year the Arizona State Fair comes to town. This year I was able to get some ride passes from a friend of mine who works at the fair. I just happened to be recording some movies and these two came out pretty good.&lt;/p&gt;
&lt;p&gt;You must watch them in order for them to make sense. &lt;/p&gt;
&lt;p&gt;The first movie, is a quick movie of the ride it self, while we were standing in line.&lt;br /&gt;&lt;a href="http://www.scottcate.com/Downloads/Fair/TheRide.avi"&gt;http://www.scottcate.com/Downloads/Fair/TheRide.avi&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The second movie is a recording of the acutal ride.&lt;br /&gt;&lt;a href="http://www.scottcate.com/Downloads/Fair/TheDrop.avi"&gt;http://www.scottcate.com/Downloads/Fair/TheDrop.avi&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy...&lt;/p&gt;</description><guid isPermaLink="false">d46c7cd1-5a0f-4e78-ae76-41fed57966ae</guid><pubDate>Sun, 31 Oct 2004 12:53:00 GMT</pubDate></item><item><title>Web.Config + string.format() Trick</title><link>http://scottcate.mykb.com/Article_E756F.aspx</link><description>&lt;p&gt;One of the most common questions about the web.config file is... Is it secure?&lt;/p&gt;
&lt;p&gt;Well it's as secure as you make it. Anyone with access to the file system, probably has access to the web.config file. So here's a little obfuscation trick. Move some of your sensitive data out of the web.config, or pull it form different parts of&amp;nbsp;the web.config with string.format().&lt;/p&gt;
&lt;p&gt;Consider the following web.config entry.&lt;/p&gt;
&lt;p&gt;&amp;lt;add key="DBConnection" value="Data Source={0};User Id={1}; Password={2};Initial Catalog={3};"/&amp;gt;&lt;/p&gt;
&lt;p&gt;So this is a SUPER generic connection string, and now in my application on start I can pull data from another, more secure area, like the DPAPI.&lt;/p&gt;
&lt;p&gt;string server = "localhost";&lt;br /&gt;string user = "user";&lt;br /&gt;string password = "password";&lt;br /&gt;string catalog = "catalog";&lt;br /&gt;string ConfigDBString = Appsettings DBConnection&lt;/p&gt;
&lt;p&gt;string connection = string.format(ConfigDBString, server, user, password, catalog);&lt;/p&gt;
&lt;p&gt;Then you have your connection string. Obviously these values are not hard coded as in the example above, but I'm sure you get the point.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UPDATED: August 1, 2004&lt;/strong&gt;&lt;br /&gt;After reading this, my buddy &lt;a href="http://www.donxml.com/" target="_blank"&gt;DonXML&lt;/a&gt; sent me a note about his Object Oriented approch to this topic. Here are his comments...&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;span&gt;&lt;em&gt;I saw your post on the connection string stuff in the web.config file, and was wondering if you saw my Encrypted Connection String code example at &lt;/em&gt;&lt;a href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=7d1d4954-a530-4329-8cc0-96a0c39ab4b2" target="_blank"&gt;&lt;em&gt;GotDotNet&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&amp;nbsp; You could either use it instead of your example, or, just use the base ConnectionString class as a simple and easy way to parse your connection string into it’s components (in an OO style).&amp;nbsp; I also have a SqlServerConnectionString class and an OracleConnectionString Class that inherit from the base class, with all the rules from the respective documentation implemented (so you can’t build a connection string that will not work).&lt;/em&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Very helpful indeed, thanks &lt;a href="http://www.donxml.com/" target="_blank"&gt;Don&lt;/a&gt;.&lt;/p&gt;</description><guid isPermaLink="false">9e5a8e58-bd94-4d80-8691-8a95a3ab68b0</guid><pubDate>Sun, 01 Aug 2004 16:01:52 GMT</pubDate></item><item><title>Find and parse hyperlinks in string</title><link>http://scottcate.mykb.com/Article_625C8.aspx</link><description>&lt;p&gt;&amp;lt;a[\s]?href=["'](?&amp;lt;url&amp;gt;[^"]+[.\s]*)["']&amp;gt;(?&amp;lt;name&amp;gt;[^&amp;lt;]+[.\s]*)&amp;lt;/a&amp;gt;&lt;/p&gt;
&lt;p&gt;Isn't she a beauty? This is my first ever regular expression, that I actually come up with on my own. I did have help from Eric Gunnerson's "&lt;a href="http://blogs.msdn.com/ericgu/archive/2003/07/07/52362.aspx"&gt;Regular Expression Workbench&lt;/a&gt;", but I still take credit for coming up with the regular expression on my own.&lt;/p&gt;
&lt;p&gt;So I feed in an HTML string, and this Regex.Matches returns a MatchCollection that I can cycle through. Each Match has a groups collection that looks something like this.&lt;/p&gt;
&lt;p&gt;[0] = &amp;lt;a href="http://www.scottcate.com"&amp;gt;scottcate&amp;lt;/a&amp;gt;&lt;br /&gt;[url] = "http://www.scottcate.com"&lt;br /&gt;[name] = scottcate&lt;/p&gt;
&lt;p&gt;And there is one of these for every hyperlink on the page. Basically gives me access to the href="" property and the display text.&lt;/p&gt;
&lt;p&gt;Hope this helps someone else out there in happy coding land...&lt;/p&gt;</description><guid isPermaLink="false">93379a0c-0d92-4f4f-bcad-a77dc2f52b00</guid><pubDate>Fri, 18 Jun 2004 16:37:54 GMT</pubDate></item><item><title>HttpModule that acts as a SSL Switcher</title><link>http://scottcate.mykb.com/Article_D2244.aspx</link><description>&lt;p&gt;If you're working with SSL and ASP.NET, you know it's a challenge to be able to know when to switch back and forth between HTTP and HTTPS calls.&lt;/p&gt;
&lt;p&gt;I've thrown together a little HttpModule that inpects requests, and matches them to settings in web.config custom sections. There&amp;nbsp;are files and paths sections. There are a ton of ways to do this, but I wanted a way to add this to projects that are already in existence, and an HttpModule seems to be the best bet.&lt;/p&gt;
&lt;p&gt;Basically you can add this to your project in&amp;nbsp;2 easy steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy DLL into /Bin 
&lt;li&gt;Add Settings into web.config file.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Here is the sample web.config&amp;nbsp;settings to wire up the module, and the custom sections data.&lt;/p&gt;
&lt;div style="OVERFLOW-Y: scroll; BORDER-LEFT-COLOR: #800000; OVERFLOW-X: scroll; BORDER-BOTTOM-COLOR: #800000; WIDTH: 700px; BORDER-TOP-STYLE: solid; BORDER-TOP-COLOR: #800000; BORDER-RIGHT-STYLE: solid; BORDER-LEFT-STYLE: solid; HEIGHT: 300px; BORDER-RIGHT-COLOR: #800000; BORDER-BOTTOM-STYLE: solid" overflow="true" border-width:1;&gt;
&lt;p&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;&lt;br /&gt;
&lt;style type="text/css"&gt;PRE.ShowCode {BACKGROUND-COLOR:#ffffff;PADDING-RIGHT: 3px;Border: 0px;FONT-SIZE: 11px;PADDING-BOTTOM: 0px;PADDING-TOP: 0px;FONT-FAMILY: "Courier New";}.ColorLineNumber { color:red; }.DefaultFontFace { color:arial; }.DefaultFontSize { size:3; }.ColorBackGroundLine { color:#EEEECC; }.ColorAlternatingBackGroundLine { color:#FFFFEE; }.ColorComment { color:green; }.ColorServerSideTag { color:green; }.ColorDataBinding { color:dodgerblue; }.ColorControlTag { color:maroon; }.ColorAspTemplateTag { color:green; }.ColorStartHtmlTag { color:blue; }.ColorEndHtmlTag { color:blue; }.ColorVBKeyword { color:blue; }.ColorVBComment { color:green; }.ColorCSKeyword { color:blue; }.ColorSQLKeyword { color:blue; }.ColorCSComment { color:green; }.ColorSQLComment { color:green; }.ColorSQLFunctions { color:maroon; }.ColorSQLDataTypes { color:green; }&lt;/style&gt;
&lt;pre class="ShowCode"&gt;&lt;span class="ColorLineNumber"&gt;1:     &lt;/span&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;configuration&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;2:     &lt;/span&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;configSections&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;3:     &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;sectionGroup&lt;/span&gt; name="RequiresSSL"&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;4:     &lt;/span&gt;         &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;section&lt;/span&gt; name="RequiresSSL_Files" type="System.Configuration.NameValueSectionHandler,system,Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089,Custom=null" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;5:     &lt;/span&gt;         &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;section&lt;/span&gt; name="RequiresSSL_Paths" type="System.Configuration.NameValueSectionHandler,system,Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089,Custom=null" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;6:     &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;sectionGroup&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;7:     &lt;/span&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;configSections&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;8:     &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;9:     &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;10:    &lt;/span&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;RequiresSSL&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;11:    &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;RequiresSSL_Files&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;12:    &lt;/span&gt;         &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;add&lt;/span&gt; key="login.aspx" value="true" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;13:    &lt;/span&gt;         &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;add&lt;/span&gt; key="WebForm1.aspx" value="true" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;14:    &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;RequiresSSL_Files&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;15:    &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;RequiresSSL_Paths&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;16:    &lt;/span&gt;         &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;add&lt;/span&gt; key="/Secure" value="true" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;17:    &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;RequiresSSL_Paths&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;18:    &lt;/span&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;RequiresSSL&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;19:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;20:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;21:    &lt;/span&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;system.web&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;22:    &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;httpModules&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;23:    &lt;/span&gt;         &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;add&lt;/span&gt; type="HttpSslSwitcher.SslSwitcher, HttpSslSwitcher" name="SslSwitcher" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt; 
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;24:    &lt;/span&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;httpModules&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;25:    &lt;/span&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;system.web&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;26:    &lt;/span&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;configuration&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;27:    &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and Here is the class code for the module.&lt;/p&gt;
&lt;div style="OVERFLOW-Y: scroll; BORDER-LEFT-COLOR: #800000; OVERFLOW-X: scroll; BORDER-BOTTOM-COLOR: #800000; WIDTH: 700px; BORDER-TOP-STYLE: solid; BORDER-TOP-COLOR: #800000; BORDER-RIGHT-STYLE: solid; BORDER-LEFT-STYLE: solid; HEIGHT: 600px; BORDER-RIGHT-COLOR: #800000; BORDER-BOTTOM-STYLE: solid" overflow="true" border-width:1;&gt;
&lt;p&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;&lt;br /&gt;
&lt;style type="text/css"&gt;PRE.ShowCode {BACKGROUND-COLOR:#ffffff;PADDING-RIGHT: 3px;Border: 0px;FONT-SIZE: 11px;PADDING-BOTTOM: 0px;PADDING-TOP: 0px;FONT-FAMILY: "Courier New";}.ColorLineNumber { color:red; }.DefaultFontFace { color:arial; }.DefaultFontSize { size:3; }.ColorBackGroundLine { color:#EEEECC; }.ColorAlternatingBackGroundLine { color:#FFFFEE; }.ColorComment { color:green; }.ColorServerSideTag { color:green; }.ColorDataBinding { color:dodgerblue; }.ColorControlTag { color:maroon; }.ColorAspTemplateTag { color:green; }.ColorStartHtmlTag { color:blue; }.ColorEndHtmlTag { color:blue; }.ColorVBKeyword { color:blue; }.ColorVBComment { color:green; }.ColorCSKeyword { color:blue; }.ColorSQLKeyword { color:blue; }.ColorCSComment { color:green; }.ColorSQLComment { color:green; }.ColorSQLFunctions { color:maroon; }.ColorSQLDataTypes { color:green; }&lt;/style&gt;
&lt;pre class="ShowCode"&gt;&lt;span class="ColorLineNumber"&gt;1:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;using&lt;/span&gt; System;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;2:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;using&lt;/span&gt; System.Web;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;3:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;using&lt;/span&gt; System.Collections;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;4:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;using&lt;/span&gt; System.Configuration;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;5:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;using&lt;/span&gt; System.Collections.Specialized;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;6:     &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;7:     &lt;/span&gt;&lt;span class="ColorCSKeyword"&gt;namespace&lt;/span&gt; HttpSslSwitcher
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;8:     &lt;/span&gt;{
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;9:     &lt;/span&gt;    &lt;span class="ColorCSComment"&gt;/// &amp;lt;summary&amp;gt;
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;10:    &lt;/span&gt;    &lt;span class="ColorCSComment"&gt;/// Summary description for SslSwitcher.
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;11:    &lt;/span&gt;    &lt;span class="ColorCSComment"&gt;/// &amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;12:    &lt;/span&gt;    &lt;span class="ColorCSKeyword"&gt;public&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;class&lt;/span&gt; SslSwitcher : IHttpModule
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;13:    &lt;/span&gt;    {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;14:    &lt;/span&gt;        &lt;span class="ColorCSKeyword"&gt;public&lt;/span&gt; SslSwitcher()
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;15:    &lt;/span&gt;        {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;16:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;//
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;17:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;// TODO: Add constructor logic here
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;18:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;//
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;19:    &lt;/span&gt;        }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;20:    &lt;/span&gt;        #region IHttpModule Members
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;21:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;22:    &lt;/span&gt;        &lt;span class="ColorCSKeyword"&gt;public&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; Init(HttpApplication context)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;23:    &lt;/span&gt;        {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;24:    &lt;/span&gt;            context.PreRequestHandlerExecute += &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; EventHandler(context_PreRequestHandlerExecute);
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;25:    &lt;/span&gt;        }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;26:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;27:    &lt;/span&gt;        &lt;span class="ColorCSKeyword"&gt;public&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; Dispose()
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;28:    &lt;/span&gt;        {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;29:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;// Nothing To Do
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;30:    &lt;/span&gt;        }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;31:    &lt;/span&gt;        #endregion
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;32:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;33:    &lt;/span&gt;        &lt;span class="ColorCSKeyword"&gt;private&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; context_PreRequestHandlerExecute(object sender, EventArgs e)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;34:    &lt;/span&gt;        {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;35:    &lt;/span&gt;            HttpApplication myApp = (HttpApplication)sender;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;36:    &lt;/span&gt;            HttpContext ctx = HttpContext.Current;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;37:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;38:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;//Get list of files to be secured
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;39:    &lt;/span&gt;            NameValueCollection sslFiles = (NameValueCollection)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;40:    &lt;/span&gt;                ConfigurationSettings.GetConfig("RequiresSSL/RequiresSSL_Files");
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;41:    &lt;/span&gt;            
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;42:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;//Get list of paths to be secured
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;43:    &lt;/span&gt;            NameValueCollection sslPaths = (NameValueCollection)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;44:    &lt;/span&gt;                ConfigurationSettings.GetConfig("RequiresSSL/RequiresSSL_Paths");
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;45:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;46:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;bool&lt;/span&gt; RequiresSSL = &lt;span class="ColorCSKeyword"&gt;false&lt;/span&gt;;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;47:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;48:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;//Simple Screen Writes to let the user know what's going on, what we found
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;49:    &lt;/span&gt;            WriteEntriesToResponse(sslFiles,"Files",ctx);
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;50:    &lt;/span&gt;            WriteEntriesToResponse(sslPaths,"Paths",ctx);
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;51:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;52:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; Host = ctx.Request.Url.Host.ToString();
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;53:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; File = ctx.Request.Url.PathAndQuery.ToLower();
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;54:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;55:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;//Strip queary string for now
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;56:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(File.IndexOf("?") &amp;gt; -1)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;57:    &lt;/span&gt;                File = File.Substring(0,File.IndexOf("?"));
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;58:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;59:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;//First check the paths
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;60:    &lt;/span&gt;            RequiresSSL = IsFileInrequiredCollection(sslPaths, ctx, File);
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;61:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;62:    &lt;/span&gt;            &lt;span class="ColorCSComment"&gt;//Now check the files, only if path doesn't require SSL
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;63:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(RequiresSSL == &lt;span class="ColorCSKeyword"&gt;false&lt;/span&gt;)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;64:    &lt;/span&gt;                RequiresSSL = IsFileInrequiredCollection(sslFiles, ctx, File);
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;65:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;66:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(RequiresSSL &amp;amp;&amp;amp; ctx.Request.IsSecureConnection == &lt;span class="ColorCSKeyword"&gt;false&lt;/span&gt;)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;67:    &lt;/span&gt;                ctx.Response.Redirect(ctx.Request.Url.ToString().ToLower().Replace("http:","https:"));
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;68:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(RequiresSSL == &lt;span class="ColorCSKeyword"&gt;false&lt;/span&gt; &amp;amp;&amp;amp; ctx.Request.IsSecureConnection)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;69:    &lt;/span&gt;                ctx.Response.Redirect(ctx.Request.Url.ToString().ToLower().Replace("https:","http:"));
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;70:    &lt;/span&gt;        }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;71:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;72:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;73:    &lt;/span&gt;        &lt;span class="ColorCSKeyword"&gt;private&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;bool&lt;/span&gt; IsFileInrequiredCollection(NameValueCollection nv, HttpContext ctx, &lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; filename)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;74:    &lt;/span&gt;        {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;75:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;bool&lt;/span&gt; RequiresSSL = &lt;span class="ColorCSKeyword"&gt;false&lt;/span&gt;;        
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;76:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;foreach&lt;/span&gt;(&lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; key &lt;span class="ColorCSKeyword"&gt;in&lt;/span&gt; nv.Keys)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;77:    &lt;/span&gt;            {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;78:    &lt;/span&gt;                &lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(filename.StartsWith(key.ToLower()) || filename.EndsWith(key.ToLower()))
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;79:    &lt;/span&gt;                {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;80:    &lt;/span&gt;                    RequiresSSL = &lt;span class="ColorCSKeyword"&gt;true&lt;/span&gt;;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;81:    &lt;/span&gt;                    &lt;span class="ColorCSKeyword"&gt;break&lt;/span&gt;;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;82:    &lt;/span&gt;                }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;83:    &lt;/span&gt;            }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;84:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;return&lt;/span&gt; RequiresSSL;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;85:    &lt;/span&gt;        }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;86:    &lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;87:    &lt;/span&gt;        &lt;span class="ColorCSKeyword"&gt;private&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; WriteEntriesToResponse(NameValueCollection nv, &lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; title, HttpContext ctx)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;88:    &lt;/span&gt;        {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;89:    &lt;/span&gt;            ctx.Response.Write("&amp;lt;HR&amp;gt;&amp;lt;B&amp;gt;Secured " + title + " Section&amp;lt;/B&amp;gt;&amp;lt;BR&amp;gt;");
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;90:    &lt;/span&gt;            &lt;span class="ColorCSKeyword"&gt;foreach&lt;/span&gt;(&lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; key &lt;span class="ColorCSKeyword"&gt;in&lt;/span&gt; nv.Keys)
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;91:    &lt;/span&gt;            {
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;92:    &lt;/span&gt;                ctx.Response.Write(key + "&amp;lt;BR&amp;gt;");
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;93:    &lt;/span&gt;            }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;94:    &lt;/span&gt;        }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;95:    &lt;/span&gt;    }
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;96:    &lt;/span&gt;}
&lt;br /&gt;&lt;span class="ColorLineNumber"&gt;97:    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</description><guid isPermaLink="false">f936b1af-eb64-43ca-a3b2-a1c0d3c3c4c1</guid><pubDate>Wed, 28 Apr 2004 14:55:53 GMT</pubDate></item><item><title>Scott Watermasysk's HTML Friendly Code Viewer</title><link>http://scottcate.mykb.com/Article_B3636.aspx</link><description>&lt;p&gt;If you've ever wondered how the color coded C Sharp Code files get displayed in my web pages. Scott Watermasysk's ShowCode.aspx page gives you the ability to paste in a code snippet. The page on post back will then format your code, optionally add line numbers, and give you back a great HTML string that looks beautiful.&lt;/p&gt;
&lt;p&gt;The link is below. The article reference are invaluable if you're showing code online.&lt;/p&gt;
&lt;p&gt;Thanks Scott !!!!&lt;/p&gt;</description><guid isPermaLink="false">4e660975-9fa2-408c-84b7-bff2882a95b3</guid><pubDate>Fri, 02 Apr 2004 16:21:52 GMT</pubDate></item><item><title>Using and Understanding BitWise Operations</title><link>http://scottcate.mykb.com/Article_76476.aspx</link><description>&lt;p&gt;Bitwise Operations are extremely fast, accurate, and amazingly useful. Unfortunately the term "bitwise" is not mainstream, and therefor seems to have an intimidating connotation.&lt;/p&gt;
&lt;p&gt;Remember the old days, when you had a 9600 Baud modem, and you had control over certain options by flipping "Dip Switches" on the back of the modem? You may have not known it, but you were using bitwise security.&lt;/p&gt;
&lt;p&gt;To understand Bitwise operations, you must know we'll be comparing bits. So first, What's a bit? A bit is a zero or one. Plain and simple, nothing more, nothing less. The value of a bit will always have the value 0 or 1.&lt;/p&gt;
&lt;p&gt;So lets look at the binary system that uses bits to represent a number system.&lt;/p&gt;
&lt;p&gt;(The following is blank for white board presentations.)&lt;/p&gt;
&lt;p&gt;
&lt;table cellspacing="10" width="100%" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;
&lt;table cellspacing="2" width="240" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;128&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;64&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;32&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;16&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;&amp;nbsp;8&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;&amp;nbsp;4&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;&amp;nbsp;2&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;1 &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;nbsp; &lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td id=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td id=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td id=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;
&lt;table cellspacing="2" width="240" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;128&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;64&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;32&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;16&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;&amp;nbsp;8&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;&amp;nbsp;4&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;&amp;nbsp;2&lt;/p&gt;&lt;/td&gt;
&lt;td width="30"&gt;
&lt;p align="center"&gt;1 &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td id=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp; &lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td id=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp; &lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td id=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;The integer 8 is represented in binary as 1000.&lt;/p&gt;
&lt;p&gt;|&amp;nbsp; 8&amp;nbsp; |&amp;nbsp; 4&amp;nbsp; |&amp;nbsp; 2&amp;nbsp; |&amp;nbsp; 1&amp;nbsp; |&lt;br /&gt;------------------&lt;br /&gt;|&amp;nbsp; 1&amp;nbsp; |&amp;nbsp; 0&amp;nbsp; |&amp;nbsp; 0&amp;nbsp; |&amp;nbsp; 0&amp;nbsp; |&lt;/p&gt;
&lt;p&gt;The integer 9 is represented in binary as 1001.&lt;/p&gt;
&lt;p&gt;|&amp;nbsp; 8&amp;nbsp; |&amp;nbsp; 4&amp;nbsp; |&amp;nbsp; 2&amp;nbsp; |&amp;nbsp; 1&amp;nbsp; |&lt;br /&gt;------------------&lt;br /&gt;|&amp;nbsp; 1&amp;nbsp; |&amp;nbsp; 0&amp;nbsp; |&amp;nbsp; 0&amp;nbsp; |&amp;nbsp;&amp;nbsp;1&amp;nbsp; |&lt;/p&gt;
&lt;p&gt;The integer 10 is represented in binary as 1010.&lt;/p&gt;
&lt;p&gt;|&amp;nbsp; 8&amp;nbsp; |&amp;nbsp; 4&amp;nbsp; |&amp;nbsp; 2&amp;nbsp; |&amp;nbsp; 1&amp;nbsp; |&lt;br /&gt;------------------&lt;br /&gt;|&amp;nbsp; 1&amp;nbsp; |&amp;nbsp; 0&amp;nbsp; |&amp;nbsp;&amp;nbsp;1&amp;nbsp; |&amp;nbsp; 0&amp;nbsp; |&lt;/p&gt;
&lt;p&gt;The integer 13 is represented in binary as 1101.&lt;/p&gt;
&lt;p&gt;|&amp;nbsp; 8&amp;nbsp; |&amp;nbsp; 4&amp;nbsp; |&amp;nbsp; 2&amp;nbsp; |&amp;nbsp; 1&amp;nbsp; |&lt;br /&gt;------------------&lt;br /&gt;|&amp;nbsp; 1&amp;nbsp; |&amp;nbsp;&amp;nbsp;1&amp;nbsp; |&amp;nbsp; 0&amp;nbsp; |&amp;nbsp; 0&amp;nbsp; |&lt;/p&gt;
&lt;p&gt;Okay, enough examples.&lt;/p&gt;
&lt;p&gt;Going back to the modem example, image a bank of four bit switched, that can be flipped up or down. This gives us 16 combinations. 0000 - 1111. These values represented in integer values would be 0 - 15.&lt;/p&gt;
&lt;p&gt;Okay, so now we have a general understanding of binary. What does this have to do with bitwise operations while programming in C# or VB.NET?&lt;/p&gt;
&lt;p&gt;Well imagine that our program needs to read the dip switch settings from our modem above. We basically have 4 options that can be turned on or off, right? Lets assume that we're reading the switches from left to right, the options are ....&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show Power Light (Left most switch) [Value 8] 
&lt;li&gt;Show Outbound Bandwidth Light [Value = 4] 
&lt;li&gt;Show Inbound Bandwidth Light [Value=2] 
&lt;li&gt;Show Any Activity Light (Right most switch) [Value=1]&lt;/li&gt;&lt;/ul&gt;
&lt;hr /&gt;

&lt;p&gt;&amp;nbsp;(I've ran out of time today, and can't finish the article. Hopefully I'll have tim in the future to come back and finish this article.)&lt;/p&gt;</description><guid isPermaLink="false">38374de6-6883-4385-ad1a-4c4a9fc95d0e</guid><pubDate>Fri, 02 Apr 2004 14:37:50 GMT</pubDate></item><item><title>HttpContext.Cache Viewer (With DataSet Support)</title><link>http://scottcate.mykb.com/Article_726A9.aspx</link><description>&lt;p&gt;Aw, the HttpContext.Cache. Most of the items I place in the Cache are named with GUID's so it's not very helpful to loop through and print out the Cache Item Name. I've built this handy ASPX page that gives a nice little view of the Cache in human readable form. All the Datasets, are displayed, including the DataTables. now keep in mind, that I'm not worried about the graphic design, or the looks here, I just wanted to make something work. I did add a little javascript to expand/collapse the items since they tend to be rather large.&lt;/p&gt;
&lt;p&gt;I'm happy to answer questions, and I'm eager for advice, on a better way, faster way, or just general feedback on the code.&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt; 
&lt;style type="text/css"&gt;PRE.ShowCode {BACKGROUND-COLOR:#ffffff;PADDING-RIGHT: 3px;Border: 0px;FONT-SIZE: 11px;PADDING-BOTTOM: 0px;PADDING-TOP: 0px;FONT-FAMILY: "Courier New";}.ColorLineNumber { color:red; }.DefaultFontFace { color:arial; }.DefaultFontSize { size:3; }.ColorBackGroundLine { color:#EEEECC; }.ColorAlternatingBackGroundLine { color:#FFFFEE; }.ColorComment { color:green; }.ColorServerSideTag { color:green; }.ColorDataBinding { color:dodgerblue; }.ColorControlTag { color:maroon; }.ColorAspTemplateTag { color:green; }.ColorStartHtmlTag { color:blue; }.ColorEndHtmlTag { color:blue; }.ColorVBKeyword { color:blue; }.ColorVBComment { color:green; }.ColorCSKeyword { color:blue; }.ColorSQLKeyword { color:blue; }.ColorCSComment { color:green; }.ColorSQLComment { color:green; }.ColorSQLFunctions { color:maroon; }.ColorSQLDataTypes { color:green; }&lt;/style&gt;
&lt;/p&gt;&lt;pre class="ShowCode"&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;!&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;DOCTYPE&lt;/span&gt; HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" &lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;script&lt;/span&gt; language="javascript"&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;!&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;--&lt;/span&gt;
&lt;br /&gt;   function OpenOrCloseSpan(spanTag)
&lt;br /&gt;   {
&lt;br /&gt;      var st = document.getElementById( spanTag );
&lt;br /&gt;      if ( st.style.display == 'none' )
&lt;br /&gt;         st.style.display = '';
&lt;br /&gt;      else
&lt;br /&gt;         st.style.display = 'none';
&lt;br /&gt;   }
&lt;br /&gt;// --&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;script&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;HTML&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;HEAD&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;title&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;Display Cache Keys And Values&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;title&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;HEAD&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;body&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;a&lt;/span&gt; href="DisplayCacheKeyValues.aspx"&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;Refresh Page&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;a&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;form&lt;/span&gt; id="Form1" method="post" runat="server"&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;         &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;&lt;/span&gt;&lt;span class="ColorAspTemplateTag" dddd&gt;&lt;b&gt;asp:PlaceHolder ID="phTable" Runat="server" &lt;span class="ColorEndHtmlTag" xxxx&gt;/&amp;gt;&lt;/span&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;form&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;   &lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;body&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class="ColorStartHtmlTag" zzzzz&gt;&amp;lt;/&lt;/span&gt;&lt;span class="ColorControlTag" yyy&gt;HTML&lt;/span&gt;&lt;span class="ColorEndHtmlTag" xxxx&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="ShowCode"&gt;&lt;!--This code was color coded by TripleASP.Net's ShowCode For more information, please view http://TripleASP.Net/ShowCode.aspx You can add ShowCode to your own application by using our web service: http://TripleASP.Net/Services/ShowCode.asmx --&gt;&lt;style type="text/css"&gt;PRE.ShowCode {BACKGROUND-COLOR:#ffffff;PADDING-RIGHT: 3px;Border: 0px;FONT-SIZE: 11px;PADDING-BOTTOM: 0px;PADDING-TOP: 0px;FONT-FAMILY: "Courier New";}.ColorLineNumber { color:red; }.DefaultFontFace { color:arial; }.DefaultFontSize { size:3; }.ColorBackGroundLine { color:#EEEECC; }.ColorAlternatingBackGroundLine { color:#FFFFEE; }.ColorComment { color:green; }.ColorServerSideTag { color:green; }.ColorDataBinding { color:dodgerblue; }.ColorControlTag { color:maroon; }.ColorAspTemplateTag { color:green; }.ColorStartHtmlTag { color:blue; }.ColorEndHtmlTag { color:blue; }.ColorVBKeyword { color:blue; }.ColorVBComment { color:green; }.ColorCSKeyword { color:blue; }.ColorSQLKeyword { color:blue; }.ColorCSComment { color:green; }.ColorSQLComment { color:green; }.ColorSQLFunctions { color:maroon; }.ColorSQLDataTypes { color:green; }&lt;/style&gt;&lt;/pre&gt;&lt;pre class="ShowCode"&gt;&lt;span class="ColorCSKeyword"&gt;protected&lt;/span&gt; System.Web.UI.WebControls.PlaceHolder phTable;
&lt;br /&gt;
&lt;br /&gt;&lt;span class="ColorCSKeyword"&gt;private&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; Page_Load(object sender, System.EventArgs e)
&lt;br /&gt;{
&lt;br /&gt;    &lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(!Page.IsPostBack)
&lt;br /&gt;    {
&lt;br /&gt;        GetAndDisplayCacheItems();
&lt;br /&gt;    }
&lt;br /&gt;    &lt;span class="ColorCSKeyword"&gt;else&lt;/span&gt;
&lt;br /&gt;    {
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//These have to be bound to fire the event. This method
&lt;/span&gt;&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Bind the link buttons, but without the rest of the over head
&lt;/span&gt;&lt;br /&gt;        CreateAndBindRemoveButtons();
&lt;br /&gt;    }
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;&lt;span class="ColorCSKeyword"&gt;private&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; GetAndDisplayCacheItems()
&lt;br /&gt;{
&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;//this stringbuilder gets used throughout the method as needed.
&lt;/span&gt;&lt;br /&gt;    StringBuilder sb = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; StringBuilder();
&lt;br /&gt;
&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;//Grab the context item, for reference so it has local scope to
&lt;/span&gt;&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;//save having to get walk back and get the Context item
&lt;/span&gt;&lt;br /&gt;    HttpContext ctx = HttpContext.Current;
&lt;br /&gt;    IDictionaryEnumerator d = ctx.Cache.GetEnumerator();
&lt;br /&gt;    &lt;span class="ColorCSKeyword"&gt;while&lt;/span&gt;(d.MoveNext())
&lt;br /&gt;    {
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;// Create HTML table for display of each item in cache
&lt;/span&gt;&lt;br /&gt;        HtmlTable t = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; HtmlTable();
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Set General Table Properties
&lt;/span&gt;&lt;br /&gt;        t.BorderColor = "FF0000";
&lt;br /&gt;        t.CellPadding = 10;
&lt;br /&gt;        t.CellSpacing = 0;
&lt;br /&gt;        t.Border = 1;
&lt;br /&gt;        
&lt;br /&gt;        HtmlTableRow r = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; HtmlTableRow();
&lt;br /&gt;        HtmlTableCell CacheKeyTableCell = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; HtmlTableCell();
&lt;br /&gt;        CacheKeyTableCell.VAlign = "top";
&lt;br /&gt;
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Clear the stringbuilder and add the CachItem Type and value
&lt;/span&gt;&lt;br /&gt;        sb.Length = 0;
&lt;br /&gt;        sb.Append("&amp;lt;B&amp;gt;Cache Item Type: &amp;lt;/B&amp;gt;");
&lt;br /&gt;        sb.Append(ctx.Cache[d.Key.ToString()].GetType().ToString());
&lt;br /&gt;        sb.Append("&amp;lt;BR /&amp;gt;&amp;lt;B&amp;gt;Value: &amp;lt;/B&amp;gt;&amp;lt;BR /&amp;gt;");
&lt;br /&gt;        sb.Append(Server.HtmlEncode(d.Value.ToString()));
&lt;br /&gt;
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Add the Item Type
&lt;/span&gt;&lt;br /&gt;        CacheKeyTableCell.Controls.Add(&lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; LiteralControl(sb.ToString()));
&lt;br /&gt;        r.Cells.Add(CacheKeyTableCell);
&lt;br /&gt;
&lt;br /&gt;        HtmlTableCell CacheValueTableCell = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; HtmlTableCell();
&lt;br /&gt;        &lt;span class="ColorCSKeyword"&gt;switch&lt;/span&gt;(d.Value.ToString())
&lt;br /&gt;        {
&lt;br /&gt;                &lt;span class="ColorCSComment"&gt;//This is the fun code, that turns dataset tables,
&lt;/span&gt;&lt;br /&gt;                &lt;span class="ColorCSComment"&gt;//into HTML Tables
&lt;/span&gt;&lt;br /&gt;            &lt;span class="ColorCSKeyword"&gt;case&lt;/span&gt; "System.Data.DataSet" :
&lt;br /&gt;                &lt;span class="ColorCSComment"&gt;//Coutner to Create a label
&lt;/span&gt;&lt;br /&gt;                &lt;span class="ColorCSKeyword"&gt;int&lt;/span&gt; tblCounter = 0;
&lt;br /&gt;                &lt;span class="ColorCSComment"&gt;//Create a new dataset to be used as a copy of the cached dataset
&lt;/span&gt;&lt;br /&gt;                &lt;span class="ColorCSComment"&gt;//We do this, becuase some of the values get manipulated and we
&lt;/span&gt;&lt;br /&gt;                &lt;span class="ColorCSComment"&gt;//don't want to chagne the actual values.
&lt;/span&gt;&lt;br /&gt;                DataSet ds = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; DataSet();
&lt;br /&gt;                &lt;span class="ColorCSComment"&gt;//Get copy of dataset from Cache
&lt;/span&gt;&lt;br /&gt;                ds = ((DataSet)ctx.Cache[d.Key.ToString()]).Copy();
&lt;br /&gt;                &lt;span class="ColorCSComment"&gt;//Iterate throguht the tables in the dataset
&lt;/span&gt;&lt;br /&gt;                &lt;span class="ColorCSKeyword"&gt;foreach&lt;/span&gt;(DataTable dt &lt;span class="ColorCSKeyword"&gt;in&lt;/span&gt; ds.Tables)
&lt;br /&gt;                {
&lt;br /&gt;                    &lt;span class="ColorCSComment"&gt;//Set flag to see if the table has rows.
&lt;/span&gt;&lt;br /&gt;                    &lt;span class="ColorCSComment"&gt;//We won't add empty tables to the view
&lt;/span&gt;&lt;br /&gt;                    &lt;span class="ColorCSKeyword"&gt;bool&lt;/span&gt; rowsProcessed = &lt;span class="ColorCSKeyword"&gt;false&lt;/span&gt;;
&lt;br /&gt;                    &lt;span class="ColorCSKeyword"&gt;foreach&lt;/span&gt;(DataRow dr &lt;span class="ColorCSKeyword"&gt;in&lt;/span&gt; dt.Rows )
&lt;br /&gt;                    {
&lt;br /&gt;                        &lt;span class="ColorCSComment"&gt;//Found rows, set flag to true
&lt;/span&gt;&lt;br /&gt;                        rowsProcessed = &lt;span class="ColorCSKeyword"&gt;true&lt;/span&gt;;
&lt;br /&gt;                        &lt;span class="ColorCSComment"&gt;//loop through each colomn int he DataRow and convert
&lt;/span&gt;&lt;br /&gt;                        &lt;span class="ColorCSComment"&gt;//any text, to HTML text. A lot of cached data, is data that
&lt;/span&gt;&lt;br /&gt;                        &lt;span class="ColorCSComment"&gt;//gets rendered as XML, or HTML, so this makes the data human
&lt;/span&gt;&lt;br /&gt;                        &lt;span class="ColorCSComment"&gt;//readable. This is the reason for working with a copy of the
&lt;/span&gt;&lt;br /&gt;                        &lt;span class="ColorCSComment"&gt;//dataset, and not the real cached item.
&lt;/span&gt;&lt;br /&gt;                        &lt;span class="ColorCSKeyword"&gt;for&lt;/span&gt;(&lt;span class="ColorCSKeyword"&gt;int&lt;/span&gt; x = 0; x &amp;lt; dr.ItemArray.GetLength(0); x++)
&lt;br /&gt;                        {
&lt;br /&gt;                            &lt;span class="ColorCSComment"&gt;//This is my sloppy way to catch nulls, and any other
&lt;/span&gt;&lt;br /&gt;                            &lt;span class="ColorCSComment"&gt;//conversion errors.
&lt;/span&gt;&lt;br /&gt;                            &lt;span class="ColorCSKeyword"&gt;try&lt;/span&gt;
&lt;br /&gt;                            {
&lt;br /&gt;                                &lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; columnData = Server.HtmlEncode(dr[x].ToString());
&lt;br /&gt;                                dr[x] = columnData;
&lt;br /&gt;                            }
&lt;br /&gt;                            &lt;span class="ColorCSKeyword"&gt;catch&lt;/span&gt; {}
&lt;br /&gt;                        }
&lt;br /&gt;                    }
&lt;br /&gt;                    &lt;span class="ColorCSComment"&gt;//Add populated tables to ValueTableCell, via
&lt;/span&gt;&lt;br /&gt;                    &lt;span class="ColorCSComment"&gt;//new datagrid.AutoGenerateColumns
&lt;/span&gt;&lt;br /&gt;                    &lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(rowsProcessed)
&lt;br /&gt;                    {
&lt;br /&gt;                        &lt;span class="ColorCSComment"&gt;//Add Seperation bar between Tables
&lt;/span&gt;&lt;br /&gt;                        &lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(tblCounter &amp;gt; 0)
&lt;br /&gt;                        {
&lt;br /&gt;                            CacheValueTableCell.Controls.Add(&lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; LiteralControl("&amp;lt;HR&amp;gt;"));
&lt;br /&gt;                        }
&lt;br /&gt;                        DataGrid dg = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; DataGrid();
&lt;br /&gt;                        dg.GridLines = GridLines.Both;
&lt;br /&gt;                        dg.AutoGenerateColumns = &lt;span class="ColorCSKeyword"&gt;true&lt;/span&gt;;
&lt;br /&gt;                        dg.BorderColor = Color.Black;
&lt;br /&gt;                        dg.BorderWidth = Unit.Pixel(2);
&lt;br /&gt;                        dg.DataSource = dt;
&lt;br /&gt;                        dg.DataBind();
&lt;br /&gt;                        &lt;span class="ColorCSComment"&gt;//Set some styles on the columns for readability
&lt;/span&gt;&lt;br /&gt;                        &lt;span class="ColorCSKeyword"&gt;foreach&lt;/span&gt;(DataGridColumn c &lt;span class="ColorCSKeyword"&gt;in&lt;/span&gt; dg.Columns)
&lt;br /&gt;                        {
&lt;br /&gt;                            c.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
&lt;br /&gt;                            c.ItemStyle.VerticalAlign = VerticalAlign.Top;
&lt;br /&gt;                        }
&lt;br /&gt;                        &lt;span class="ColorCSComment"&gt;//Add a Table Counter Label
&lt;/span&gt;&lt;br /&gt;                        sb.Length = 0;
&lt;br /&gt;                        sb.Append("DataTable ");
&lt;br /&gt;                        sb.Append(tblCounter.ToString());
&lt;br /&gt;                        sb.Append("&amp;lt;BR /&amp;gt;");
&lt;br /&gt;                        CacheValueTableCell.Controls.Add(&lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; LiteralControl(sb.ToString()));
&lt;br /&gt;                        CacheValueTableCell.Controls.Add(dg);
&lt;br /&gt;                    }
&lt;br /&gt;                    tblCounter++;
&lt;br /&gt;                }
&lt;br /&gt;                r.Cells.Add(CacheValueTableCell);
&lt;br /&gt;                &lt;span class="ColorCSKeyword"&gt;break&lt;/span&gt;;
&lt;br /&gt;            &lt;span class="ColorCSKeyword"&gt;default&lt;/span&gt; :
&lt;br /&gt;                &lt;span class="ColorCSKeyword"&gt;break&lt;/span&gt;;
&lt;br /&gt;        }
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Add the row to the HTML table
&lt;/span&gt;&lt;br /&gt;        t.Rows.Add(r);
&lt;br /&gt;
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Start &amp;lt;P&amp;gt; Tag
&lt;/span&gt;&lt;br /&gt;        phTable.Controls.Add(&lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; LiteralControl("&amp;lt;P&amp;gt;"));
&lt;br /&gt;
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Create and add Remove Link Button
&lt;/span&gt;&lt;br /&gt;        phTable.Controls.Add(CreateRemoveLinkButton(d.Key.ToString()));
&lt;br /&gt;
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Add a spacer between the remove link button and the open/close javascript
&lt;/span&gt;&lt;br /&gt;        phTable.Controls.Add(&lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; LiteralControl("&amp;amp;nbsp;"));
&lt;br /&gt;
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Create and add the anchor tag to open/close javascript
&lt;/span&gt;&lt;br /&gt;        HtmlAnchor a = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; HtmlAnchor();
&lt;br /&gt;        a.HRef= "Javascript:OpenOrCloseSpan('Span_" + d.Key.ToString() + "')";
&lt;br /&gt;        a.Controls.Add(&lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; LiteralControl("Open/Close"));
&lt;br /&gt;        phTable.Controls.Add(a);
&lt;br /&gt;
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Create and add the Name of the Cache Item (preeceded with a space)
&lt;/span&gt;&lt;br /&gt;        StringBuilder CacheItemDisplayName = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; StringBuilder();
&lt;br /&gt;        CacheItemDisplayName.Append("&amp;amp;nbsp;");
&lt;br /&gt;        CacheItemDisplayName.Append(d.Key.ToString());
&lt;br /&gt;
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Add the Open Span Tag and ID for javascript to open and close
&lt;/span&gt;&lt;br /&gt;        CacheItemDisplayName.Append("&amp;lt;span id=\"span_");
&lt;br /&gt;        CacheItemDisplayName.Append(d.Key.ToString());
&lt;br /&gt;        CacheItemDisplayName.Append("\" style=\"Display: None\"&amp;gt;");
&lt;br /&gt;        phTable.Controls.Add(&lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; LiteralControl(CacheItemDisplayName.ToString()));
&lt;br /&gt;        
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Add the data table to the placeholder
&lt;/span&gt;&lt;br /&gt;        phTable.Controls.Add(t);
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Add the closing Span and P tags.
&lt;/span&gt;&lt;br /&gt;        phTable.Controls.Add(&lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; LiteralControl("&amp;lt;/span&amp;gt;&amp;lt;/P&amp;gt;"));
&lt;br /&gt;    }
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;&lt;span class="ColorCSKeyword"&gt;private&lt;/span&gt; LinkButton CreateRemoveLinkButton(&lt;span class="ColorCSKeyword"&gt;string&lt;/span&gt; buttonID)
&lt;br /&gt;{
&lt;br /&gt;    LinkButton RemoveLinkButton = &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; LinkButton();
&lt;br /&gt;    RemoveLinkButton.Text = "Remove";
&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;//Set the ID of the LinkButton to the Cache Key Name.
&lt;/span&gt;&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;//This is going to be used in the eventhandler, to remove item from cache
&lt;/span&gt;&lt;br /&gt;    RemoveLinkButton.ID = buttonID;
&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;//Wire up event
&lt;/span&gt;&lt;br /&gt;    RemoveLinkButton.Click += &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; EventHandler(RemoveLinkButton_Click);
&lt;br /&gt;    &lt;span class="ColorCSKeyword"&gt;return&lt;/span&gt; RemoveLinkButton;
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;&lt;span class="ColorCSKeyword"&gt;private&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; CreateAndBindRemoveButtons()
&lt;br /&gt;{
&lt;br /&gt;    HttpContext ctx = HttpContext.Current;
&lt;br /&gt;    IDictionaryEnumerator d = ctx.Cache.GetEnumerator();
&lt;br /&gt;    &lt;span class="ColorCSKeyword"&gt;while&lt;/span&gt;(d.MoveNext())
&lt;br /&gt;    {
&lt;br /&gt;        phTable.Controls.Add(CreateRemoveLinkButton(d.Key.ToString()));
&lt;br /&gt;    }
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;&lt;span class="ColorCSKeyword"&gt;private&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; RemoveLinkButton_Click(object sender, EventArgs e)
&lt;br /&gt;{
&lt;br /&gt;    HttpContext ctx = HttpContext.Current;
&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;//Cast sender as LinkButton and Check if still in cache
&lt;/span&gt;&lt;br /&gt;    &lt;span class="ColorCSKeyword"&gt;if&lt;/span&gt;(ctx.Cache[((LinkButton)sender).ID] != &lt;span class="ColorCSKeyword"&gt;null&lt;/span&gt;)
&lt;br /&gt;    {
&lt;br /&gt;        &lt;span class="ColorCSComment"&gt;//Remove item from Cache
&lt;/span&gt;&lt;br /&gt;        ctx.Cache.Remove(((LinkButton)sender).ID);
&lt;br /&gt;    }
&lt;br /&gt;    phTable.Controls.Clear();
&lt;br /&gt;    GetAndDisplayCacheItems();
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;#region Web Form Designer generated code
&lt;br /&gt;override &lt;span class="ColorCSKeyword"&gt;protected&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; OnInit(EventArgs e)
&lt;br /&gt;{
&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;//
&lt;/span&gt;&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;// CODEGEN: This call is required by the ASP.NET Web Form Designer.
&lt;/span&gt;&lt;br /&gt;    &lt;span class="ColorCSComment"&gt;//
&lt;/span&gt;&lt;br /&gt;    InitializeComponent();
&lt;br /&gt;    &lt;span class="ColorCSKeyword"&gt;base&lt;/span&gt;.OnInit(e);
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;&lt;span class="ColorCSComment"&gt;/// &amp;lt;summary&amp;gt;
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorCSComment"&gt;/// Required method for Designer support - do not modify
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorCSComment"&gt;/// the contents of this method with the code editor.
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorCSComment"&gt;/// &amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;br /&gt;&lt;span class="ColorCSKeyword"&gt;private&lt;/span&gt; &lt;span class="ColorCSKeyword"&gt;void&lt;/span&gt; InitializeComponent()
&lt;br /&gt;{    
&lt;br /&gt;    &lt;span class="ColorCSKeyword"&gt;this&lt;/span&gt;.Load += &lt;span class="ColorCSKeyword"&gt;new&lt;/span&gt; System.EventHandler(&lt;span class="ColorCSKeyword"&gt;this&lt;/span&gt;.Page_Load);
&lt;br /&gt;}
&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</description><guid isPermaLink="false">19dec62f-e047-4207-8ebe-ed945c9132a0</guid><pubDate>Thu, 05 Feb 2004 01:24:31 GMT</pubDate></item><item><title>New Photo Album Application</title><link>http://scottcate.mykb.com/Article_3847C.aspx</link><description>&lt;p&gt;I just treated myself to a new digital camera. I've been wanting this camera since I saw it over a year ago. A friend of mine took my picture with this credit card sized camera, and I was in love with it ever since. My goal was to have a camera I could carry around, and not look like a tourist, so the number one objective was size. The &lt;a href="http://exilim.casio.com/" target="_Blank"&gt;Casio Exilim 3.2 S2&lt;/a&gt; is perfect for my needs. It's external memory uses Secure Digital cards, which are also in use on my pocket PC phone, and my laptop, the second biggest selling point.&lt;/p&gt;
&lt;p&gt;So now I have all these pictures how am I going to share them? Last weekend I went hiking with a small group of 10 people, and of course I'm picture snap happy. So I decided to build a little app that would just work for me on my site. All I want to do is FTP JPG files up to my web server, and have this little application do the rest.&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;!&lt;/font&gt;&lt;font color="#008000" size="2"&gt;-- &amp;lt;add key="PhotoPath" value="Whatever" /&amp;gt; --&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&amp;lt;!&lt;/font&gt;&lt;font color="#008000" size="2"&gt;-- Default = Current Dir --&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;add&lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;key&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="LowResImageWidth"&lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;value&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="600"&lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;!&lt;/font&gt;&lt;font color="#008000" size="2"&gt;-- Default = 600 --&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;add&lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;key&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="ImagesPerRow"&lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;value&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="4"&lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&amp;lt;!&lt;/font&gt;&lt;font color="#008000" size="2"&gt;-- Default = 4 --&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;add&lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;key&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="ThumbnailImageWidth"&lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;value&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="125"&lt;/font&gt;&lt;font color="#ff00ff" size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&amp;lt;!&lt;/font&gt;&lt;font color="#008000" size="2"&gt;-- Default = 125 --&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;In the web.config I set the "PhotoPath", "ThumbnailImageWidth", "ImagesPerRow", and "LowResImageWidth" properties. After that, all you'll have to do, to throw the DLL in your BIN directory, and all your code will be e-mailed to me. HaHa just kidding, seeing if you're paying attention. All the appSettings have defaults set int eh code, so they are not necessary, unless you want to change the values.&lt;/p&gt;
&lt;p&gt;The "RootImageDirectory" property should be set to the Subdirectory that you plan to place your images in, and this will also be the directory, that you place the following 3 files.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Default.aspx (This is just a placeholder for Album.ascx)&lt;/li&gt;
&lt;li&gt;ShowImage.aspx (This is the Low Res - Resize Code)&lt;/li&gt;
&lt;li&gt;Album.ascx (This is the repeated user control)&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;When the Default.aspx page loads, it looks for JPG files. If it finds them, it looks for a Directory named "TN" for Thumbnail. If it finds the Dir, it checks to see if the same filename is found, if it is, it shows the thumbnail, if it isn't, it creates&amp;nbsp;it, and then shows the thumbnail.&lt;/p&gt;
&lt;p&gt;Because the application is writing to your directories, you'll need to grant the asp.net worker process account write permissions to the directories.&lt;/p&gt;
&lt;p&gt;For those of you, a little more enthusiastic, the entire project code is also available here.&lt;/p&gt;
&lt;p&gt;This code is not warranted, has not been tested, and is available&amp;nbsp;for example use only. Please use it at your own risk........ Basically, you can use it, steal it, say it was yours, but just don't delete your hard drive and come blaming me.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><guid isPermaLink="false">9994da61-34cb-4401-bde0-a4787f3c3a87</guid><pubDate>Sat, 31 Jan 2004 20:41:51 GMT</pubDate></item><item><title>[WINDOWS KEY] - More then just the start menu</title><link>http://scottcate.mykb.com/Article_DD4AD.aspx</link><description>&lt;p&gt;The [WINDOWS KEY]&amp;nbsp;usually found on your keyboard on either side of the space bar, or possibly on the outside of the [ALT] keys by&amp;nbsp;pace-bar. If you don't have a [WINDOWS KEY] then this article can't help you, other then to have a general knowledge of the actions, but it seems to me that people are usually keyboard or mouse driven people, and if you don't use these commands on a regular basis, then you'll forget and never use them.&lt;/p&gt;
&lt;p&gt;Most&amp;nbsp;people use this key as a single keystroke to activate the start menu.&lt;/p&gt;
&lt;p&gt;This key is actually used for more then your Start Menu and I use it a ton, especially when I'm using someone else's machine.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[WINDOWS KEY] + [E] = Launch Windows Explorer 
&lt;li&gt;[WINDOWS KEY] + [R] = Same as Start | Run 
&lt;li&gt;[WINDOWS KEY] + [M] = Minimize all Windows 
&lt;li&gt;[SHIFT] + [WINDOWS KEY] + [M] = Undo Minimize all Windows 
&lt;li&gt;[WINDOWS KEY] + [D] =&amp;nbsp;Toggle Desktop On|Off 
&lt;ul&gt;
&lt;li&gt;This is the same as [M] but when you toggle all your applications are still in place, instead of being minimized.&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;[WINDOWS KEY] + [U] = Launch Utility Manager 
&lt;li&gt;[WINDOWS KEY] + [F] = Same as Start | Find 
&lt;li&gt;[WINDOWS KEY] + [L] =&amp;nbsp;Lock&amp;nbsp;Computer - Same as [CTRL]+[ALT]+[DELETE] and then click or select "Lock Computer"&amp;nbsp;
&lt;li&gt;[WINDOWS KEY] + [CTRL] + [F] = Find Computers 
&lt;li&gt;[WINDOWS KEY] +&amp;nbsp;[TAB] = Start Bar Focus, on the application list 
&lt;ul&gt;
&lt;li&gt;Then use [RIGHT] and [LEFT] arrow keys to move back and forth, press [ENTER] to activate application.&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;[CTRL] + [WINDOWS KEY] +&amp;nbsp;[TAB] = Ever wanted keyboard access to your system tray? 
&lt;ul&gt;
&lt;li&gt;This is VERY helpful if you end up mouseless. 
&lt;li&gt;It's kinda weird, some systems make you [WINDOWS KEY] +&amp;nbsp;[TAB] to set focus to the start bar application list, then [CTRL] + [WINDOWS KEY] +&amp;nbsp;[TAB] will move over tot he System Tray.&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;[WINDOWS KEY] +&amp;nbsp;[BREAK] = Launch System Properties&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;If you know of more, send me an e-mail (&amp;nbsp;&lt;a href="mailto:scottc@myKBPro.com"&gt;scottc@myKBPro.com&lt;/a&gt; ) and I'll get them posted.&lt;/p&gt;
&lt;p&gt;Happy Coding&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><guid isPermaLink="false">7cada3f7-4c9b-4310-8437-6f2b09cbe56f</guid><pubDate>Thu, 22 Jan 2004 17:18:36 GMT</pubDate></item><item><title>Microsoft says thanks with an MVP Award for 2004</title><link>http://scottcate.mykb.com/Article_445FD.aspx</link><description>&lt;p&gt;Wew huuuu .... is that how you spell excitement?&lt;/p&gt;
&lt;p&gt;Microsoft has handed me it's most distinguished award for my contributions to the ASP.net and .Net communities with an MVP award. This is most likely because of the success of the &lt;a href="http://www.azdnug.com/"&gt;Arizona .NET User Group&lt;/a&gt; that I run, my Board Member position with &lt;a href="http://www.aspinsiders.com/"&gt;ASPInsiders.com&lt;/a&gt;, and the community site &lt;a href="http://www.kbalertz.com/"&gt;kbAlertz.com&lt;/a&gt;. Official text below.&lt;/p&gt;
&lt;hr /&gt;

&lt;p&gt;Hi Scott,&lt;/p&gt;
&lt;p&gt;I would like to thank you for your community participation for the past year.&amp;nbsp;&amp;nbsp; You have done great work and Microsoft’s customers have been the beneficiaries. &lt;/p&gt;
&lt;p&gt;As you may know, the Microsoft Most Valuable Professional (MVP) award is presented to those whose recent contributions stand out from others in online and offline communities focusing on Microsoft technologies.&lt;/p&gt;
&lt;p&gt;It is with great excitement that I can inform you that you have been awarded as a MVP in ASP.NET for your community contributions in the past year. &lt;/p&gt;
&lt;p&gt;We greatly value your past accomplishments and contributions.&amp;nbsp; Thank you for all of your support and I hope you enjoy the benefits of the MVP program for the next year!&lt;/p&gt;
&lt;p&gt;..........&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Sincerely, &lt;/p&gt;
&lt;p&gt;Microsoft Corporation&lt;br /&gt;Microsoft MVP Lead&lt;br /&gt;&lt;/p&gt;</description><guid isPermaLink="false">46f23354-aafa-4ff0-9aaa-f93ea71a98e7</guid><pubDate>Tue, 20 Jan 2004 15:30:28 GMT</pubDate></item><item><title>Undocumented SQL 2003 Encryption Routines</title><link>http://scottcate.mykb.com/Article_46EB8.aspx</link><description>&lt;p&gt;My good friend &lt;a href="http://www.tatochip.com/"&gt;Brady Gaster&lt;/a&gt;, once again, comes through with the best tip of today. A SQL guru he works with tipped him to this and he shared with me (just so proper credit gets served).&lt;/p&gt;
&lt;p&gt;Really pretty simple actually. Paste this into Query Analyzer.&lt;/p&gt;
&lt;p&gt;select pwdencrypt('Scott Cate') &lt;br /&gt;select pwdcompare('Scott Cate',pwdencrypt('Scott Cate')&lt;/p&gt;
&lt;p&gt;I found &lt;a href="http://www.securiteam.com/windowsntfocus/5BP0F1F7FY.html"&gt;this article&lt;/a&gt; online about a buffer overrun error, but it's pretty old and seems to have been fixed with SP3. They claimed a buffer overrun with this call.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;SELECT pwdencrypt(REPLICATE('A',353))&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I tried it in SP3 and it fails because the parameter is invalid, not because of an overrun.&lt;/p&gt;
&lt;p&gt;Thanks Brady.&lt;/p&gt;
&lt;p&gt;
&lt;table bordercolor="red" cellpadding="5" width="500" align="center" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td id=""&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="red"&gt;Warning/Update:&lt;/font&gt;&lt;/strong&gt; Since I read about and wrote this, I've been sent a couple of links; informing me that this is not a good idea to use. First of all, since it's undocumented the hashing algorithms inside SQL server might change, rendering your pwdCompare() function useless. Also the hashed code itself can be broken pretty easily.&lt;/p&gt;
&lt;p&gt;Thanks &lt;a href="http://www.timheuer.com/"&gt;Tim Heuer&lt;/a&gt; for this &lt;a href="http://www.theregister.co.uk/content/4/26086.html"&gt;link, explaining the vulnerability&lt;/a&gt;.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;</description><guid isPermaLink="false">f60f2ab9-42e6-4615-8280-b5a82e03836e</guid><pubDate>Sun, 30 Nov 2003 02:38:00 GMT</pubDate></item></channel></rss>