<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Curious &#60;HEAD/&#62;</title>
	<atom:link href="http://2leggedspider.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://2leggedspider.wordpress.com</link>
	<description>Thoughts on Web development and more...</description>
	<lastBuildDate>Thu, 11 Jun 2009 07:12:58 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/4985f362802b5bd4ea2ec4dd4f575853?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>The Curious &#60;HEAD/&#62;</title>
		<link>http://2leggedspider.wordpress.com</link>
	</image>
			<item>
		<title>I search for it and &#8216;Bing&#8217; there it is&#8230;almost</title>
		<link>http://2leggedspider.wordpress.com/2009/06/11/i-search-for-it-and-bing-there-it-is-almost/</link>
		<comments>http://2leggedspider.wordpress.com/2009/06/11/i-search-for-it-and-bing-there-it-is-almost/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 06:41:51 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[decision engine]]></category>
		<category><![CDATA[search engine]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/?p=103</guid>
		<description><![CDATA[I&#8217;ve been using Bing, the worlds first decision engine for the past one week. I&#8217;ve set it up as my default search engine in Chrome(and its not complaining  ). I like the images and videos section for the way it displays the search results and the ability to view or play videos inside the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=103&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been using Bing, the worlds first decision engine for the past one week. I&#8217;ve set it up as my default search engine in Chrome(and its not complaining <img src='http://s.wordpress.com/wp-includes/images/smilies/face-smile.png' alt=':)' class='wp-smiley' /> ). I like the images and videos section for the way it displays the search results and the ability to view or play videos inside the interface. I wouldn&#8217;t say the search results are better or even close to Google but to be fair we need to wait and see as it is still rolling out worldwide. </p>
<p>I guess you would have tried <a href="http://www.bing.com">Bing</a> already, if not give it a go. Here is an article on how you can set up Bing as the default search engine in various browsers <a href="http://tinyurl.com/ldjntp">http://tinyurl.com/ldjntp</a></p>
<p>Happy Binging <img src='http://s.wordpress.com/wp-includes/images/smilies/face-smile.png' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=103&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2009/06/11/i-search-for-it-and-bing-there-it-is-almost/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing the default View Location in ASP.NET MVC</title>
		<link>http://2leggedspider.wordpress.com/2009/06/10/changing-the-default-view-location-in-asp-net-mvc/</link>
		<comments>http://2leggedspider.wordpress.com/2009/06/10/changing-the-default-view-location-in-asp-net-mvc/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 12:50:12 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/?p=97</guid>
		<description><![CDATA[After 8 hours of training in ASP.NET MVC by a guy from Microsoft I starting revisiting  the ways in which I&#8217;ve implemented some of the functionality in my existing project done using MVC. The training was just a walkthrough of what I already know about ASP.NET MVC from the internet. One of the questions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=97&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After 8 hours of training in ASP.NET MVC by a guy from Microsoft I starting revisiting  the ways in which I&#8217;ve implemented some of the functionality in my existing project done using MVC. The training was just a walkthrough of what I already know about ASP.NET MVC from the internet. One of the questions I put forth to the trainer, which he termed as interesting was, how to change the default view location in MVC. Apart from his <em>I&#8217;ll get back to you on this</em> answer, one of my colleagues in the room was vociferous in declaring that it is not possible at all as none of the MVC tutorials talk about it <img src='http://s.wordpress.com/wp-includes/images/smilies/face-plain.png' alt=':-|' class='wp-smiley' /> </p>
<p>I googled and binged for answers and found few&#8230;</p>
<p>I found this post <a href="http://tinyurl.com/nhh5x4">Organize your views in ASP.Net MVC</a> very useful in scenarios where I have more than one Controller which needs to share the same View location.</p>
<p>I wanted to check if there are any other ways of doing the same and so I twittered Scott Hanselman, the guy himself to find if he can give me any pointers and he replied&#8230;</p>
<blockquote><p>shanselmanR @2leggedspider Derive from WebFormsViewEngine, override just FindView(). Look at the NerdDinner code on Codeplex at the MobileViewEngine.</p></blockquote>
<p>He was talking about this piece of code in NerdDinner. </p>
<pre name="code" class="csharp">

public class MobileCapableWebFormViewEngine : WebFormViewEngine
	{
		public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
		{
			ViewEngineResult result = null;
			var request = controllerContext.HttpContext.Request;

			//This could be replaced with a switch statement as other advanced / device specific views are created
			if (UserAgentIs(controllerContext, &quot;iPhone&quot;))	{
				result = base.FindView(controllerContext, &quot;Mobile/iPhone/&quot; + viewName, masterName, useCache);
			}

			// Avoid unnecessary checks if this device isn&#039;t suspected to be a mobile device
			if (request.Browser.IsMobileDevice)
			{
				//TODO: We are not doing any thing WinMobile SPECIAL yet!

				//if (UserAgentIs(controllerContext, &quot;MSIEMobile 6&quot;))	{
				//  result = base.FindView(controllerContext, &quot;Mobile/MobileIE6/&quot; + viewName, masterName, useCache);
				//}
				//else if (UserAgentIs(controllerContext, &quot;PocketIE&quot;) &amp;&amp; request.Browser.MajorVersion &gt;= 4)
				//{
				//  result = base.FindView(controllerContext, &quot;Mobile/PocketIE/&quot; + viewName, masterName, useCache);
				//}

				//Fall back to default mobile view if no other mobile view has already been set
				if ((result == null || result.View == null) &amp;&amp;
								request.Browser.IsMobileDevice)
				{
					result = base.FindView(controllerContext, &quot;Mobile/&quot; + viewName, masterName, useCache);
				}
			}

			//Fall back to desktop view if no other view has been selected
			if (result == null || result.View == null)
			{
				result = base.FindView(controllerContext, viewName, masterName, useCache);
			}

			return result;
		}

		public bool UserAgentIs(ControllerContext controllerContext, string userAgentToTest)
		{
			return (controllerContext.HttpContext.Request.UserAgent.IndexOf(userAgentToTest,
							StringComparison.OrdinalIgnoreCase) &gt; 0);
		}
	}
</pre>
<p>Though the above code helps in detecting if the user is accessing the site from a mobile device and redirect the request to a particular view location, you can customize it for your needs.</p>
<p>Btw, if you have not checked <a href="http://nerddinner.codeplex.com/">NerdDinner</a> yet, I suggest you should. It is one of the best ways to learn MVC.</p>
<p>Another approach I found useful is from Phil Haack <a href="http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx">Grouping Controllers with ASP.NET MVC</a>.</p>
<p>Let me know if you came across any other approach or best practice relevant to this.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=97&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2009/06/10/changing-the-default-view-location-in-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
		<item>
		<title>Tagging and Folksonomy database schema</title>
		<link>http://2leggedspider.wordpress.com/2007/07/05/tagging-and-folksonomy-database-schema/</link>
		<comments>http://2leggedspider.wordpress.com/2007/07/05/tagging-and-folksonomy-database-schema/#comments</comments>
		<pubDate>Thu, 05 Jul 2007 05:04:26 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[folksonomy]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/2007/07/05/tagging-and-folksonomy-database-schema/</guid>
		<description><![CDATA[Here is a nice presentation on designing a database schema for tagging. 
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=49&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.slideshare.net/edbond/tagging-and-folksonomy-schema-design-for-scalability-and-performance/">Here is a nice presentation</a> on designing a database schema for tagging. </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/2leggedspider.wordpress.com/49/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/2leggedspider.wordpress.com/49/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=49&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2007/07/05/tagging-and-folksonomy-database-schema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
		<item>
		<title>An excellent resource for different CSS techniques</title>
		<link>http://2leggedspider.wordpress.com/2007/06/29/an-excellent-resource-for-different-css-techniques/</link>
		<comments>http://2leggedspider.wordpress.com/2007/06/29/an-excellent-resource-for-different-css-techniques/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 14:43:41 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/2007/06/29/an-excellent-resource-for-different-css-techniques/</guid>
		<description><![CDATA[http://www.dassnagar.com/blogge/2007/06/15/53_css-based_techniques/
The resources in the above link are very useful. I particularly like the Nifty corners technique to generate rounded boxes without images.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=48&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.dassnagar.com/blogge/2007/06/15/53_css-based_techniques/">http://www.dassnagar.com/blogge/2007/06/15/53_css-based_techniques/</a></p>
<p>The resources in the above link are very useful. I particularly like the <a href="http://www.html.it/articoli/niftycube/index.html">Nifty corners</a> technique to generate rounded boxes without images.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/2leggedspider.wordpress.com/48/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/2leggedspider.wordpress.com/48/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=48&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2007/06/29/an-excellent-resource-for-different-css-techniques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
		<item>
		<title>Deleting duplicate records/rows in SQL Server</title>
		<link>http://2leggedspider.wordpress.com/2007/06/28/deleting-duplicate-recordsrows-in-sql-server/</link>
		<comments>http://2leggedspider.wordpress.com/2007/06/28/deleting-duplicate-recordsrows-in-sql-server/#comments</comments>
		<pubDate>Thu, 28 Jun 2007 15:48:40 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/2007/06/28/deleting-duplicate-recordsrows-in-sql-server/</guid>
		<description><![CDATA[A duplicate record in a table is redundant data and is a violation of table integrity. Utmost care should be taken to avoid such situations. But, there might be situations where there is a loosely designed table which holds duplicate records. Removing duplicate records is of high priority in such situations.
Consider the following table design&#8230;

CREATE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=45&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A duplicate record in a table is redundant data and is a violation of table integrity. Utmost care should be taken to avoid such situations. But, there might be situations where there is a loosely designed table which holds duplicate records. Removing duplicate records is of high priority in such situations.</p>
<p>Consider the following table design&#8230;</p>
<pre name="code" class="sql">
CREATE TABLE [dbo].[Categories](
	[CategoryId] [int] IDENTITY(1,1) NOT NULL,
	[Category] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
 CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED
(
	[CategoryId] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
</pre>
<p>Lets insert some records in this table</p>
<pre name="code" class="sql">
INSERT INTO Categories VALUES(&#039;Books&#039;)
INSERT INTO Categories VALUES(&#039;Books&#039;)
INSERT INTO Categories VALUES(&#039;Books&#039;)
INSERT INTO Categories VALUES(&#039;Toys&#039;)
INSERT INTO Categories VALUES(&#039;Automobiles&#039;)
INSERT INTO Categories VALUES(&#039;Gadgets&#039;)
INSERT INTO Categories VALUES(&#039;Toys&#039;)
INSERT INTO Categories VALUES(&#039;Toys&#039;)
</pre>
<p>As you can see we have inserted some duplicate data in this table. Imagine if we had thousands of records in the Categories table with lots of duplicate records. Fixing the table would be a pain. To solve this problem we need to first identify the duplicate records. The following query will help us do that.</p>
<pre name="code" class="sql">

SELECT Category, Count(Category) AS Occurence FROM Categories
GROUP BY Category
HAVING COUNT(Category) &amp;gt; 1
</pre>
<p>We get the following result&#8230;</p>
<pre name="code" class="sql">

Category            Occurence
----------------  -----------
Books                 4
Toys                  3
</pre>
<p>As you can see it displays the duplicate records and the number of times it occurs in the table. Now how do we delete the duplicates?</p>
<p>Lets try another query on the table.</p>
<pre name="code" class="sql">

SELECT 	MAX(CategoryID), Category
FROM Categories
GROUP BY Category
</pre>
<p>The result is&#8230;</p>
<pre name="code" class="sql">

            Category
-------- --------------------------------------------------
6           Automobiles
4           Books
7           Gadgets
9           Toys
</pre>
<p>This is how our table should look like, no duplicates! The SQL query to delete the duplicate records is now simple&#8230;</p>
<pre name="code" class="sql">
DELETE FROM Categories
WHERE 	CategoryID NOT IN
	(SELECT MAX(CategoryID)
        FROM Categories
        GROUP BY Category)
</pre>
<p>and finally when we fetch all records from the Categories table, it gives us the desired result&#8230;</p>
<pre name="code" class="sql">

CategoryId  Category
----------- --------------------------------------------------
4           Books
6           Automobiles
7           Gadgets
9           Toys
</pre>
<p>This is a simple method to remove duplicates from a table. Please note that the table should have an Identity column for this method to work. There are several methods available to remove duplicate records from a table. If you have come across a better alternative please share it.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/2leggedspider.wordpress.com/45/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/2leggedspider.wordpress.com/45/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=45&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2007/06/28/deleting-duplicate-recordsrows-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
		<item>
		<title>Sitemap for Search Engines</title>
		<link>http://2leggedspider.wordpress.com/2007/06/18/sitemap-for-search-engines/</link>
		<comments>http://2leggedspider.wordpress.com/2007/06/18/sitemap-for-search-engines/#comments</comments>
		<pubDate>Mon, 18 Jun 2007 08:10:12 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[Web Tech]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/2007/06/18/sitemap-for-search-engines/</guid>
		<description><![CDATA[Sitemap is a simple XML file that you can put in the root of your website to help search engines crawl your site better. It helps the search engines know which pages in your site to index and the frequency of updates in those pages. A simple sitemap.xml file looks like this&#8230;


&#60; ?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;
&#60;urlset [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=44&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sitemap is a simple XML file that you can put in the root of your website to help search engines crawl your site better. It helps the search engines know which pages in your site to index and the frequency of updates in those pages. A simple sitemap.xml file looks like this&#8230;</p>
<pre name="code" class="xml">

&lt; ?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;urlset xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt;
   &lt;url&gt;
      &lt;loc&gt;http://www.yourwebsite.com/&lt;/loc&gt;
      &lt;lastmod&gt;2007-06-01&lt;/lastmod&gt;
      &lt;changefreq&gt;monthly&lt;/changefreq&gt;
      &lt;priority&gt;1.0&lt;/priority&gt;
   &lt;/url&gt;
&lt;/urlset&gt; 
</pre>
<p>Check <a href="http://www.sitemaps.org/">sitemaps.org</a> for more information.</p>
<p>Google and Yahoo have good Webmaster tools that allow you to submit the path of your sitemap.xml file for crawling. Make sure you validate you sitemap file before submitting it to the search engine. <a href="http://www.xml-sitemaps.com/validate-xml-sitemap.html">Sitemap validator</a> is an excellent tool to check your sitemap file.</p>
<p>Google&#8217;s <a href="http://www.google.com/webmasters/">Webmaster Central</a> is a great resouce for information on Sitemap. You can submit your sitemap at <a href="http://www.google.com/webmasters/sitemaps/">Google Sitemaps</a>. </p>
<p>Yahoo has a similar service called <a href="https://siteexplorer.search.yahoo.com/mysites">Yahoo! Site Explorer</a></p>
<p>For Ask.com just ping to their server with the following URL <em>http://submissions.ask.com/ping?sitemap=http%3A//www.yourwebsite.com/sitemap.xml </em></p>
<p>MSN doesn&#8217;t have a sitemap submission tool(I couldn&#8217;t find one). Placing the URL of your sitemap in robots.txt would do I guess.</p>
<p>Sitemap is not a replacement to the crawling methods adopted by search engines to index your website, it just helps the search engine to crawl your site better. </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/2leggedspider.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/2leggedspider.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=44&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2007/06/18/sitemap-for-search-engines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
		<item>
		<title>Safari on Windows</title>
		<link>http://2leggedspider.wordpress.com/2007/06/14/safari-on-windows/</link>
		<comments>http://2leggedspider.wordpress.com/2007/06/14/safari-on-windows/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 09:10:06 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/2007/06/14/safari-on-windows/</guid>
		<description><![CDATA[Its Troy all over again. It started with iTunes and now there is a new horse on the block claiming to faster and better than its bigger rivals. Safari, the new Trojan horse is available for Windows. The popularity of iPod grew several folds when Apple released iTunes for PC. It raised Apple&#8217;s awareness in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=43&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Its Troy all over again. It started with iTunes and now there is a new horse on the block claiming to faster and better than its bigger rivals. <a href="http://www.apple.com/safari/">Safari</a>, the new Trojan horse is available for Windows. The popularity of iPod grew several folds when Apple released iTunes for PC. It raised Apple&#8217;s awareness in PC users. Steve Jobs at the recent WWDC claimed that Safari is twice as fast as IE 7 and 42% faster than Firefox 2.0. Also, he announced that 3rd party developers will be able to develop apps for iPhone via Web apps. Its looks like a move to open up the iPhone development environment to a much wider audience. Probably we might see some tools for Windows to develop iPhone apps.</p>
<p>This is my first experience with Safari. The download and installation is easy. The installation comes bundled with three separate Apple products: Quicktime, <a href="http://www.apple.com/macosx/features/bonjour/">Bonjour</a> and Apple update. The startup page took almost 10 seconds to load. Contrary to the claim, it doesn&#8217;t seem to any faster than Firefox or IE 7. <a href="http://elliottback.com/wp/archives/2007/06/11/safari-3-windows-review-benchmark/">Here</a> is an interesting benchmark test for Safari. Its beta 3 and obviously there will be some improvements in the final release. </p>
<p>Apart from some of the common features like tabbed browsing and pop-up blockers found in the advanced browsers, Safari has few cool features that are noteworthy. You can drag a tab out of the main window turning it in to new browser window. The inbuilt RSS reader is neat. If you click &#8220;Installed Plug-ins&#8221; under Windows menu, it shows a comprehensive list of plug-ins, some you never though you had. Private browsing is another cool feature that comes with Safari.</p>
<p>On the downside, the home button is not available on the toolbar by default, but you can drag and drop the toolbuttons you want from the &#8220;Customise Toolbar&#8221; dialog box on to the toolbar. The OK-Cancel buttons are reversed in dialog box, which was bit annoying. Search box support only Google and Yahoo. Another feature that you would see is that when you try to key in a URL in the address bar, Safari suggests few sites in a drop-down list, probably sponsors. I am not sure how many users will like this form of advertising built-in to their browser. </p>
<p>Safari&#8217;s beta 3 for Windows looks promising on the whole. I am interested to hear what Microsoft has to say about it. Personally I feel Firefox is the real deal.</p>
<div>Technorati: <a href="http://technorati.com/tag/apple" rel="tag" target="_blank">Apple</a>, <a href="http://technorati.com/tag/safari" rel="tag" target="_blank">Safari</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/2leggedspider.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/2leggedspider.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=43&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2007/06/14/safari-on-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
		<item>
		<title>Folksonomy: Unordered categorization</title>
		<link>http://2leggedspider.wordpress.com/2007/06/13/folksonomy-unordered-categorization/</link>
		<comments>http://2leggedspider.wordpress.com/2007/06/13/folksonomy-unordered-categorization/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 07:57:39 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Tech]]></category>
		<category><![CDATA[folksonomy]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/2007/06/13/folksonomy-unordered-categorization/</guid>
		<description><![CDATA[Recently I&#8217;ve been reading few articles on Folksonomy. It is interesting to note that user generated classification is as much effective as the traditional structured classification found in many websites. Infact it works much better and creates a social environment which can expand in dimension and depth. Tagging is a term usually associated with folksonomy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=40&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently I&#8217;ve been reading few articles on <a href="http://en.wikipedia.org/wiki/Folksonomy">Folksonomy</a>. It is interesting to note that user generated classification is as much effective as the traditional structured classification found in many websites. Infact it works much better and creates a social environment which can expand in dimension and depth. <a href="http://en.wikipedia.org/wiki/Tags">Tagging</a> is a term usually associated with folksonomy based websites. Some popular sites which allow users to tag their content are <a href="http://en.wikipedia.org/wiki/Flickr">Flickr</a>, <a href="http://en.wikipedia.org/wiki/Del.icio.us">del.icio.us</a>, <a href="http://en.wikipedia.org/wiki/Technorati">Technorati</a> and <a href="http://www.43things.com">43things.com</a>. There are many more websites which fall under the Web 2.0 classification sprouting up with this concept.</p>
<p>I would be interested to know about your experience in developing Folksonomy based websites, the underlying database schema used etc. Share your thoughts.</p>
<div>Technorati: <a href="http://technorati.com/tag/folksonomy" rel="tag" target="_blank">Folksonomy</a>, <a href="http://technorati.com/tag/tagging" rel="tag" target="_blank">Tagging</a>, <a href="http://technorati.com/tag/folksonomy-tagging" rel="tag" target="_blank">folksonomy-tagging</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/2leggedspider.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/2leggedspider.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=40&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2007/06/13/folksonomy-unordered-categorization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Surface</title>
		<link>http://2leggedspider.wordpress.com/2007/06/05/microsoft-surface/</link>
		<comments>http://2leggedspider.wordpress.com/2007/06/05/microsoft-surface/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 10:21:19 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/2007/06/13/microsoft-surface/</guid>
		<description><![CDATA[Microsoft&#8217;s experiments with portable devices has been as successful as India in the recent World cup cricket. Take for instance Zune, the iPod killer. I think by claiming it as an iPod killer they are indirectly giving a free advertisement for iPod and growing list of Apple products. I sometimes feel that Microsoft should stick [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=42&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Microsoft&#8217;s experiments with portable devices has been as successful as India in the recent World cup cricket. Take for instance <a href="http://www.zune.net">Zune</a>, the iPod killer. I think by claiming it as an iPod killer they are indirectly giving a free advertisement for iPod and growing list of Apple products. I sometimes feel that Microsoft should stick to software and try focusing on making bug free products. The fact that Vista holds some features that were available in OS X is kind of becoming an embarrasment for many Microsoft product users, like me. I don&#8217;t even want to talk about it.</p>
<p>With <a href="http://www.microsoft.com/surface/">Surface</a>, I think Microsoft has got its head right as to how future computing should look like. Its definetely mind-blowing and very exciting. I am not sure if I will be able to get my hands on this baby but I am excited with the way technology is progressing in terms of user iteraction and experience with computers. Surface will definetely be a killer app for sure. </p>
<p>Having said that, I remember seeing a <a href="http://www.youtube.com/watch?v=zwGAKUForhM">Video</a> on Jeff Han&#8217;s Multi-touch sensing, which works on a similar concept. It&#8217;s good to see Microsoft embrassing this technology. Surface looks more refined and the number of <a href="http://www.youtube.com/watch?v=6VfpVYYQzHs">possibilities</a> seems endless. Its good to see that one day we will move away from Click Start -&gt; All Programs computing <img src='http://s.wordpress.com/wp-includes/images/smilies/face-wink.png' alt=';)' class='wp-smiley' /> </p>
<div>Technorati: <a href="http://technorati.com/tag/microsoft" rel="tag" target="_blank">Microsoft</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/2leggedspider.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/2leggedspider.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=42&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2007/06/05/microsoft-surface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
		<item>
		<title>Upload files to UNC share using ASP.NET</title>
		<link>http://2leggedspider.wordpress.com/2007/05/28/upload-files-to-unc-share-using-asp-net/</link>
		<comments>http://2leggedspider.wordpress.com/2007/05/28/upload-files-to-unc-share-using-asp-net/#comments</comments>
		<pubDate>Mon, 28 May 2007 10:58:18 +0000</pubDate>
		<dc:creator>2leggedspider</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[UNC]]></category>
		<category><![CDATA[Upload]]></category>

		<guid isPermaLink="false">http://2leggedspider.wordpress.com/?p=64</guid>
		<description><![CDATA[SCENARIO 1: Your ASP.NET website should upload files to a File Server accessible via an UNC share
SOLUTION

Create a Local User Account in the Web server with Username say &#8220;TestUser&#8221;  and Password say &#8220;Secret&#8221; of your choice
Create a Local User Account in File server with the same Username &#8220;TestUser&#8221;  and Password &#8220;Secret&#8221; as the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=64&subd=2leggedspider&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>SCENARIO 1: </strong>Your ASP.NET website should upload files to a File Server accessible via an UNC share</p>
<p><strong>SOLUTION</strong></p>
<ol>
<li>Create a Local User Account in the Web server with Username say <em>&#8220;TestUser&#8221; </em> and Password say <em>&#8220;Secret&#8221;</em> of your choice</li>
<li>Create a Local User Account in File server with the same Username <em>&#8220;TestUser&#8221; </em> and Password <em>&#8220;Secret&#8221;</em> as the one created in the Web server.</li>
<li>
<p>In Web.config set the impersonation to true for the above Local User Account as follows&#8230;</p>
<pre name="code" class="xml">

&lt;identity impersonate=&quot;true&quot; userName=&quot;TestUser&quot; password=&quot;Secret&quot;/&gt;
</pre>
<p>And your upload script will be something like this&#8230;</p>
<pre name="code" class="csharp">

                if ((FileUpload1.PostedFile != null) &amp;amp;&amp;amp; (FileUpload1.PostedFile.ContentLength &amp;gt; 0))
                {
                    string fileName = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
                    string folderPath = @&quot;\\MyUNCShare\MyFolder\&quot;;

                    string locationToSave = folderPath + &quot;\\&quot; + fileName ;
                    try
                    {
                        FileUpload1.PostedFile.SaveAs(locationToSave );
                        Response.Write(&quot;The file has been uploaded.&quot;);
                    }
                    catch (Exception ex)
                    {
                        Response.Write(&quot;Error: &quot; + ex.Message);
                    }
                }
                else
                {
                    Response.Write(&quot;Please select a file to upload.&quot;);
                }
</pre>
<p>Run the code and test the upload and it should work. </p>
<p><strong>SCENARIO 2: </strong><br />
Now this is fine for a demo. But what if I want to setup Windows authentication for my application but restrict the authenticated users of the application from directly accessing the UNC share to copy files? Any uploads to the UNC share should be done only using the Local User Account that I created earlier. </p>
<p>To solve this issue do the following&#8230;</p>
<p>1) Change the identity impersonate tag in Web.config to
<pre name="code" class="xml">
&lt;identity impersonate=&quot;true&quot; /&gt;
</pre>
<p>, assuming that you have enabled Windows authentication in IIS as well.</p>
<p>2) Change the impersonation at runtime to the Local User Account, upload the file and then undo the impersonation. To do this use the following code&#8230;</p>
<pre name="code" class="csharp">

using System.Security.Principal;
using System.Runtime.InteropServices;

namespace FileUploadUNCShare
{
    public partial class _Default : System.Web.UI.Page
    {

        public const int LOGON32_LOGON_INTERACTIVE = 2;
        public const int LOGON32_PROVIDER_DEFAULT = 0;

        WindowsImpersonationContext impersonationContext;

        [DllImport(&quot;advapi32.dll&quot;)]
        public static extern int LogonUserA(String lpszUserName,
            String lpszDomain,
            String lpszPassword,
            int dwLogonType,
            int dwLogonProvider,
            ref IntPtr phToken);
        [DllImport(&quot;advapi32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
        public static extern int DuplicateToken(IntPtr hToken,
            int impersonationLevel,
            ref IntPtr hNewToken);

        [DllImport(&quot;advapi32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
        public static extern bool RevertToSelf();

        [DllImport(&quot;kernel32.dll&quot;, CharSet = CharSet.Auto)]
        public static extern bool CloseHandle(IntPtr handle);

        private bool ImpersonateUser(String userName, String domain, String password)
        {
            WindowsIdentity tempWindowsIdentity;
            IntPtr token = IntPtr.Zero;
            IntPtr tokenDuplicate = IntPtr.Zero;

            if (RevertToSelf())
            {
                if (LogonUserA(userName, domain, password, LOGON32_LOGON_INTERACTIVE,
                    LOGON32_PROVIDER_DEFAULT, ref token) != 0)
                {
                    if (DuplicateToken(token, 2, ref tokenDuplicate) != 0)
                    {
                        tempWindowsIdentity = new WindowsIdentity(tokenDuplicate);
                        impersonationContext = tempWindowsIdentity.Impersonate();
                        if (impersonationContext != null)
                        {
                            CloseHandle(token);
                            CloseHandle(tokenDuplicate);
                            return true;
                        }
                    }
                }
            }
            if (token != IntPtr.Zero)
                CloseHandle(token);
            if (tokenDuplicate != IntPtr.Zero)
                CloseHandle(tokenDuplicate);
            return false;
        }

        private void UndoImpersonation()
        {
            impersonationContext.Undo();
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (ImpersonateUser(&quot;Test_Share&quot;, &quot;&quot;, &quot;@Dell123&quot;))
            {

                if ((FileUpload1.PostedFile != null) &amp;amp;&amp;amp; (FileUpload1.PostedFile.ContentLength &amp;gt; 0))
                {
                    string fileName = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
                    string folderPath = @&quot;\\MyUNCShare\MyFolder\&quot;;

                    string locationToSave = folderPath + &quot;\\&quot; + fileName;
                    try
                    {
                        FileUpload1.PostedFile.SaveAs(locationToSave);
                        Response.Write(&quot;The file has been uploaded.&quot;);
                    }
                    catch (Exception ex)
                    {
                        Response.Write(&quot;Error: &quot; + ex.Message);
                    }
                }
                else
                {
                    Response.Write(&quot;Please select a file to upload.&quot;);
                }

                UndoImpersonation();
            }
            else
            {
                Response.Write(&quot;Failed&quot;);
            }

        }
    }
}
</pre>
<p>This will ensure that the impersonation you need to upload the file does not interfere with the Application level  impersonation you may want to use.</p>
<p>Hope it is useful!</p>
<p>Cheers!</li>
</ol>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/2leggedspider.wordpress.com/64/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/2leggedspider.wordpress.com/64/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/2leggedspider.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/2leggedspider.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/2leggedspider.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/2leggedspider.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/2leggedspider.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/2leggedspider.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/2leggedspider.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/2leggedspider.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/2leggedspider.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/2leggedspider.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=2leggedspider.wordpress.com&blog=110876&post=64&subd=2leggedspider&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://2leggedspider.wordpress.com/2007/05/28/upload-files-to-unc-share-using-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f32eca38c5ea5d1d86681bc09214cf2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">2leggedspider</media:title>
		</media:content>
	</item>
	</channel>
</rss>