<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-7235284</atom:id><lastBuildDate>Fri, 07 May 2010 19:14:38 +0000</lastBuildDate><title>RC 's Code Snippets</title><description>I will post code snippets that I think may be helpful to other people as well as my opinion on programming topics. The code snippets may be written by me or found elsewhere, but either way: Use at your own risk.
&lt;hr size=1&gt;
C#, VB.Net, VB, HTML, DHTML, XML, JavaScript, SQL
&lt;hr size=1&gt;</description><link>http://ryanscook.com/adminsBlog/</link><managingEditor>noreply@blogger.com (quamtar)</managingEditor><generator>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-2608659220233642063</guid><pubDate>Tue, 20 Feb 2007 16:09:00 +0000</pubDate><atom:updated>2010-01-25T09:59:07.254-08:00</atom:updated><title>Firefox &amp; IE - Copy Context Menu Plugin</title><description>&lt;span class="q" id="q_110bc76beb2f9266_1"&gt;I have created a set of browser plugins that are pretty helpful for developers and I thought that I should share them. I have created basically the same plugin for both IE and Firefox. What it does is add a "Copy As Html" and "Copy As Plain Text" to the context (right-click) menu. It is useful if you want to copy the text or underlying html from a web page into word, outlook or visual studio.




Below is a setup file that sort of automates the installation. It will install the IE plugin completely and it will copy the file for the Firefox plugin. You will have to manually open the firefox plugin using firefox and choose "Install" to complete the firefox plugin installation. The plug-in should be installed here: "C:\Program Files\Fillmore Technology Group\Utilities\Firefox\copyMenu_- 1.3.0-fx.xpi", but the actual location will be on the bottom of the last form in the setup wizard.




Since there are plenty of resources on the web that explain how to program these, I am not going to go into any detail on how it was accomplished. I will say that the end result was pretty simple to do, but finding all the information took a little time.



&lt;hr size="1"&gt;

&lt;a style="font-size:9pt;" href="http://ryanscook.com/CopMenuPlugins/copyMenu.msi"&gt;&lt;b&gt;Copy Menu (MSI Installer)&lt;/b&gt;&lt;/a&gt; - &lt;i&gt;About 106 KB&lt;/i&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="q" id="q_110bc76beb2f9266_1"&gt;&lt;i&gt;
&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="q" id="q_110bc76beb2f9266_1"&gt;&lt;i&gt;
&lt;/i&gt;
&lt;a style="font-size:9pt;" href="http://ryanscook.com/CopMenuPlugins/CopyMenu_full.zip"&gt;&lt;b&gt;Copy Menu (Full Windows Installer)&lt;/b&gt;&lt;/a&gt; - &lt;i&gt;About 3.39 MB &lt;b&gt; - not recommended&lt;/b&gt;&lt;/i&gt;



&lt;hr size="1"&gt;



&lt;b&gt;Update:&lt;/b&gt; The Firefox plugin can be installed from the Firefox Add-on site (It now works with 3.6): &lt;a href="https://addons.mozilla.org/firefox/4554"&gt;https://addons.mozilla.org/firefox/4554&lt;/a&gt;

&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="q" id="q_110bc76beb2f9266_1"&gt;
&lt;/span&gt;&lt;div&gt;&lt;span class="q" id="q_110bc76beb2f9266_1"&gt;&lt;span style="text-decoration: line-through"&gt;
or from here:
&lt;a href="http://www.ryanscook.com/CopMenuPlugins/copyMenu_-1.3.0-fx.xpi" title="Install Extended Copy Menu (right-click to download)" onclick="return installExtension(event, 'Extended Copy Menu', null);"&gt;Install Extended Copy Menu 1.3&lt;/a&gt;&lt;/span&gt; - out dated

&lt;/span&gt;&lt;div&gt;&lt;span class="q" id="q_110bc76beb2f9266_1"&gt;







&lt;table align="center" border="0" cellpadding="3" cellspacing="0"&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Firefox&lt;/b&gt;
&lt;img src="http://ryanscook.com/CopMenuPlugins/copyFirefox.gif" style="border: 1px black solid;" /&gt;&lt;/td&gt;&lt;td&gt;&lt;nobr&gt;  &lt;/nobr&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Internet Explorer&lt;/b&gt;
&lt;img src="http://ryanscook.com/CopMenuPlugins/copyIE.gif" style="border: 1px black solid;" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;

&lt;/span&gt;






&lt;iframe width="500" height="75" frameborder="0" src="http://ryanscook.com/AdPages/googlePackAd.html"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-2608659220233642063?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2007/02/firefox-ie-copy-context-menus.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>49</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-116173191649958303</guid><pubDate>Tue, 24 Oct 2006 23:11:00 +0000</pubDate><atom:updated>2007-02-22T15:51:05.562-08:00</atom:updated><title>Online Time Travel</title><description>If you are like me, then you enjoy traveling into the future from time to time. The biggest problem that I faced is when I was away from my time machine but I needed to go to the future. In order to help facilitate my time traveling I created a web-based time machine. Now I can travel into the future from any place that has an internet connection.
&lt;br /&gt;&lt;br /&gt;
The time machine is currently in beta so you can only go short distances into the future at a time. You can use it free of charge by going to: &lt;a href="http://BestTimeMachineEver.com"&gt;BestTimeMachineEver.com&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;Good Luck!&lt;/b&gt;

&lt;br&gt;&lt;br&gt;
&lt;iframe width=500 height=75 frameborder=0 src="http://ryanscook.com/AdPages/FirefoxAd.html"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-116173191649958303?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2006/10/online-time-travel.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>3</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-115570789395125360</guid><pubDate>Wed, 16 Aug 2006 05:56:00 +0000</pubDate><atom:updated>2006-08-15T22:59:53.470-07:00</atom:updated><title>CNC Router</title><description>This is off topic, but I really dont care. I got a new CNC router from IMService. Overall it seems to work pretty well, however I still have some kinks to work out. Below is a link to some picks of the router as well as my first item that I made.

&lt;div style="text-align:center; width:194px; font-family:arial,sans-serif;font-size:83%;"&gt;&lt;div style="height:194px;background:url(http://picasaweb.google.com/f/img/transparent_album_background.gif) no-repeat left;"&gt;&lt;a href="http://picasaweb.google.com/quamtar/IMServiceRouter"&gt;&lt;img src="http://lh6.google.com/quamtar/ROKwKV87ABE/AAAAAAAAAJ4/IPVCxfkBTqE/IMServiceRouter.jpg?crop=1&amp;amp;imgmax=160" width="160" height="160" style="border:none;padding:0px;margin-top:16px;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://picasaweb.google.com/quamtar/IMServiceRouter"&gt;&lt;div style="color:#4D4D4D;font-weight:bold;text-decoration:none;"&gt;IMService Router&lt;/div&gt;&lt;/a&gt;&lt;div style="color:#808080"&gt;Aug 15, 2006 - 42 Photos&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-115570789395125360?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2006/08/cnc-router.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>3</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-114393838525245851</guid><pubDate>Sun, 02 Apr 2006 00:35:00 +0000</pubDate><atom:updated>2007-02-22T16:05:56.996-08:00</atom:updated><title>D3DControl - Update</title><description>There is an update that I have not made completely public yet. It addresses many issues such as multiple controls on a form (swap chains) and adjustable pivot points on the mesh objects. Linking meshes together and all that stuff. The url where you can get the download and more info is at:
&lt;br&gt;&lt;br&gt;
&lt;a href="http://quamtar.googlepages.com/d3dcontrols-main"&gt;http://quamtar.googlepages.com/d3dcontrols-main&lt;/a&gt;
&lt;br&gt;
and
&lt;br&gt;
&lt;a href="http://www.ryanscook.com/D3DControl.html"&gt;http://www.ryanscook.com/D3DControl.html&lt;/a&gt;
&lt;br&gt;&lt;br&gt;
I am planning on putting up some info when I get the chance. But its hard to find time.

&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;iframe width=500 height=75 frameborder=0 src="http://ryanscook.com/AdPages/googlePackAd.html"&gt;&lt;/iframe&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-114393838525245851?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2006/04/d3dcontrol-update.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>3</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-112814424515402360</guid><pubDate>Sat, 01 Oct 2005 05:22:00 +0000</pubDate><atom:updated>2007-02-22T16:06:22.555-08:00</atom:updated><title>Managed DirectX - Direct3D Windows Control  written in C#</title><description>&lt;P&gt;I created a windows control to hopefully simplify adding Direct3D to .Net 
applications. This control has a lot of functionality, but it by no means has 
everything that I intended on putting in. It is my first real Managed DirectX 
project so be a little forgiving if you find something that is not done just 
right. &lt;br&gt;&lt;br&gt;The purpose of this 
control is to provide a Direct3D surface that can be added to any .Net windows 
form. It has a lot of features that can do most of the busy work for you. One 
thing to note is that this library is not intended for hard core games, but more 
for windowed applications. &lt;br&gt;&lt;br&gt;
This library has been sitting around for the last six months unfinished, but still in a good working state. I have been to busy
with other things to work on it, so I decided to put it up here in case some one could learn from it. I know I learned a lot making it.
&lt;br&gt;&lt;br&gt;
The library consists of a user control which handles the render loop, direct3d initialization on so on, as well as a bunch of mesh classes and a camera class.
I don't have a lot of time to go over how to use it but included in the download are four sample applications that use the control, so you
should be able to figure it out. 
&lt;br&gt;&lt;br&gt;
To use it all you have to do is add the control to your tool box. Add event handlers for the &lt;b&gt;OnSceneUpdateReady&lt;/b&gt;
and &lt;b&gt;OnRender&lt;/b&gt; events and then you are ready to go. By default a camera class will be created and set in the controls ActiveCamera property.
The default settings is to automatically add the transforms for the active camera before the OnRender event is fired, however this is configurable.
The OnSceneUpdateReady event is fired before teh OnRender and is intended for updating the scene and doing all of your program logic.
The OnRender event is fired between the BeginScene and Present methods and is intended for rendering the objects.
&lt;br&gt;&lt;br&gt;
The included mesh objects all implement the ID3DMesh interface and can be rendered using the Render() method. There is a RenderSettings property that you can use to sett some render settings such as wireframe, solid, autoset transform,
and so on. The ID3DMesh interface also has a parameter for rendering planar shadows as well as a bunch of other stuff.
&lt;br&gt;&lt;br&gt;
One of the best features of the control is that it enumerated all the supported hardware configurations on start up and stores all the combinations
in a DataTable, which can be used for setting the best device settings. In addition to this there is a &lt;b&gt;ShowDeviceSettingsForm()&lt;/b&gt;
method which will open a dialog that will allow the user to choose from the supported settings. It can be seen in the 
Mesh Viewer screen shot below. The Mesh Viewer is one of the test apps that is included in the download.
&lt;br&gt;&lt;br&gt;
Please send all feed back and code updates to &lt;b&gt;&lt;i&gt;rccode [at] gmail . com&lt;/i&gt;&lt;/b&gt;
&lt;br&gt;&lt;br&gt;
&lt;a href="http://ryanscook.com/D3DControls.zip"&gt;&lt;b&gt;Download Here&lt;/b&gt;&lt;/a&gt;  - &lt;i&gt;Updated 10/4/2005: This has been compiled using the October SDK, for other releases a recompile may be needed.&lt;/i&gt;&lt;/P&gt;

&lt;br&gt;
&lt;img src="http://ryanscook.com/MeshViewer.png"&gt;
&lt;br&gt;&lt;br&gt;
&lt;img src="http://ryanscook.com/LameGame.png"&gt;
&lt;br&gt;&lt;br&gt;
&lt;img src="http://ryanscook.com/Toolbox.png"&gt;
&lt;br&gt;&lt;br&gt;
&lt;img src="http://ryanscook.com/QuickTest.png"&gt;

&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;iframe width=500 height=75 frameborder=0 src="http://ryanscook.com/AdPages/googlePackAd.html"&gt;&lt;/iframe&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-112814424515402360?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/09/managed-directx-direct3d-windows.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>9</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-111864221291353261</guid><pubDate>Mon, 13 Jun 2005 05:51:00 +0000</pubDate><atom:updated>2007-02-22T15:57:18.891-08:00</atom:updated><title>SearchMySites.com</title><description>I have put up a simple (but hopefully useful) site. &lt;a href="http://www.SearchMySites.com"&gt;SearchMySites.com&lt;/a&gt; allows you to create multiple lists of urls, then you can choose one of the lists and perform a google search only within the sites in the list.&lt;br&gt;&lt;br&gt;
For example: if you create a News group and add cnn.com and msnbc.com to the group, you can then select the news group, enter your search terms and when you click search it will return results found in msnbc.com or cnn.com only.
&lt;br&gt;&lt;br&gt;
The site was just put up and has not had any real testing so feel free to send your feedback or bugs.
&lt;br&gt;&lt;br&gt;
&lt;iframe width=500 height=75 frameborder=0 src="http://ryanscook.com/AdPages/googlePackAd.html"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-111864221291353261?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/06/searchmysitescom.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-111724998497607636</guid><pubDate>Sat, 28 May 2005 03:12:00 +0000</pubDate><atom:updated>2007-02-22T16:08:18.472-08:00</atom:updated><title>.Net Remote Script Request</title><description>Have you ever wanted an easy way to call a server side method from javascript? If so this class may be just what you need.
&lt;br /&gt;&lt;br /&gt;

I have created a simple and easy to use method for accomplishing this task. All you have to do is have your webform inherit from the remote script page, make your call using a simple javascript object (will be included automatically), and when you execute the request in javascript the OnRemoteScriptRequest event will be raised in your server side code, you then process the request and write the result out on the response stream. The result will be returned by the javascripts execute method.

&lt;br /&gt;&lt;br /&gt;
This .Net class library uses a combination of C# code and javascript to accomplish the task in an easy to use manner. The call uses Microsoft.XMLHTTP, Msxml2.XMLHTTP or XMLHttpRequest objects (depending on the browser) to do the underlying call back to the server. Because of this it will work in all recent IE and Mozilla based (Firefox, Netscape, Mozilla, etc.) browsers.
&lt;br /&gt;&lt;br /&gt;

&lt;a href="http://ryanscook.com/RemoteScriptTest.aspx" target="_blank"&gt;Try It Here!&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;

&lt;b&gt;Here it is step by step&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Include a reference to RemoteScript.dll
&lt;/li&gt;
&lt;li&gt;Have your webform inherit from the remote script page:
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;public class&lt;/span&gt; WebForm1 : &lt;b&gt;RemoteScript.Pages.RemoteScriptPage&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Add the event handler in the InitializeComponent method
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;this&lt;/span&gt;.OnRemoteScriptRequest += &lt;span style="color:blue;"&gt;new&lt;/span&gt; RemoteScript.Pages.RemoteScriptEventHandler(RemoteScriptTest_OnRemoteScriptRequest);
&lt;/li&gt;
&lt;li&gt;
Add the event handler method
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;private void&lt;/span&gt; RemoteScriptTest_OnRemoteScriptRequest(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, ...
&lt;/li&gt;
&lt;li&gt;
 After you add your code to the event handler you will be able to call it from javascript using the RemoteScriptRequest javascript object, Example:&lt;br /&gt;&lt;br /&gt;

&amp;nbsp;&amp;nbsp;objRS = new RemoteScriptRequest();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;strReturnValue = objRS.Execute();
&lt;/li&gt;
&lt;/ol&gt;

&lt;br /&gt;&lt;br /&gt;
&lt;a href="http://ryanscook.com/RemoteScriptPage/RemoteScriptPage.zip" target="_blank"&gt;
Donload the source code and a sample webform here
&lt;/a&gt;&lt;br /&gt;&lt;br/&gt;&lt;b&gt;
You can view the documentation here: &lt;a href="http://ryanscook.com/RemoteScriptPage/Doc/html/index.html" target="_blank"&gt;html&lt;/a&gt; - &lt;a href="http://ryanscook.com/RemoteScriptPage/Doc/RemoteScriptPage.chm" target="_blank"&gt;chm&lt;/a&gt;
&lt;/b&gt;
&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;iframe width=500 height=75 frameborder=0 src="http://ryanscook.com/AdPages/googlePackAd.html"&gt;&lt;/iframe&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-111724998497607636?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/05/net-remote-script-request_27.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-111724992640911340</guid><pubDate>Fri, 27 May 2005 03:11:00 +0000</pubDate><atom:updated>2007-02-22T16:04:12.634-08:00</atom:updated><title>C# / .Net Gmail Tools</title><description>I have created a gmail class library that provides some tools for getting gmail atom feeds and for sending emails through gmail using the .Net framework. These tools are not very complicated, but they are simple to use and should save a user some time if they want to integrate an application with gmail.
&lt;br /&gt;&lt;br /&gt;

&lt;b&gt;GmailMessage&lt;/b&gt;&lt;br /&gt;Sending email using the System.Web.Mail namespace is very simple, but there is not a straight forward way of sending email using a secure connection or on different ports, which is required by gmail. Because of these drawbacks I created the GmailMessage object that inherits from the MailMessage object, all you have to do is set up the message object and call its send message.&lt;br /&gt;&lt;br /&gt;
I also added a couple of static methods that allow you to send a email through your gmail account in as little as one line of code. Below are some examples of it's usage.
&lt;br /&gt;
&lt;xmp style="font-size:9pt;"&gt;
   //Send a message with one line of code
   RC.Gmail.GmailMessage.SendFromGmail("username", "password", "toAddress@gmail.com",
 "subject", "message body");

   //Send a message with one line of code with a MailMessage object
   RC.Gmail.GmailMessage.SendMailMessageFromGmail("username", "password", mailMessageObject);

   //User the GmailMessage object to create and send your message
   RC.Gmail.GmailMessage gmailMsg = new RC.Gmail.GmailMessage("username", "password");

   gmailMsg.To = "RCcode@gmail.com";
   gmailMsg.From = "fromAddress@gmail.com";
   gmailMsg.Subject = "C# Test Message";
   gmailMsg.Body = "Test body";

   MailAttachment attachment = new MailAttachment(@"c:\testfile.txt");
   gmailMsg.Attachments.Add(attachment);
   
   gmailMsg.Send();
&lt;/xmp&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;

&lt;b&gt;GmailAtomFeed&lt;/b&gt;&lt;br /&gt;
The GmailAtomFeed class provides a simple object layer for programmatic access to gmails atom feed. In just a couple lines of code the feed will be retreived from gmail and parsed. After that the entries can be accessed through an object layer AtomFeedEntryCollection, plus access to the raw feed and the feeds XmlDocument is also available.
&lt;br /&gt;&lt;br /&gt;
Below are some examples of it's usage.
&lt;xmp style="font-size:9pt;"&gt;

   // Create the object and get the feed
   RC.Gmail.GmailAtomFeed gmailFeed = new RC.Gmail.GmailAtomFeed("username", "password");
   gmailFeed.GetFeed();

   // Access the feeds XmlDocument
   XmlDocument myXml = gmailFeed.FeedXml

   // Access the raw feed as a string
   string feedString = gmailFeed.RawFeed


   // Access the feed through the object 

   string feedTitle = gmailFeed.Title;
   string feedTagline = gmailFeed.Message;
   DateTime feedModified = gmailFeed.Modified;


   //Get the entries
   
   for(int i = 0; i &lt; gmailFeed.FeedEntries.Count; i++) 
   {
      entryAuthorName = gmailFeed.FeedEntries[i].FromName;
      entryAuthorEmail = gmailFeed.FeedEntries[i].FromEmail;
      entryTitle = gmailFeed.FeedEntries[i].Subject;
      entrySummary = gmailFeed.FeedEntries[i].Summary;
      entryIssuedDate = gmailFeed.FeedEntries[i].Received;
      entryId = gmailFeed.FeedEntries[i].Id;
   }

&lt;/xmp&gt;
&lt;br /&gt;
That's about it short and sweet, I hope this saves you time integrating with gmail from your applications.

&lt;br /&gt;&lt;br /&gt;&lt;b&gt;
Download the source code here: 
&lt;a href="http://ryanscook.com/DotNetGmailHelper/GmailHelper.zip" target="_blank"&gt;GmailHelper.zip&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;
You can view the documentation here:
&lt;a href="http://ryanscook.com/DotNetGmailHelper/Doc/html/index.html" target="_blank"&gt;html&lt;/a&gt; - &lt;a href="http://ryanscook.com/DotNetGmailHelper/Doc/GmailHelper.chm" target="_blank"&gt;chm&lt;/a&gt;
&lt;/b&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br&gt;&lt;br&gt;
&lt;iframe width=500 height=75 frameborder=0 src="http://ryanscook.com/AdPages/FirefoxAd.html"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-111724992640911340?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/05/c-net-gmail-tools_26.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>7</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-111724981898821380</guid><pubDate>Thu, 26 May 2005 03:10:00 +0000</pubDate><atom:updated>2007-02-22T15:59:18.467-08:00</atom:updated><title>Simple C# RSA Encryption Class</title><description>&lt;font style="color:0f0f0f;font-family:verdana;font-size:9pt;"&gt;
Well, you can figure this out yourself, use it if you like, tell me how much it sucks, what ever you want.
&lt;br /&gt;&lt;br /&gt;
What it does is takes data and encrypts it using DES encryption and then encrypts the DES Keys using RSA and stores everything in an XML string to be saved for later decryption. There are also classes to hold the encrypted data and to create and save the RSA keys. This seems to be a pretty good solution for encrypting data or files.
&lt;br /&gt;&lt;br /&gt;
I wrote this code and am now posting it because I did not find any simple snippets on the web for encrypting data in C#. Everything seemed too complicated or was not robust enough. I am sure that many people may have problems with this code or the lack of explaination in the code, but oh well... Its here for those who want to look it over. Remember, use at your own risk!
&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;Code:&lt;/b&gt;
&lt;br /&gt;
&lt;textarea cols=75 rows=13 wrap=off&gt;
using System;
using System.Xml;
using System.Security.Cryptography;
using System.Text;
using System.IO;

namespace SimpleEncryption 
{
   public class Crypto
   {
      private RSACryptoServiceProvider rsa;

      /// Loads the new object using an xml string that contains the key info
      public Crypto(string keyXml)
      {
         rsa = new RSACryptoServiceProvider();
         rsa.FromXmlString(keyXml);
      }

      /// Loads the new object using an xml string or file that contains the key info
      /// loadFromFile: true if keyXmlOrFilePath is a path to an xml file with the key info
      public Crypto(string keyXmlOrFilePath, bool loadFromFile) 
      {
         rsa = new RSACryptoServiceProvider(1024);

         if(loadFromFile) 
         {
            TextReader reader = File.OpenText(keyXmlOrFilePath);
            rsa.FromXmlString(reader.ReadToEnd());
            reader.Close();
         }
         else 
         {
            rsa.FromXmlString(keyXmlOrFilePath);
         }
      }


      /// Encrypts the data using DES with A new IV and Key, then encrypts
      /// the IV and Key with RSA encryption.
      public EncryptedDataInfo Encrypt(string data) 
      {
         string encIV;
         string encKey;
         string encData;

         ICryptoTransform encryptor;
         CryptoStream cStream;
         MemoryStream mStream = new MemoryStream();

         try 
         {
            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
            des.GenerateIV();
            des.GenerateKey();

            encIV = Convert.ToBase64String(rsa.Encrypt(des.IV, false));
            encKey = Convert.ToBase64String(rsa.Encrypt(des.Key, false));

            encryptor = des.CreateEncryptor(des.Key, des.IV);
            cStream = new CryptoStream(mStream, encryptor, CryptoStreamMode.Write);

            byte[] bytesIn = Encoding.ASCII.GetBytes(data);

            cStream.Write(bytesIn, 0, bytesIn.Length);
            cStream.FlushFinalBlock();
            cStream.Close();

            byte[] bytesOut = mStream.ToArray();
            mStream.Close();

            encData = Convert.ToBase64String(bytesOut);

            return new EncryptedDataInfo(encData, encIV, encKey);
         }
         catch(Exception ex) 
         {
            mStream.Close();
            throw ex;
         }
      }


      /// Decrypts data from a xml representation of an EncryptedDataInfo object
      public string Decrypt(string encryptedDataInfoXml) 
      {
         return Decrypt(new EncryptedDataInfo(encryptedDataInfoXml));
      }

      /// Decrypts data from an EncryptedDataInfo object
      public string Decrypt(EncryptedDataInfo encryptedDataInfo) 
      {
         return Decrypt(encryptedDataInfo.EncryptedData, encryptedDataInfo.EncryptedKey, encryptedDataInfo.EncryptedIV);
      }

      /// Decrypts the Key and IV using RSA and then decrypts the data using DES
      public string Decrypt(string encryptedData, string encryptedKey, string encryptedIV) 
      {
         string returnValue;

         byte[] iv = rsa.Decrypt(Convert.FromBase64String(encryptedIV), false);
         byte[] key = rsa.Decrypt(Convert.FromBase64String(encryptedKey), false);
         byte[] data = Convert.FromBase64String(encryptedData);

         MemoryStream mStream = new MemoryStream(data);

         DESCryptoServiceProvider des = new DESCryptoServiceProvider();
         ICryptoTransform decryptor = des.CreateDecryptor(key, iv);

         CryptoStream cStream = new CryptoStream(mStream, decryptor, CryptoStreamMode.Read);
         StreamReader reader = new StreamReader(cStream);

         returnValue = reader.ReadToEnd();

         reader.Close();
         mStream.Close();
         cStream.Close();

         return returnValue;
      } // Crypto


      /// Container for encrypted data
      public class EncryptedDataInfo
      {
         private string encData;
         private string encIV;
         private string encKey;

         public EncryptedDataInfo(string encryptedData, string encryptedIV, string encryptedKey) 
         {
            encData = encryptedData;
            encIV = encryptedIV;
            encKey = encryptedKey;
         }

         public EncryptedDataInfo(string encryptedDataInfoXml) 
         {
            XmlDocument xml = new XmlDocument();
            xml.LoadXml(encryptedDataInfoXml);

            encData = xml.SelectSingleNode(@"/EncryptedDataInfo/EncryptedData").InnerText;
            encIV = xml.SelectSingleNode(@"/EncryptedDataInfo/EncryptedIV").InnerText;
            encKey = xml.SelectSingleNode(@"/EncryptedDataInfo/EncryptedKey").InnerText;
         }

         public string ToXml() 
         {
            XmlDocument xml = new XmlDocument();
            XmlElement root = xml.CreateElement("EncryptedDataInfo");
            XmlElement data = xml.CreateElement("EncryptedData");
            XmlElement iv = xml.CreateElement("EncryptedIV");
            XmlElement key = xml.CreateElement("EncryptedKey");

            data.InnerText = encData;
            iv.InnerText = encIV;
            key.InnerText = encKey;

            root.AppendChild((XmlNode)data);
            root.AppendChild((XmlNode)iv);
            root.AppendChild((XmlNode)key);
            xml.AppendChild((XmlNode)root);

            return xml.OuterXml;
         }

         public override string ToString()
         {
            return ToXml();
         }

         public string EncryptedData { get { return encData; } }
         public string EncryptedIV { get { return encIV; } }
         public string EncryptedKey { get { return encKey; } }
      } //EncryptedDataInfo


      /// Used to create and save new keys
      public class RSAKeyCreator 
      {
         private string publicKeyXml;
         private string privateKeyXml;

         public RSAKeyCreator() 
         {
            RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(1024);
            publicKeyXml = rsa.ToXmlString(false);
            privateKeyXml = rsa.ToXmlString(true);
         }

         public RSAKeyCreator(int keySize) 
         {
            RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(keySize);
            publicKeyXml = rsa.ToXmlString(false);
            privateKeyXml = rsa.ToXmlString(true);
         }

         public void SavePublicKeyToFile(string filePath) 
         {
            TextWriter writer = File.CreateText(filePath);
            writer.Write(publicKeyXml);
            writer.Flush();
            writer.Close();
         }

         public void SavePrivateKeyToFile(string filePath) 
         {
            TextWriter writer = File.CreateText(filePath);
            writer.Write(privateKeyXml);
            writer.Flush();
            writer.Close();
         }

         public string PublicKeyXml { get { return publicKeyXml; } }
         public string PrivateKeyXml { get { return privateKeyXml; } }
      } // RSAKeyCreator
   } 
}
&lt;/textarea&gt;
&lt;/font&gt;

&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;iframe width=500 height=75 frameborder=0 src="http://ryanscook.com/AdPages/googlePackAd.html"&gt;&lt;/iframe&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-111724981898821380?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/05/simple-c-rsa-encryption-class.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>8</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-109570544294581241</guid><pubDate>Tue, 24 May 2005 18:35:00 +0000</pubDate><atom:updated>2005-05-27T20:36:35.736-07:00</atom:updated><title>C# LateBound COM</title><description>I made a very simple wrapper for calling com objects in c# and I thought you may find it useful. Currently there are only a couple methods, but they are the most useful items.

&lt;br&gt;&lt;br&gt;

&lt;font size=2&gt;
Sample usage:

&lt;br&gt;
//Create object
object myComObject = ComUtil.CreateObject("SomeObject.SomeClass");
&lt;br&gt;&lt;br&gt;


//Call Method&lt;br&gt;
object[] parameters = new Object[]{paramValue1, paramValue2, paramValue3, paramValue4};
&lt;br&gt;
ComUtil.CallMethod(myComObject, "MethodName", parameters);
&lt;br&gt;&lt;br&gt;


//Get a property&lt;br&gt;
Int16 returnValue = (Int16)ComUtil.GetProperty(myComObject, "PropertyName");
&lt;br&gt;&lt;br&gt;


//Set a property&lt;br&gt;
ComUtil.SetProperty(myComObject, "PropertyName", value);
&lt;br&gt;&lt;br&gt;


//Call a method with a ByRef parameter (recordset)&lt;br&gt;
ADODB.Recordset rs = null;&lt;br&gt;&lt;br&gt;

ParameterModifier byRefParamMod = new ParameterModifier(1);&lt;br&gt;
byRefParamMod[0] = true;&lt;br&gt;&lt;br&gt;

ParameterModifier[] pmArray = {new ParameterModifier(1), byRefParamMod, new ParameterModifier(1),new ParameterModifier(1)};
&lt;br&gt;&lt;br&gt;

object[] parameters = new Object[]{paramValue1, rs};&lt;br&gt;
ComUtil.CallMethod(myComObject, "MethodName", parameters, pmArray);&lt;br&gt;


&lt;br&gt;&lt;br&gt;&lt;br&gt;

//Call a method with a return value&lt;br&gt;
ADODB.Recordset rs = (ADODB.Recordset)ComUtil.CallMethod(myComObject, "MethodName", null);
&lt;br&gt;&lt;br&gt;
&lt;/font&gt;

&lt;b&gt;Here is the class:&lt;/b&gt;&lt;br&gt;
&lt;textarea cols="75" rows="13" wrap="off"&gt;

using System;
using System.Reflection;

public class ComUtil
{
 public const BindingFlags memberAccess = BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Static|BindingFlags.Instance|BindingFlags.IgnoreCase;  
  
 public static object CreateObject(string progID) 
 {
  return Activator.CreateInstance(Type.GetTypeFromProgID(progID));
 }

 public static object CallMethod(object instance, string methodName, object[] parameters)  
 {
  return instance.GetType().InvokeMember(methodName, memberAccess|BindingFlags.InvokeMethod, null, instance, parameters);
 }

 public static object CallMethod(object instance, string methodName, object[] parameters, ParameterModifier[] paramMod)  
 {
  return instance.GetType().InvokeMember(methodName, memberAccess|BindingFlags.InvokeMethod, null, instance, parameters, paramMod, null, null);
 }

 public static void SetProperty(object instance, string property, object newValue) 
 {
  instance.GetType().InvokeMember(property, memberAccess|BindingFlags.SetProperty, null, instance, new object[]{newValue});
 }

 public static object GetProperty(object instance, string property) 
 {
  return instance.GetType().InvokeMember(property, memberAccess|BindingFlags.GetProperty, null, instance, null);
 }
}


&lt;/textarea&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-109570544294581241?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/05/c-latebound-com.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-108871685945607949</guid><pubDate>Mon, 23 May 2005 21:17:00 +0000</pubDate><atom:updated>2005-05-27T20:37:14.923-07:00</atom:updated><title>QueryString Encryptor HTTPModule</title><description>&lt;span&gt;&lt;font face="Arial" size="2"&gt;&lt;span&gt;&lt;p&gt;I wrote an&amp;nbsp;HttpModule that Encrypts querystrings.&amp;nbsp; This module is seamless to the web developer. You can create html that looks like this: &lt;font color="#0000ff"&gt;myPage.aspx?id=1&amp;amp;customer=2&lt;/font&gt; and the source on the client will automatically be converted to this: &lt;font color="#0000ff"&gt;myPage.aspx?eqs=KS%2bthrckechBKT%2bZ8IB44Bz3qvW3853f&lt;/font&gt;.&amp;nbsp;Then to access the value in the code behind page you would use &lt;strong&gt;QueryString["id"]&lt;/strong&gt; or &lt;strong&gt;QueryString["customer"]&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;To install it add QSHttpModules.dll to your bin directory and then add the following to your web.config (any where in &amp;lt;system.web&amp;gt;):&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;httpModules&lt;/font&gt;&amp;gt;&lt;font color="#0000ff"&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp; &amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;add&lt;/font&gt;&lt;font color="#ff00ff"&gt; &lt;/font&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;font color="#0000ff"&gt;="QSHttpModules.QueryStringEncryptor, QSHttpModules"&lt;/font&gt;&lt;font color="#ff0000"&gt; &lt;/font&gt;&lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="QueryStringEncryptor"&lt;/font&gt;&lt;font color="#ff00ff"&gt; &lt;/font&gt;&lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;&lt;br /&gt; &lt;/p&gt; &lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;httpModules&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt; &lt;p&gt;&lt;br /&gt; The module does this by finding the links and replacing them with the encrypted version as the page is sent out to the client. Then on every request the module looks for an encrypted querystring, if found it decrypts it and rewrites the url.&lt;br /&gt; &lt;/p&gt; &lt;p&gt;The code is listed below, but you can also download it from my message board at: &lt;a href="http://csharpboard.com/ShowPost.aspx?PostID=44" target="_blank"&gt;http://csharpboard.com/ShowPost.aspx?PostID=44&lt;/a&gt;. This module of course takes some overhead to process and it is not recommended to be used as a full security feature. Rights checking should always be in place. But, if a little cpu time is worth hiding the contents of your querystring, this may be for you.&lt;br /&gt; &lt;/p&gt; &lt;p&gt;As always, use at your own risk.&lt;/p&gt;&lt;/span&gt;&lt;br /&gt; &lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;


&lt;textarea cols=75 rows=13 wrap=off&gt;
using System;
using System.Web;
using System.Text;
using System.Text.RegularExpressions;
using System.Security.Cryptography;
using System.IO;

namespace QSHttpModules
{
    // &lt;summary&gt;
    // HttpModule QueryStringEncryptor: Encrypts all querystrings for aspx pages
    // before the content is sent to the client. It also decrypts and rewrites the url
    // when the request is sent back so that querystring encryption is seamless to the
    // web developer.
    // &lt;/summary&gt;
    public class QueryStringEncryptor : System.Web.IHttpModule
    {
        public QueryStringEncryptor(){}
        public String ModuleName { get { return "QueryStringEncryptor"; } }
        public void Dispose() {}

        public void Init(HttpApplication application)
        {
            application.BeginRequest += new EventHandler(this.Application_BeginRequest);
        }

        private void Application_BeginRequest(object source, EventArgs e)
        {
            HttpApplication application = (HttpApplication)source;
            HttpContext context = application.Context;

            application.Response.Filter = new QueryStringResponseFilter(application.Response.Filter, application.Server);

            if(context.Request.QueryString["eqs"] != null &amp;&amp; context.Request.QueryString["eqs"] != string.Empty)
            {
                QueryStringCrypto qsc = new QueryStringCrypto();

                context.RewritePath(context.Request.FilePath,
                    context.Request.PathInfo,
                    qsc.Decrypt(context.Request.QueryString["eqs"]));
            }
        }
                        
    } //QueryStringEncryptor


    // &lt;summary&gt;
    // QueryStringResponseFilter rewrites the querystring with the encrypted version before
    // it is sent to the client.
    // &lt;/summary&gt;
    public class QueryStringResponseFilter : Stream
    {
        private Regex validUrlRegex;
        private Stream responseStream;
        private long position;
        private StringBuilder html = new StringBuilder();
        private QueryStringCrypto qsc;
        private HttpServerUtility serverUtil;

        public QueryStringResponseFilter(Stream inputStream, HttpServerUtility server)
        {
            responseStream = inputStream;
            serverUtil = server;
            qsc = new QueryStringCrypto();

            validUrlRegex = new Regex(
                "\\b(https?|ftp|file)://[-A-Z0-9+&amp;@#/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#/%=~_|]",
                RegexOptions.IgnoreCase);
        }
 
        public override bool CanRead {get { return true; }}
        public override bool CanSeek {get { return true; }}
        public override bool CanWrite {get { return true; }}
        public override void Close() {responseStream.Close();}
        public override void Flush() {responseStream.Flush();}
        public override long Length {get { return 0; }}

        public override long Position
        {
            get { return position; }
            set { position = value; }
        }

        public override long Seek(long offset, System.IO.SeekOrigin direction)
        {
            return responseStream.Seek(offset, direction);
        }

        public override void SetLength(long length)
        {
            responseStream.SetLength(length);
        }

        public override int Read(byte[] buffer, int offset, int count)
        {
            return responseStream.Read(buffer, offset, count);
        }
 
        public override void Write(byte[] buffer, int offset, int count)
        {
            string sBuffer = System.Text.UTF8Encoding.UTF8.GetString(buffer, offset, count);

            Regex endOfFile = new Regex("&lt;/html&gt;", RegexOptions.IgnoreCase);

            if (endOfFile.IsMatch(sBuffer))
            {
                html.Append(sBuffer);
                string tempResponse = html.ToString();

                MatchCollection aspxPageMatches = Regex.Matches(
                    html.ToString(),
                    "([-A-Z0-9+&amp;@#/%~_|!:,.;]*)?\\.aspx\\?([-A-Z0-9+&amp;@#/%=~_|!:,.;]*)?",
                    RegexOptions.IgnoreCase);

                for(int i = 0; i &lt; aspxPageMatches.Count; i++)
                    html.Replace(aspxPageMatches[i].Value, EncryptQueryString(aspxPageMatches[i].Value));

                byte[] data = System.Text.UTF8Encoding.UTF8.GetBytes(html.ToString());
                responseStream.Write(data, 0, data.Length);
            }
            else
            {
                html.Append(sBuffer);
            }
        }

        private string EncryptQueryString(string link)
        {
            bool isLocal = false;

            if(!validUrlRegex.IsMatch(link))
                isLocal = true;
            else
            {
                //Check host
                //Will add in later
            }
            
            if(isLocal)
            {
                string[] linkArray = link.Split(Convert.ToChar("?"));
                return linkArray[0] + "?eqs=" + serverUtil.UrlEncode(qsc.Encrypt(linkArray[1]));
            }
            else
            {
                return link;
            }
        }
    } //QueryStringResponseFilter


    // &lt;summary&gt;
    // QueryStringCrypto provides simple DES encruption for the querystring
    // &lt;/summary&gt;
    public class QueryStringCrypto
    {
        private string key = "tb~5m_|-";
        private string iv = "'$4&gt;i4fJ";
        private DESCryptoServiceProvider cryptoService;
        private ICryptoTransform encryptor;
        private ICryptoTransform decryptor;

        public QueryStringCrypto()
        {
            cryptoService = new DESCryptoServiceProvider();
            cryptoService.Key = ASCIIEncoding.ASCII.GetBytes(key);
            cryptoService.IV = ASCIIEncoding.ASCII.GetBytes(iv);
            encryptor = cryptoService.CreateEncryptor();
            decryptor = cryptoService.CreateDecryptor();
        }

        public string Encrypt(string data)
        {
            byte[] bytesIn = ASCIIEncoding.ASCII.GetBytes(data);
            MemoryStream ms = new MemoryStream();
            CryptoStream cs = new CryptoStream(ms, encryptor, CryptoStreamMode.Write);
            cs.Write(bytesIn, 0, bytesIn.Length);
            cs.FlushFinalBlock();
            cs.Close();
            byte[] bytesOut = ms.ToArray();
            ms.Close();

            return Convert.ToBase64String(bytesOut);
        }

        public string Decrypt(string encryptedData)
        {
            string returnValue = string.Empty;
            byte[] bytesIn = Convert.FromBase64String(encryptedData);
            MemoryStream ms = new MemoryStream(bytesIn);
            CryptoStream cs = new CryptoStream(ms, decryptor, CryptoStreamMode.Read);
            StreamReader sr = new StreamReader(cs);
            returnValue = sr.ReadToEnd();
            sr.Close();
            ms.Close();
            cs.Close();

            return returnValue;
        }
    } //QueryStringCrypto

} //CoopHttpModules
&lt;/textArea&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-108871685945607949?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/05/querystring-encryptor-httpmodule.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>10</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-108691478132601890</guid><pubDate>Mon, 23 May 2005 00:35:00 +0000</pubDate><atom:updated>2007-07-15T13:37:21.265-07:00</atom:updated><title>Javascript Color Picker</title><description>I wrote a javascript color picker. I know that there are plenty out there, but I just did not like the way they looked or worked very much. So, I decided to add one more color picker to the world. The down side to this color picker is that it uses external files, but to me it is worth it. It has a photoshop feel that I like.
&lt;br /&gt;&lt;br /&gt;
You will find a working sample below and you can download the code and a test page &lt;a href="http://ryanscook.com/Files/colorpicker/AdvancedColorPicker.zip" target="_blank"&gt;here&lt;/a&gt;. As always you will have to figure the code out yourself and you must use at your own risk.
&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;Sample:&lt;/b&gt;&lt;br /&gt;
&lt;iframe border=1 width=500 height=220 src="http://Ryanscook.com/Files/colorpicker/ColorPicker_Test.html"&gt;&lt;/iframe&gt;

&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;iframe width=500 height=75 frameborder=0 src="http://ryanscook.com/AdPages/googlePackAd.html"&gt;&lt;/iframe&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-108691478132601890?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/05/javascript-color-picker.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-108671207777734691</guid><pubDate>Sat, 21 May 2005 16:11:00 +0000</pubDate><atom:updated>2005-05-27T20:39:35.533-07:00</atom:updated><title>C# - Loading and creating an object instance from a file</title><description>&lt;font style="color:0f0f0f;font-family:verdana;font-size:9pt;"&gt;
This sample is pretty simple. It is basically loading a latebound object. I am not sure how often most people will have to do this, but I did so I will share it.
&lt;br /&gt;&lt;br /&gt;
This method does not do that much. It will load an assembly from the provided file path and then attempt to create an instance of the type specified. If an empty string is provided for the type, it will create an instance of the first type in the assembly. If there is an error then null is returned. 
&lt;br /&gt;&lt;br /&gt;
Use: &lt;code&gt;myType myObj = (myType)CreateLateBoundObjectFromFile(@"c:\myFilePath.dll", "myType");&lt;/code&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;Code:&lt;/b&gt;
&lt;br /&gt;
&lt;textarea cols=75 rows=13 wrap=off&gt;
using System.Reflection;

/// &lt;summary&gt;
/// Loads/Creates an object instance
/// &lt;/summary&gt;
/// &lt;param name="filePath"&gt;The path to the assembly to load&lt;/param&gt;
/// &lt;param name="type"&gt;Type to be created&lt;/param&gt;
/// &lt;returns&gt;The newly created object, or null if an error occurres&lt;/returns&gt;
public object CreateLateBoundObjectFromFile(string filePath, string type) 
{
   object returnObject;

   try 
   {
      Assembly asm = Assembly.LoadFrom(filePath);
      returnObject = asm.CreateInstance((type==string.Empty)?asm.GetTypes()[0].ToString():type);
   }
   catch 
   {
      returnObject = null;
   }

   return returnObject;
}
&lt;/textarea&gt;
&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-108671207777734691?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/05/c-loading-and-creating-object-instance.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-7235284.post-108688907853114197</guid><pubDate>Fri, 20 May 2005 17:37:00 +0000</pubDate><atom:updated>2007-02-22T16:12:36.614-08:00</atom:updated><title>.NET Zip Library #ziplib (SharpZipLib)</title><description>&lt;a href="http://icsharpcode.net/OpenSource/SharpZipLib/Default.aspx"&gt;.NET Zip Library #ziplib (SharpZipLib)&lt;/a&gt;&lt;br&gt;&lt;br&gt;
I have used the SharpZipLib for some time now and  it is great. It's easy to use and does everything that you may need; Zip, GZip, Tar, etc.
&lt;br&gt;&lt;br&gt;
Lately, I have seen quite a few third party .Net zip components for sale and its hard for me to believe that someone would buy a component when such a good one exists for free. It must be that not enough people know about this free library. Well, here it is: &lt;nobr&gt;&lt;a href="http://icsharpcode.net/OpenSource/SharpZipLib/Default.aspx" target="_blank"&gt;http://icsharpcode.net/OpenSource/SharpZipLib/Default.aspx&lt;/a&gt;&lt;/nobr&gt;

&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;iframe width=500 height=75 frameborder=0 src="http://ryanscook.com/AdPages/googlePackAd.html"&gt;&lt;/iframe&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235284-108688907853114197?l=ryanscook.com%2FadminsBlog' alt='' /&gt;&lt;/div&gt;</description><link>http://ryanscook.com/adminsBlog/2005/05/net-zip-library-ziplib-sharpziplib.html</link><author>noreply@blogger.com (quamtar)</author><thr:total>4</thr:total></item></channel></rss>
