<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Ben Powell</title><link>http://blog.benpowell.co.uk/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/benpowell" /><description>my life, opinions and innocuous ramblings</description><language>en</language><managingEditor>noreply@blogger.com (Ben)</managingEditor><lastBuildDate>Mon, 30 Jan 2012 15:46:30 PST</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">177</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">25</openSearch:itemsPerPage><feedburner:info uri="benpowell" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>TeraCopy: The system cannot move the file to a different disk drive</title><link>http://feedproxy.google.com/~r/benpowell/~3/2Z_-RuEwlWA/teracopy-system-cannot-move-file-to.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Mon, 21 Nov 2011 12:53:29 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-7822368855954174804</guid><description>&lt;a href="http://www.codesector.com/teracopy.php"&gt;TeraCopy&lt;/a&gt; cannot deal with &lt;a href="http://en.wikipedia.org/wiki/Path_(computing)#Uniform_Naming_Convention"&gt;UNC paths&lt;/a&gt; (i.e. \\my-nas\share) and you will be greeted with the message:&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
The system cannot move the file to a different disk drive.&lt;/blockquote&gt;
To work around the problem, &lt;a href="http://support.microsoft.com/kb/308582"&gt;map a network drive&lt;/a&gt; to that UNC path. TeraCopy will then work without issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-7822368855954174804?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-21T21:53:29.373+01:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/11/teracopy-system-cannot-move-file-to.html</feedburner:origLink></item><item><title>Could not load file or assembly bug in Visual Studio 2010</title><link>http://feedproxy.google.com/~r/benpowell/~3/NvLZpua0J5U/could-not-load-file-or-assembly-bug-in.html</link><category>technology</category><category>ASP.NET</category><category>Visual Studio</category><author>noreply@blogger.com (Ben)</author><pubDate>Mon, 21 Nov 2011 12:53:45 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-3610317036835541149</guid><description>Visual Studio 2010 does not honour the &lt;b&gt;Copy Local&lt;/b&gt; setting on a referenced DLL &lt;b&gt;unless you set it to false and then back to true&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
By default the XML looks like this:&lt;br /&gt;
&lt;pre class="prettyPrint"&gt;&amp;lt;Reference Include="DevExpress.SpellChecker.v11.1.Core, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"&amp;gt;
&amp;lt;HintPath&amp;gt;..\References\DevExpress.SpellChecker.v11.1.Core.dll&amp;lt;/HintPath&amp;gt;
&amp;lt;/Reference&amp;gt;
&lt;/pre&gt;
Following the simple step above sets it correctly, which is then honoured by MsBuild and the DLL we be included in the deployment:&lt;br /&gt;
&lt;pre class="prettyPrint"&gt;&amp;lt;Reference Include="DevExpress.SpellChecker.v11.1.Core, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"&amp;gt;
&amp;lt;HintPath&amp;gt;..\References\DevExpress.SpellChecker.v11.1.Core.dll&amp;lt;/HintPath&amp;gt;
&amp;lt;Private&amp;gt;True&amp;lt;/Private&amp;gt;
&amp;lt;/Reference&amp;gt;
&lt;/pre&gt;
A nasty bug. By default the Copy Local should be set to False in the properties window, since the build treats it as such.&lt;br /&gt;
&lt;br /&gt;
To reiterate: To fix, change the &lt;b&gt;Copy Local&lt;/b&gt; property to &lt;b&gt;False &lt;/b&gt;then &lt;i&gt;save &lt;/i&gt;your project. Then revert to &lt;b&gt;True &lt;/b&gt;and &lt;i&gt;save&lt;/i&gt; the project again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-3610317036835541149?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-21T21:53:45.728+01:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/11/could-not-load-file-or-assembly-bug-in.html</feedburner:origLink></item><item><title>BBC iPlayer Global now works over AirPlay (AppleTV)</title><link>http://feedproxy.google.com/~r/benpowell/~3/rSanZEKktQI/bbc-iplayer-global-now-works-over.html</link><category>firmware</category><category>iPad</category><category>iPlayer</category><category>AppleTV</category><category>Apple</category><category>BBC</category><author>noreply@blogger.com (Ben)</author><pubDate>Thu, 17 Nov 2011 08:26:39 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-9202609357599850964</guid><description>I had several problems with iPlayer Global on iPad and streaming content to AppleTV, namely, it just didn't work. It turns out I can blame Apple.&lt;br /&gt;
&lt;br /&gt;
You need both iOS 5 on the iPad and the 4.4.2 firmware on AppleTV. The only problem is that you can't update to 4.4.2 using the AppleTV update mechanism on the device, because Apple pulled the update after it bricked numerous devices.&lt;br /&gt;
&lt;br /&gt;
However, if you are determined to get this to work, you'll need to connect the AppleTV device to your computer directly using USB. You might need to buy a &lt;a href="http://www.amazon.co.uk/gp/product/B0021X7H6O/ref=as_li_tf_tl?ie=UTF8&amp;amp;tag=juntocouk-21&amp;amp;linkCode=as2&amp;amp;camp=1634&amp;amp;creative=6738&amp;amp;creativeASIN=B0021X7H6O"&gt;USB mini Cable, Type A standard to Type B MICRO for Mobile Devices, 1.8 Metre (6ft)&lt;/a&gt;
 if you haven't got one already (no Apple don't include one with AppleTV). Disconnect the power and everything else from your AppleTV with the exception of the USB cable. Open iTunes and you should see the AppleTV device. Go through the upgrade option.&lt;br /&gt;
&lt;br /&gt;
You device should now be running 4.4.2 instead of 4.4.1. AirPlay should now work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-9202609357599850964?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-17T17:26:39.652+01:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/11/bbc-iplayer-global-now-works-over.html</feedburner:origLink></item><item><title>iPad BBC iPlayer Global won't stream over Airplay to Apple TV</title><link>http://feedproxy.google.com/~r/benpowell/~3/A_8aZ3zeIrk/ipad-bbc-iplayer-global-wont-stream.html</link><author>noreply@blogger.com (Ben)</author><pubDate>Thu, 17 Nov 2011 08:27:36 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-7442027689497212706</guid><description>Ok, I recently bought an iPad, &lt;a href="http://blog.benpowell.co.uk/2011/10/apple-store-that-bbc-iplayer-forgot.html"&gt;went through fifty million hoops to get the BBC iPlayer Global subscription&lt;/a&gt;, bought an Apple TV device and then tried to use Airplay to watch a bit of old Aunty. It &lt;a href="http://www.bbc.co.uk/dna/mbiplayer/NF7331806?thread=8112255"&gt;doesn't&lt;/a&gt; &lt;a href="http://www.bbc.co.uk/dna/mbiplayer/NF7331806?thread=8141320"&gt;work&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;The BBC have obviously intended the whole family to watch iPlayer via the iPad, huddled around it like idiots.&lt;br /&gt;
&lt;br /&gt;
I want to scream. How hard can this be?&amp;nbsp;Do you really expect us to watch this on the iPad? What the fuck is my 42" TV for then?&lt;br /&gt;
&lt;br /&gt;
Is iOS 5 &lt;a href="http://bendodson.com/weblog/2011/06/09/airplay-mirroring-tv-out-and-the-apple-tv-as-a-games-console/"&gt;Airplay mirroring&lt;/a&gt; going to be my savior?&lt;br /&gt;
&lt;br /&gt;
Update: Actually with &lt;a href="http://blog.benpowell.co.uk/2011/11/bbc-iplayer-global-now-works-over.html"&gt;a workaround to update the AppleTV firmware&lt;/a&gt;, AirPlay now works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-7442027689497212706?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-17T17:27:36.464+01:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/10/ipad-bbc-iplayer-global-wont-stream.html</feedburner:origLink></item><item><title>The Apple Store that the BBC iPlayer forgot</title><link>http://feedproxy.google.com/~r/benpowell/~3/eqUkf-VWe-8/apple-store-that-bbc-iplayer-forgot.html</link><category>ClickAndBuy</category><category>iPad</category><category>iPlayer</category><category>Apple</category><category>itunes</category><category>BBC</category><author>noreply@blogger.com (Ben)</author><pubDate>Thu, 20 Oct 2011 02:15:55 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4988004474969213288</guid><description>I'm a British expat. I left the UK in 2004 and I have to admit that I still miss UK television. I realise this is bordering on sad, but the state of German television is so bad, the only thing that we switch the tv on for is the news at 8pm and infrequently &lt;a href="http://en.wikipedia.org/wiki/Tatort"&gt;Tatort&lt;/a&gt; on a Sunday evening.&amp;nbsp;In 2007 &lt;a href="http://www.bbc.co.uk/pressoffice/pressreleases/stories/2007/06_june/27/iplayer.shtml"&gt;the BBC launched iPlayer&lt;/a&gt;. I was excited about the launch because I saw it as a way to watch UK television content overseas via the internet. I saw it as a legal avenue to watch UK tv. I was sadly disappointed.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;The first time I tried to access iPlayer back then I was given the error:&lt;br /&gt;
&lt;blockquote&gt;
This content is only available in the UK.&amp;nbsp;&lt;/blockquote&gt;
Fair enough. People lay a license fee. I emailed the BBC and told them I would pay to access iPlayer. I was willing to part with 10 GPB per month just to get access to good quality television. I wanted to give them money.. for media content... I heard nothing.&lt;br /&gt;
&lt;br /&gt;
Then in September 2009 &lt;a href="http://www.bbc.co.uk/pressoffice/bbcworldwide/worldwidestories/pressreleases/2010/09_september/global_iplayer.shtml"&gt;Mark Smith got appointed to the new role of Global iPlayer Launch Director&lt;/a&gt;. There were&amp;nbsp;murmurs&amp;nbsp;of iPlayer subscriptions for customers outside the UK. I was excited again. Then at the end of 2010 I heard that the &lt;a href="http://paidcontent.co.uk/article/419-bbc-plans-subscription-only-u.s.-iplayer-on-ipad/#"&gt;subscription was going to be via an iPad app&lt;/a&gt;. Ok, accepted. I bought an iPad.&lt;br /&gt;
&lt;br /&gt;
A few weeks ago after &lt;a href="http://www.bbc.co.uk/pressoffice/bbcworldwide/worldwidestories/pressreleases/2011/07_july/bbc_iplayer_global.shtml"&gt;the final launch of the BBC iPlayer Global&lt;/a&gt; I logged on to iTunes and searched for BBC iPlayer. Up it came and I installed it. I loaded it up, nervously excited like a small child at Christmas opening their presents:&lt;br /&gt;
&lt;blockquote&gt;
Sorry, this content is only available in the UK.&lt;/blockquote&gt;
WTF? Ok, I calmed down. I must have done something wrong. I Googled... Ah, there are two versions of the iPad app. One is for the UK and the other for the Global version. Quickly back to the iTunes Store to search:&lt;br /&gt;
&lt;blockquote&gt;
BBC iPlayer global&lt;br /&gt;
Sorry, no results.&lt;/blockquote&gt;
Eh? The penny dropped. The BBC Worldwide have deployed the global version to 11 countries in Europe. They each have their own Apple iTunes store and haven't included it in the UK iTunes store.&lt;br /&gt;
&lt;br /&gt;
Hmmm. I guess that means I have to go and navigate the German iTunes store then. Hmm. Shit it is in German. This internet thing seems to be very "local" these days. Fuck Apple. Oh well. Let's get it from the German Apple store then.&lt;br /&gt;
&lt;br /&gt;
It took a while to figure that out, but the link to the app in each store is different and based on a 2 letter ISO country code:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://itunes.apple.com/at/app/bbc-iplayer-global/id449130604?mt=8"&gt;Austria&lt;/a&gt;, &lt;a href="http://itunes.apple.com/be/app/bbc-iplayer-global/id449130604?mt=8"&gt;Belgium&lt;/a&gt;, &lt;a href="http://itunes.apple.com/fr/app/bbc-iplayer-global/id449130604?mt=8"&gt;France&lt;/a&gt;, &lt;a href="http://itunes.apple.com/de/app/bbc-iplayer-global/id449130604?mt=8"&gt;Germany&lt;/a&gt;, &lt;a href="http://itunes.apple.com/it/app/bbc-iplayer-global/id449130604?mt=8"&gt;Italy&lt;/a&gt;, &lt;a href="http://itunes.apple.com/lu/app/bbc-iplayer-global/id449130604?mt=8"&gt;Luxembourg&lt;/a&gt;, &lt;a href="http://itunes.apple.com/ie/app/bbc-iplayer-global/id449130604?mt=8"&gt;The Republic of Ireland&lt;/a&gt;, &lt;a href="http://itunes.apple.com/nl/app/bbc-iplayer-global/id449130604?mt=8"&gt;The Netherlands&lt;/a&gt;, &lt;a href="http://itunes.apple.com/pt/app/bbc-iplayer-global/id449130604?mt=8"&gt;Portugal&lt;/a&gt;, &lt;a href="http://itunes.apple.com/es/app/bbc-iplayer-global/id449130604?mt=8"&gt;Spain&lt;/a&gt; and &lt;a href="http://itunes.apple.com/ch/app/bbc-iplayer-global/id449130604?mt=8"&gt;Switzerland&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I managed to create a new account in the German iTunes store. I wasn't allowed use my existing email address, because that was already used in the UK iTunes store. I used &lt;a href="http://lifehacker.com/144397/instant-disposable-gmail-addresses"&gt;Gmail plus addressing&lt;/a&gt; on the same email address and that worked. I tried to use my UK Mastercard, which has the billing address here in Germany. Apple politely decline my card because it is a UK credit card.&amp;nbsp;Up yours Apple. Fuckers.&lt;br /&gt;
&lt;br /&gt;
Since when were credit cards not allowed to be used abroad? I don't have a German credit card. One card is enough, and credit cards are supposed to be used globally.&amp;nbsp;Up yours Apple. Fuckers.&lt;br /&gt;
&lt;br /&gt;
I choose "Keine" (None) as a payment option and create the account anyway. Not sure how I am going to pay the subscription yet, but I'll come to that later.&lt;br /&gt;
&lt;br /&gt;
My iPad is setup to use my UK iTunes account. I need to switch it (Settings - Store - Logout - Login). I load the app into iTunes via my laptop and then try to sync the app. It kicks up a stink, but I finally manage to authorise the account (in iTunes) and then sync the app on to the iPad. Hurrah.&lt;br /&gt;
&lt;br /&gt;
Now to subscribe to iPlayer Global. Hmmm. Not many options here. I don't think my wife has a German credit card either. I'm certainly not giving Apple access to my bank account. ClickAndBuy are the final option. &lt;a href="http://www.google.com/search?q=clickandbuy%20scam"&gt;Google them&lt;/a&gt;. Sounds dodgy. Oh well, no other option.&amp;nbsp;Up yours Apple. Fuckers.&lt;br /&gt;
&lt;br /&gt;
Finally sign up with ClickAndBuy after a good 30 minutes of faffing on their sign up form. I laugh at their idiotic CAPTCHA and the multiple attempts to get me to sign up for their thinly disguised spam service &lt;i&gt;a.k.a. our selected partners&lt;/i&gt;. I use the &lt;b&gt;same previously Apple rejected&lt;/b&gt; UK Mastercard. Up yours Apple. Fuckers.&lt;br /&gt;
&lt;br /&gt;
The whole process has now taken 3 hours. I've gone round and round in circles, but in the end I now have BBC iPlayer Global on my iPad.&lt;br /&gt;
&lt;br /&gt;
Those of you that know me know I'm quite computer literate. I'm an IT consultant. I build web applications. I'm working currently on a bunch of web services for an iPad app integration. I know web apps, how they work and how developers think. My first experience of the BBC iPlayer Global has been a disaster. It has taken my entire evening and a lot of frustration. If I, as an IT professional, have this much trouble, then the &lt;i&gt;Average Expat Joe&lt;/i&gt; is screwed.&lt;br /&gt;
&lt;br /&gt;
In conclusion, the easy solution would be for BBC Worldwide to add the iPlayer Global to the UK iTunes store. I understand that they don't want to create confusion and since the app logos are exactly the same, you could get UK residents downloading the wrong app. However, I hazard a guess that a large number of the first subscribers to iPlayer Global will be expats. Many of those expats will have maintained their UK bank accounts and their UK iTunes store account. Many of them don't want to use their local iTunes store, for the same reason that they don't want to watch local television - it's not in English. Apple could help by allowing users to choose their language and stop assuming that country == language.&amp;nbsp;Up yours Apple. Fuckers.&lt;br /&gt;
&lt;br /&gt;
I'm deeply disappointed. I've waited 4 years. I've bought an iPad and ordered an Apple TV unit. I've jumped through hoops. I've refrained from switching to downloading content illegally. However, as it stands it would appear that if I want to watch the content I want to watch, I need to go &lt;a href="http://www.bittorrent.com/"&gt;here&lt;/a&gt;, &lt;a href="http://torrentfreak.com/more-bittorrent-users-go-anonymous-090622/"&gt;here&lt;/a&gt; and &lt;a href="http://thepiratebay.org/"&gt;here&lt;/a&gt;. Or do I need to wait another 4 years?&lt;br /&gt;
&lt;br /&gt;
I know the heart of this isn't really Apple's fault, nor the BBC. The bottom line rests with the media licensors who still believe they can cling on to their local (national) business models. If they allowed Apple (or anyone else) to sell their content to anyone, regardless of where they resided and collect a fee then this shit wouldn't happen. Apple wouldn't have to prevent me from buying stuff. Apple wouldn't force me to read stuff in German. Apple wouldn't stop me using my perfectly valid credit card.&lt;br /&gt;
&lt;br /&gt;
I now have two iTunes accounts. I now have a ClickandBuy account that I didn't want. I've wasted valuable time and energy. I want Mark Smith and Jana Bennett to read this. I want them to add iPlayer Global to the UK iTunes store so I can cancel my German iTunes account and my ClickAndDie account pronto.&lt;br /&gt;
&lt;br /&gt;
For those expats that are also struggling, you'll need the following if you want to install the BBC iPlayer Global and you have a UK iTunes account:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Create a new iTunes account in your region. Navigate the foreign language. Scream at Apple's ignorance.&lt;/li&gt;
&lt;li&gt;Use a credit card that is tied to that region, or use a UK credit card with ClickAndBuy.&lt;/li&gt;
&lt;li&gt;Change your iPad to match the account region.&lt;/li&gt;
&lt;li&gt;Install the app.&lt;/li&gt;
&lt;/ol&gt;
Over and out. Up yours Apple. Fuckers.&lt;br /&gt;
&lt;br /&gt;
FAO: &lt;a href="http://twitter.com/#!/bbcwpress"&gt;@bbcwpress&lt;/a&gt;, &lt;a href="http://twitter.com/#!/BBCiPlayerGLBL"&gt;@BBCiPlayerGLBL&lt;/a&gt;, &lt;a href="http://twitter.com/#!/juliantelly"&gt;@juliantelly&lt;/a&gt;, &lt;a href="http://twitter.com/#!/tessamatchett"&gt;@tessamatchett&lt;/a&gt;, &lt;a href="http://twitter.com/#!/taraconlan"&gt;@taraconlan&lt;/a&gt;, &lt;a href="http://twitter.com/#!/charlesarthur"&gt;@charlesarthur&lt;/a&gt;, &lt;a href="http://twitter.com/#!/jasondeansy"&gt;@jasondeansy&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Update&lt;br /&gt;
This post was ready to be published two weeks ago, the night before Steve Jobs died. I held it back, I guess out of respect. Anyway, the post will out....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4988004474969213288?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-20T11:15:55.991+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/10/apple-store-that-bbc-iplayer-forgot.html</feedburner:origLink></item><item><title>ComponentArt 2008 ASP.NET Ajax controls display problem in .NET 4.0</title><link>http://feedproxy.google.com/~r/benpowell/~3/H3WUhPT9O6U/componentart-2008-aspnet-ajax-controls.html</link><category>technology</category><category>ASP.NET</category><category>Microsoft</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 14 Oct 2011 02:39:59 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-7890930111355186401</guid><description>We have recently upgraded an ASP.NET web application from .NET 2.0 to .NET 4.0. We have several grids and other controls using the ComponentArt 2008 Web.UI suite. After upgrading we noticed that the grids were not displaying any data and the paging controls were missing. It took a while to find the problem.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;The problem lies in &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/03/30/cleaner-html-markup-with-asp-net-4-web-forms-client-ids-vs-2010-and-net-4-0-series.aspx"&gt;the way that .NET 4.0 controls ClientIDs&lt;/a&gt;. There is much more control over how these ClientIDs are named, and that is a good thing. However, in the case of these controls it mean that the controls could not correctly reference themselves nor sub controls.&lt;br /&gt;
&lt;br /&gt;
The solution can be seen in &lt;a href="http://www.componentart.com/community/forums/t/63224.aspx"&gt;this ComponentArt forum post&lt;/a&gt;, and works for other versions of the ComponentArt Web.UI as well I believe. The important change comes in the web.config:

&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;configuration&amp;gt;
    &amp;lt;system.web&amp;gt;
        &amp;lt;compilation debug="true" targetFramework="4.0"/&amp;gt;
        &amp;lt;pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/&amp;gt;
    &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-7890930111355186401?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-14T11:39:59.425+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/10/componentart-2008-aspnet-ajax-controls.html</feedburner:origLink></item><item><title>Schema Compare in the Visual Studio Database Project sucks</title><link>http://feedproxy.google.com/~r/benpowell/~3/UW1qPS-49Qo/schema-compare-in-visual-studio.html</link><category>technology</category><category>Visual Studio</category><category>Microsoft</category><category>database</category><author>noreply@blogger.com (Ben)</author><pubDate>Thu, 08 Sep 2011 05:32:22 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-8329761830870465794</guid><description>Visual Studio 2010 has a very cool Database Project type, which is not supported by all &lt;a href="http://www.microsoft.com/visualstudio/en-us/products"&gt;Visual Studio editions&lt;/a&gt;, but it is certainly included in Ultimate and Premium. One of the features is a &lt;a href="http://msdn.microsoft.com/en-us/library/aa833435.aspx"&gt;Schema Compare&lt;/a&gt;, which allows you to compare two database schemas against each other, shows you the differences and then allows you to update the target schema from the source. Those two schemas could be held in actual databases, or in the database project itself. This means that you can compare an existing installation and generate a schema difference script to upgrade one installation to match the other - in other words, great for doing deployment upgrades!&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;The end result of the Schema Compare are awesome. However, the tool for setting up the schema compare sucks. It works, but it sucks so badly, it makes me want to scream every time I use it.&lt;br /&gt;
&lt;br /&gt;
Every time you open the schema compare (even if you saved it), it conveniently "forgets" the options you have previously set. It also makes the options &lt;b&gt;exclusive &lt;/b&gt;rather than &lt;b&gt;inclusive&lt;/b&gt;. There are about 30 different options, which means that you have to run through excluding the common things that you don't want to compare (e.g. database users, roles, credential, files) every damn time.&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-RkNkMA3VX94/TmiiibEXO9I/AAAAAAAAGkU/BD8SKKslccU/s1600/arrrrrrgh.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="239" src="http://1.bp.blogspot.com/-RkNkMA3VX94/TmiiibEXO9I/AAAAAAAAGkU/BD8SKKslccU/s320/arrrrrrgh.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Not again. Please Microsoft. Don't make choose these again!&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Let's start by making the list inclusive. Then pre-select the common things people are going to want to compare. If you take a wild guess at it, that would probably be:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Tables&lt;/li&gt;
&lt;li&gt;Stored Procedures&lt;/li&gt;
&lt;li&gt;Indexes&lt;/li&gt;
&lt;li&gt;Unique Keys&lt;/li&gt;
&lt;li&gt;Views&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
Pretty please with sugar on top, Microsoft. Sort this one out for the next release.&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-8329761830870465794?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-08T14:32:22.771+02:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-RkNkMA3VX94/TmiiibEXO9I/AAAAAAAAGkU/BD8SKKslccU/s72-c/arrrrrrgh.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/09/schema-compare-in-visual-studio.html</feedburner:origLink></item><item><title>WCF JSON Serialization error with DateTime.MinVal and UTC</title><link>http://feedproxy.google.com/~r/benpowell/~3/4AN0_nbGuTo/wcf-json-serialization-error-with.html</link><category>technology</category><category>json</category><category>wcf</category><category>Microsoft</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 02 Sep 2011 08:52:19 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-8880172771898749723</guid><description>&lt;br /&gt;
I came across the following error today in is WCF JSON web service:&lt;br /&gt;
&lt;blockquote&gt;
SerializationException: DateTime values that are greater than DateTime.MaxValue or smaller than DateTime.MinValue when converted to UTC cannot be serialized to JSON.&lt;/blockquote&gt;
The solution took me a while to get my head round, so I thought I should share it. The clue was a&amp;nbsp;&lt;a href="http://stackoverflow.com/questions/4025851/why-can-datetime-minvalue-not-be-serialized-in-timezones-ahead-of-utc"&gt;StackOverflow post&lt;/a&gt;&amp;nbsp;specifying the error and its cause.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
This was compounded by the fact that the WCF service was returning a rather obscure 504 error, namely:&lt;br /&gt;
&lt;blockquote&gt;
ReadResponse() failed: The server did not return a response for this request.&lt;/blockquote&gt;
The error was not being picked up and returned as a service fault, so I switched&amp;nbsp;&lt;a href="http://blogs.msdn.com/b/madhuponduru/archive/2006/05/18/601458.aspx"&gt;WCF tracing on&lt;/a&gt;. The error message was then visible in the logs:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;Exception&amp;gt;
&amp;lt;ExceptionType&amp;gt;System.Runtime.Serialization.SerializationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;lt;/ExceptionType&amp;gt;
&amp;lt;Message&amp;gt;DateTime values that are greater than DateTime.MaxValue or smaller than DateTime.MinValue when converted to UTC cannot be serialized to JSON.&amp;lt;/Message&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
The bottom line is that if you have a DateTime property that is not set, it will be defaulted to DateTime.MinVal when serialized. However, DateTime.MinVal does not have a&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/system.datetime.kind.aspx"&gt;DateTimeKind&lt;/a&gt;&amp;nbsp;specified, which is the default.&lt;br /&gt;
&lt;br /&gt;
This causes a problem with the serializer because it does not treat the MinVal as UTC. If you are in a timezone + GMT (East), then&amp;nbsp;&lt;a href="http://daveonsoftware.blogspot.com/2009/12/json-serialization.html"&gt;this is going to cause you a problem&lt;/a&gt;, and you'll get the error above. This is very nicely described by&amp;nbsp;&lt;a href="http://programmingit.com/questions/programming/why-can-datetime-minvalue-not-be-serialized-in-timezones-ahead-of-utc/"&gt;Adam Robinson&lt;/a&gt;:&lt;br /&gt;
&lt;blockquote&gt;
If your time zone is GMT+1, then the UTC value of DateTime.MinValue in your time zone is going to be an hour less than DateTime.MinValue.&lt;/blockquote&gt;
In my case I had a bunch of DTO objects being passed back as JSON. The serializer would hit the defaulted DateTime value and error. the solution was simple:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;foreach (var dto in dtos)
{
    dto.DateStart = DateTime.SpecifyKind(dto.DateStart, DateTimeKind.Utc);
}
&lt;/pre&gt;
&lt;br /&gt;
The alternative is to stop DateTimes being left empty. In my case an&amp;nbsp;&lt;a href="http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCEQFjAA&amp;amp;url=http%3A%2F%2Fautomapper.codeplex.com%2F&amp;amp;ei=jfhgTtirNdCa-wae7dgn&amp;amp;usg=AFQjCNGyIWUT6oA61LmaeE1Dy5_P6ZnGpw&amp;amp;sig2=exkFomGQtKOq_f0jvrliwA"&gt;Automapper&lt;/a&gt;&amp;nbsp;misconfiguration on the developer's part. If you have the potential for empty DateTime properties, then maybe consider making them nullable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-8880172771898749723?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-02T17:52:19.240+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/09/wcf-json-serialization-error-with.html</feedburner:origLink></item><item><title>HTTPS and HTTP the protocol-less or protocol relative Urls</title><link>http://feedproxy.google.com/~r/benpowell/~3/gyjbckNqQfg/https-and-http-protocol-less-or.html</link><category>technology</category><category>Howto</category><category>html</category><author>noreply@blogger.com (Ben)</author><pubDate>Thu, 11 Aug 2011 03:41:35 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-5372629262002087100</guid><description>If you are offering HTTPS, then any content you load from external sources also needs to be loaded over HTTPS as well, otherwise you’ll receive errors such as “Only secure content is displayed” and that external CSS, image or JavaScript file will be blocked unless you allow it on each page load. This is often the case with CDN content such as Google’s jQuery CDN and jQueryUI (and the CSS).&lt;br /&gt;
&lt;br /&gt;
Previously, the only way around this, would be hard code the HTTPS, which forces the HTTPS connection when the site is accessed in HTTP mode as well. This is an estimated 3.5% overhead over HTTP, per call. We could use JavaScript to use the appropriate protocol, and the Google Analytics plugin uses this exact technique.&lt;br /&gt;
&lt;br /&gt;
However, there is another way and I had not seen this before until today. It is called protocol-less urls, and it looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"&amp;gt;
&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt;
This means that the browser works out which protocol it should be using based on the page that loaded it.&lt;br /&gt;
&lt;br /&gt;
It really works nicely, and more info can be seen here:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.stevesouders.com/blog/2010/02/10/5a-missing-schema-double-download/"&gt;http://www.stevesouders.com/blog/2010/02/10/5a-missing-schema-double-download/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blog.httpwatch.com/2010/02/10/using-protocol-relative-urls-to-switch-between-http-and-https/"&gt;http://blog.httpwatch.com/2010/02/10/using-protocol-relative-urls-to-switch-between-http-and-https/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/4831741/can-i-change-all-my-http-links-to-just"&gt;http://stackoverflow.com/questions/4831741/can-i-change-all-my-http-links-to-just&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-5372629262002087100?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-11T12:41:35.603+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/08/https-and-http-protocol-less-or.html</feedburner:origLink></item><item><title>Code Coverage is not supported in Visual Studio 2010 Professional</title><link>http://feedproxy.google.com/~r/benpowell/~3/bTGtwqdHj14/code-coverage-is-not-supported-in.html</link><category>unit testing</category><category>mstest</category><category>Microsoft</category><category>code coverage</category><author>noreply@blogger.com (Ben)</author><pubDate>Wed, 09 Feb 2011 01:46:01 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-1324952854286913147</guid><description>If you are looking to enable code coverage in your unit testing in Visual Studio 2010 Professional, then please beware that it is not supported. You'll notice that if you edit the local.testsettings file, the left hand pane does not have a section called Data and Diagnostics.&lt;br /&gt;
&lt;br /&gt;
The solution is therefore one of the following:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Upgrade to a version of Visual Studio 2010 that supports code coverage (which is expensive), or&lt;/li&gt;
&lt;li&gt;Use another unit testing framework, such as NUnit (which is free)&lt;/li&gt;
&lt;/ol&gt;What a choice....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-1324952854286913147?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-09T10:46:01.907+01:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/02/code-coverage-is-not-supported-in.html</feedburner:origLink></item><item><title>Change the color of a transparent PNG image icon on the fly using ASP.NET MVC</title><link>http://feedproxy.google.com/~r/benpowell/~3/YeJ8LGsAFTs/change-color-of-transparent-png-image.html</link><category>transparent</category><category>image</category><category>MVC</category><category>PNG</category><category>ASP.NET</category><category>Actionresult</category><category>icon</category><author>noreply@blogger.com (Ben)</author><pubDate>Tue, 08 Feb 2011 04:00:01 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-640041764437102858</guid><description>How to use a ColorMatrix to transform the non-transparent pixels of a PNG image on the fly using ASP.NET MVC2. Take any gray-scale transparent PNG image and apply any known system color to it and then stream it to the HTTP Response stream on the fly.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: 24px; font-weight: bold;"&gt;Defining the problem&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;There are a variety of great icons sets out there for free, and even more for a small price. A personal favourite of mine is &lt;a href="http://glyphish.com/"&gt;Glyphish&lt;/a&gt;, produced by &lt;a href="http://penandthink.com/"&gt;Joseph Wain&lt;/a&gt;. They tend to be gray-scale by default, with&amp;nbsp;the idea that you can edit them in an image editing program such as Adobe Photoshop or Gimp. However, I didn't want to edit them by hand, but provide a&amp;nbsp;URL routed based solution in code to change the icon and color as and when required.&lt;/div&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;Solving the problem&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;The Microsoft .NET Framework has an excellent set of imaging tools built right into the System.Drawing namespaces (i.e. the Graphics Design Interface&amp;nbsp;(GDI+)) . Through the use of a ColorMatrix, we will transpose the existing pixels of a selected image to another color. The transparent PNG image shall&amp;nbsp;be loaded on the fly, altered so that only the non-transparent pixels are changed and then streamed back to the client with the correct response type.&lt;/div&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;What is a Color Matrix?&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;A Color Matrix and its use in color transformations is described rather well by        &lt;a href="http://www.c-sharpcorner.com/UploadFile/mahesh/Transformations0512192005050129AM/Transformations05.aspx"&gt;Mahesh Chand&lt;/a&gt; and the most&lt;br /&gt;
appropriate paragraphs are highlighted below:&lt;/div&gt;&lt;br /&gt;
&lt;blockquote&gt;The color of each pixel of a GDI+ image or bitmap is represented by a 32-bit number where 8-bits are used for each of the red, green, blue, and alpha components. Each of the four components is a number from 0 to 255. For red, green, and blue components, 0 represents no intensity and 255 represents full intensity.&lt;/blockquote&gt;&lt;blockquote&gt;For the alpha component, 0 represents fully transparent and 255 represents fully opaque. A color vector includes four items, i.e., (R, G, B, A). The minimum values for this vector are (0, 0, 0, 0) and the maximum values for this vector are (255, 255, 255, 255).&lt;/blockquote&gt;&lt;blockquote&gt;GDI+ allows the use of values between 0 and 1 where 0 represents the minimum intensity and 1 represents the maximum intensity. These values are used in&amp;nbsp;a color matrix to represent the intensity and opacity of color components. For example, the color vector with the minimum values is (0, 0, 0, 0) and&amp;nbsp;the color vector with maximum values is (1, 1, 1, 1).&lt;/blockquote&gt;&lt;blockquote&gt;In color transformation, we apply a color matrix on a color vector. This can be done by multiplying a 4 x 4 matrix. However a 4 x 4 matrix supports&amp;nbsp;only linear transformations such as rotation, and scaling. To perform non-linear transformations such as translation, you need to use a 5 x 5 matrix.&amp;nbsp;The element of the fifth row and the fifth column of the matrix must be 1 and all of the other entries in the five columns must be 0.&lt;/blockquote&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;Applying the ColorMatrix&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;To apply the color transformation we need a &lt;a href="http://msdn.microsoft.com/en-us/library/system.drawing.imaging.colormatrix.aspx"&gt;ColorMatrix&lt;/a&gt;&amp;nbsp;that will take the RGB elements of the required &lt;a href="http://msdn.microsoft.com/en-us/library/system.drawing.color.aspx"&gt;Color&lt;/a&gt;, and transform&amp;nbsp;the existing pixels to those values. Our resulting        &lt;a href="http://msdn.microsoft.com/en-us/library/system.drawing.imaging.colormatrix.aspx"&gt;ColorMatrix&lt;/a&gt; looks something like that shown below:&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div align="center"&gt;&lt;table border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;
&lt;tr&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                 &lt;/tr&gt;
&lt;tr&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                 &lt;/tr&gt;
&lt;tr&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                 &lt;/tr&gt;
&lt;tr&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;1&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                 &lt;/tr&gt;
&lt;tr&gt;                     &lt;td valign="top"&gt;&lt;b&gt;R&lt;/b&gt;&lt;/td&gt;                     &lt;td valign="top"&gt;&lt;b&gt;G&lt;/b&gt;&lt;/td&gt;                     &lt;td valign="top"&gt;&lt;b&gt;B&lt;/b&gt;&lt;/td&gt;                     &lt;td valign="top"&gt;0&lt;/td&gt;                     &lt;td valign="top"&gt;1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Coding the ColorMatrix&lt;/h2&gt;&lt;div&gt;Our resulting code is a method that requires the physical file path of the original image and a system &lt;a href="http://msdn.microsoft.com/en-us/library/system.drawing.color.aspx"&gt;Color&lt;/a&gt; for the transformation.&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;public class ColorHelper
{
    public static Bitmap Tint(string filePath, Color c)
    {
        // load from file
        Image original = Image.FromFile(filePath);
        original = new Bitmap(original);

        // get a graphics object from the new image
        Graphics g = Graphics.FromImage(original);

        // create the ColorMatrix
        ColorMatrix colorMatrix = new ColorMatrix(
            new float[][]{
                new float[] {0, 0, 0, 0, 0},
                new float[] {0, 0, 0, 0, 0},
                new float[] {0, 0, 0, 0, 0},
                new float[] {0, 0, 0, 1, 0},
                new float[] {c.R / 255.0f, c.G / 255.0f, c.B / 255.0f, 0, 1}
            });

        // create some image attributes
        ImageAttributes attributes = new ImageAttributes();

        // set the color matrix attribute
        attributes.SetColorMatrix(colorMatrix);

        // draw the original image on the new image
        // using the color matrix
        g.DrawImage(original, new Rectangle(0, 0, original.Width, original.Height),
            0, 0, original.Width, original.Height, GraphicsUnit.Pixel, attributes);

        // dispose the Graphics object
        g.Dispose();

        // return the image
        return (Bitmap)original;
    }
} &lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 24px; font-weight: bold;"&gt;Using the code&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;A Custom ActionResult&lt;/h3&gt;&lt;div&gt;For this example I will use ASP.NET MVC to route the requested PNG image file and color, and deliver a PNG image to the HTTP response stream. Rather&amp;nbsp;than invent the wheel,        &lt;a href="http://blog.maartenballiauw.be/post/2008/05/ASPNET-MVC-custom-ActionResult.aspx"&gt;Maarten Balliauw has a rather nice example&lt;/a&gt; of how you can&amp;nbsp;use a custom &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult.aspx"&gt;ActionResult&lt;/a&gt; to deliver this through an &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.htmlhelper.aspx"&gt;HtmlHelper&lt;/a&gt; Extension method. I have made minor modifications to&amp;nbsp;his code to remove the extensive "if orgy".&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;public class ImageResult : ActionResult
{
    public ImageResult() { }
    public Image Image { get; set; }
    public ImageFormat ImageFormat { get; set; }
    public override void ExecuteResult(ControllerContext context)
    {
        // verify properties 
        if (Image == null)
        {
            throw new ArgumentNullException("Image");
        }
        if (ImageFormat == null)
        {
            throw new ArgumentNullException("ImageFormat");
        }
        // output 
        var contentResponses = new Dictionary&amp;lt;ImageFormat, string&amp;gt;()
                    {
                        {ImageFormat.Bmp, "image/bmp"},
                        {ImageFormat.Gif, "image/gif"},
                        {ImageFormat.Icon, "image/vnd.microsoft.icon"},
                        {ImageFormat.Jpeg, "image/jpeg"},
                        {ImageFormat.Png, "image/png"},
                        {ImageFormat.Tiff, "image/tiff"},
                        {ImageFormat.Wmf, "image/wmf"}
                    };

        context.HttpContext.Response.Clear();
        context.HttpContext.Response.ContentType = contentResponses[ImageFormat];

        // output
        Image.Save(context.HttpContext.Response.OutputStream, ImageFormat);
    }
}  &lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;Adding the controller&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;Our controller &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult.aspx"&gt;ActionResult&lt;/a&gt; is relatively simple. The method&amp;nbsp;requires a filename and color name as strings. From that we will work out the supplied Color and pass both values to the Tint() method.&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;public ActionResult Image(string fileName, string colorName)
{
    // map the directory path (soem error checking would be smart here)
    var dir = Server.MapPath("/Images/Icons");

    // combine with the filename
    var path = Path.Combine(dir, fileName);

    // get the color from the supplied name (error check this too)
    Color c = Color.FromName(colorName);

    // Tint the PNG file based on file path and color selected
    Bitmap bmp = Web.Models.ColorHelper.Tint(path, c);

    // return ImageResult
    return new ImageResult { Image = bmp, ImageFormat = ImageFormat.Png };
}&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;Mapping the route&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;In order for our controller method to receive the correct parameters we need to add a new named route to the MVC routing table held in the&amp;nbsp;Global.asmx.cs file.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;routes.MapRoute(
    "Image", // Route name
    "image/{fileName}/{colorName}", // URL with parameters
    new { controller = "Home", action = "Image" } // Parameter defaults
);&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 24px; font-weight: bold;"&gt;Linking to the image in the view&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;In our view the PNG image can be loaded using the routed URL.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;img src="/image/01-refresh.png/Red" /&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 24px; font-weight: bold;"&gt;The Result&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_9pCbQCJMujA/TS7nkLwMx8I/AAAAAAAAARA/O2aRJeZjoCw/s1600/clip_image002.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="331" src="http://2.bp.blogspot.com/_9pCbQCJMujA/TS7nkLwMx8I/AAAAAAAAARA/O2aRJeZjoCw/s400/clip_image002.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: 24px; font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;The Microsoft.NET Framework provides us with a flexible and fully featured Graphics Design Interface library. In combination with ASP.NET MVC we can&amp;nbsp;alter transparent PNG images on the fly based on a URL. Using one image, we can offer it up in any color the framework supports as a named color.&lt;/div&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 24px; font-weight: bold;"&gt;Supporting downloads&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;You can also&amp;nbsp;&lt;a href="http://www.box.net/shared/ederssntzi"&gt;download&lt;/a&gt;&amp;nbsp;this article as a PDF document. A demonstration of the code shown in this&amp;nbsp;article can be found in a Visual Studio.NET 2010 solution, which is also available for &lt;a href="http://www.box.net/shared/tlak7z2c2v"&gt;download&lt;/a&gt;. His blog contains the original article "Change the color of a transparent PNG image icon on the fly using ASP.NET MVC".&lt;/div&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 24px; font-weight: bold;"&gt;About the author&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;Ben Powell is Microsoft .NET developer providing innovative solutions to common business to business integration problems. He has worked on projects&amp;nbsp;for companies such as Dell Computer Corp, Visteon, British Gas, BP Amoco and Aviva Plc. He can be found at &lt;a href="http://blog.benpowell.co.uk/"&gt;http://blog.benpowell.co.uk&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 24px; font-weight: bold;"&gt;Credits&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://blog.maartenballiauw.be/"&gt;Maarten Balliauw&lt;/a&gt;&lt;br /&gt;
for the &lt;a href="http://blog.maartenballiauw.be/post/2008/05/ASPNET-MVC-custom-ActionResult.aspx"&gt;custom ActionResult HtmlHelper Extension&lt;/a&gt; and Richard Banks for his comments on the &lt;a href="http://www.richard-banks.org/2010/11/needless-if-statements.html"&gt;Needless If Statements&lt;/a&gt;!.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://penandthink.com/"&gt;Joseph Wain&lt;/a&gt;&amp;nbsp;for the great icon set &lt;a href="http://glyphish.com/"&gt;Glyphish&lt;/a&gt;.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.csharpcorner.com/Blogs/BloggerDetails.aspx?BloggerId=mahesh"&gt;Mahesh Chand&lt;/a&gt;&amp;nbsp;for the excellent description of&lt;a href="http://www.c-sharpcorner.com/UploadFile/mahesh/Transformations0512192005050129AM/Transformations05.aspx"&gt;Color Matrices&lt;/a&gt; and&lt;a href="http://stackoverflow.com/users/17034/hans-passant"&gt;Hans Passant&lt;/a&gt; for the tips on &lt;a href="http://stackoverflow.com/questions/2510013/gdi-set-all-pixels-to-given-color-while-retaining-existing-alpha-value"&gt;ColorMatrix usage&lt;/a&gt;,&amp;nbsp;without which I would have missed the division by 255.0f!&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: 24px; font-weight: bold;"&gt;Other Resources&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=juntocouk-21&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1430228865&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=juntocouk-21&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0735627142&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=juntocouk-21&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=047043399X&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-640041764437102858?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-08T13:00:01.733+01:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_9pCbQCJMujA/TS7nkLwMx8I/AAAAAAAAARA/O2aRJeZjoCw/s72-c/clip_image002.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2011/01/change-color-of-transparent-png-image.html</feedburner:origLink></item><item><title>Supporting the WS-I Basic Profile Password Digest in a WCF client proxy</title><link>http://feedproxy.google.com/~r/benpowell/~3/uQfJph-dTJs/supporting-ws-i-basic-profile-password.html</link><category>axis2</category><category>technology</category><category>password</category><category>wse</category><category>hashed</category><category>digest</category><category>security</category><category>wcf</category><category>UsernameToken</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 21 Nov 2010 05:32:16 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4157738486080855643</guid><description>How to use the message inspector and custom behaviors to override the contents of a SOAP message before it is sent, or before it is received, so we can implement the unsupported Password Digest security scheme under WCF.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;Introduction to the problem&lt;/h2&gt;&lt;div&gt;Although it is possible to consume a web service that requires the provision of a &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.aspx"&gt;UsernameToken&lt;/a&gt; in WCF, support for the &lt;a href="http://docs.oasis-open.org/wss/v1.1/wss-v1.1-spec-os-UsernameTokenProfile.pdf"&gt;WS-I Basic Profile 1.1 Password Digest&lt;/a&gt; is &lt;a href="http://isyourcode.blogspot.com/2010/05/using-oasis-username-token-profile-in.html"&gt;not provided in Windows Communication Foundation&lt;/a&gt;. For many developers tasked with the delivery of integrating their applications with external SOAP based web services, this becomes a challenge when this security profile is chosen by the web service provider. For those .NET developers involved in Enterprise Application Integration (EAI), WCF is the tool of choice internally and those skills are ideally also leveraged in external (B2B) projects.&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;Previously in the &lt;a href="http://msdn.microsoft.com/en-us/library/dd560530.aspx"&gt;Web Service Extensions frameworks&lt;/a&gt; (&lt;a href="http://msdn.microsoft.com/en-us/library/aa152904.aspx"&gt;WSE 2.0&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms977317.aspx"&gt;WSE 3.0&lt;/a&gt;), Microsoft had supported this security profile and the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.passwordoption.aspx"&gt;hashed password digest&lt;/a&gt; in combination with the nonce and username. It is not entirely clear as to why Microsoft chose to exclude this option from WCF, although my assumption is that they saw it as a relatively clunky and inefficient security implementation, that had been superseded by better and more effective security mechanisms. Maybe someone from the Microsoft WCF team might like to explain that decision, but for the moment we need to understand that it is not available to us out of the box, and work around it when we need to.&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;Solving the problem&lt;/h2&gt;&lt;div&gt;Microsoft have conveniently provided us with a method of customizing the message before it is sent (and before it is received) through the use of a &lt;a href="http://msdn.microsoft.com/en-us/library/aa717047.aspx"&gt;Message Inspector&lt;/a&gt;. Using this, we can alter any part of the SOAP envelope, including the header. Since the &lt;a href="http://msdn.microsoft.com/en-us/library/ms953977.aspx"&gt;WS-I Basic Profile&lt;/a&gt; requires us to provide a &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.aspx"&gt;UsernameToken&lt;/a&gt; in the SOAP header, this is the ideal way to deliver the Password Digest requirement in our application.&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;Microsoft also offers us a solution in the form of a &lt;a href="http://msdn.microsoft.com/en-us/library/ms731872.aspx"&gt;Custom Security Token&lt;/a&gt;. Although we shall not be implementing the Custom Security Token, you can find &lt;a href="http://blogs.msdn.com/b/aszego/archive/2010/06/24/usernametoken-profile-vs-wcf.aspx"&gt;good examples&lt;/a&gt; on the web. &lt;/div&gt;&lt;br /&gt;
&lt;div&gt;Companies that deliver enterprise web services built on the Apache Axis2 SOAP stack (often written in Java), have a tendency to use this security profile. I don't know why this choice is common in this development sphere, but I have now experienced this requirement several times with companies that use this technology stack. WCF interoperability with Axis2 is challenging, but most common interop issues can be overcome using the Message Inspector.&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;Overriding the message&lt;/h2&gt;&lt;div&gt;A WCF &lt;a href="http://msdn.microsoft.com/en-us/library/aa717047.aspx"&gt;MessageInspector&lt;/a&gt; allows us to intercept, inspect and alter messages going in and out of the service payer, either as a consumer or provider. As a consumer we are required to implement the &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.aspx"&gt;IClientMessageInspector&lt;/a&gt; interface which includes the following signature:&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;public class PasswordDigestMessageInspector : IClientMessageInspector
{
    #region IClientMessageInspector Members

    public void AfterReceiveReply(ref System.ServiceModel.Channels.Message reply, object correlationState)
    {
        throw new NotImplementedException();
    }

    public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel)
    {
        throw new NotImplementedException();
    }

    #endregion
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;Create a new class library and add a reference to &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.aspx"&gt;System.ServiceModel&lt;/a&gt;. Add a new class as above that implements the &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.aspx"&gt;IClientMessageInspector&lt;/a&gt; interface. We are interested in the &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.beforesendrequest.aspx"&gt;BeforeSendRequest&lt;/a&gt; method, and in this method we want to override the existing SOAP header and provide the correct implementation of the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.aspx"&gt;UsernameToken&lt;/a&gt;. &lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;Don't reinvent the wheel&lt;/h2&gt;&lt;div&gt;Before we run off and start writing our own &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.aspx"&gt;UsernameToken&lt;/a&gt; class(es) to support a Password Digest security scheme, let's remember that Microsoft have already written one. Both the WSE 2.0 and WSE 3.0 libraries included support for the Password Digest. There is no reason why we cannot use these libraries in conjunction with WCF, because the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.aspx"&gt;UsernameToken&lt;/a&gt; has a convenient &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.getxml.aspx"&gt;GetXml(XmlDocument document)&lt;/a&gt; method, from which we can extract the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.aspx"&gt;UsernameToken&lt;/a&gt; XML, and inject it into the existing &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.message.headers.aspx"&gt;Message.Headers&lt;/a&gt; collection.&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;To use this library you will need to download the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=018a09fd-3a74-43c5-8ec1-8d789091255d&amp;amp;displaylang=en"&gt;Microsoft Web Service Enhancements (3.0)&lt;/a&gt; and extract the required DLL. Add a reference to this library to your project. Now we can reference the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.aspx"&gt;UsernameToken&lt;/a&gt; classes in our project. Next we need provide our MessageInspector with the username and password required to build the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.aspx"&gt;UsernameToken&lt;/a&gt;. We can do this fairly easily by providing the information in the constructor:&lt;/div&gt;&lt;pre class="prettyprint"&gt;public string Username { get; set; }
public string Password { get; set; }

public PasswordDigestMessageInspector(string username, string password)
{
    this.Username = username;
    this.Password = password;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;h2&gt;Changing the header&lt;/h2&gt;&lt;div&gt;We can now use these properties to construct our &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.security.tokens.usernametoken.aspx"&gt;UsernameToken&lt;/a&gt; and inject it as a custom message header called "Security":&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel)
{
    // Use the WSE 3.0 security token class
    UsernameToken token = new UsernameToken(this.Username, this.Password, PasswordOption.SendHashed);

    // Serialize the token to XML
    XmlElement securityToken = token.GetXml(new XmlDocument());

    //
    MessageHeader securityHeader = MessageHeader.CreateHeader("Security", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", securityToken, false);
    request.Headers.Add(securityHeader);

    // complete
    return Convert.DBNull;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;h2&gt;Altering behaviors&lt;/h2&gt;&lt;div&gt;We now need to make sure our web service proxy implements this &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.aspx"&gt;IClientMessageInspector&lt;/a&gt; method. To configure and implement our &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.aspx"&gt;IClientMessageInspector&lt;/a&gt; we need to define a &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163302.aspx"&gt;WCF custom behavior&lt;/a&gt;. Behaviors can be used to extend the service model's services, endpoints, contracts and operations (&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163302.aspx#S7"&gt;see figure 8&lt;/a&gt;). For this example we are specifically interested in customizing the service endpoint.&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;First add a new class to your project so that you can implement this behavior. The behavior must implement the &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.description.iendpointbehavior.aspx"&gt;IEndpointBehavior&lt;/a&gt; interface:&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;public class PasswordDigestBehavior : IEndpointBehavior
{

    #region IEndpointBehavior Members

    public void AddBindingParameters(ServiceEndpoint endpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
    {
        throw new NotImplementedException();
    }

    public void ApplyClientBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.ClientRuntime clientRuntime)
    {
        throw new NotImplementedException();
    }

    public void ApplyDispatchBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.EndpointDispatcher endpointDispatcher)
    {
        throw new NotImplementedException();
    }

    public void Validate(ServiceEndpoint endpoint)
    {
        throw new NotImplementedException();
    }

    #endregion
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;We are interested in the &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.description.iendpointbehavior.applyclientbehavior.aspx"&gt;ApplyClientBehavior&lt;/a&gt; method so that we can instruct it to add our new custom &lt;b style="mso-bidi-font-weight: normal;"&gt;PasswordDigestMessageInspector&lt;/b&gt;. Our custom behavior needs to pass the username and password to this class, so as in the &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.aspx"&gt;IClientMessageInspector&lt;/a&gt;, we will take the username and password as constructor parameters, thus:&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;public class PasswordDigestBehavior : IEndpointBehavior
{

    public string Username { get; set; }
    public string Password { get; set; }

    public PasswordDigestBehavior(string username, string password)
    {
        this.Username = username;
        this.Password = password;
    }

    #region IEndpointBehavior Members

    public void AddBindingParameters(ServiceEndpoint endpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
    {
        throw new NotImplementedException();
    }

    public void ApplyClientBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.ClientRuntime clientRuntime)
    {
        clientRuntime.MessageInspectors.Add(new PasswordDigestMessageInspector(this.Username, this.Password);
    }

    public void ApplyDispatchBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.EndpointDispatcher endpointDispatcher)
    {
        throw new NotImplementedException();
    }

    public void Validate(ServiceEndpoint endpoint)
    {
        throw new NotImplementedException();
    }

    #endregion
}
&lt;/pre&gt;&lt;br /&gt;
&lt;h2&gt;An example WSDL&lt;/h2&gt;&lt;div&gt;We can now apply this behavior to our client proxy. To provide you with an adequate example, I have modified the example &lt;a href="http://oreilly.com/catalog/webservess/chapter/ch06.html"&gt;Hello World example WSDL&lt;/a&gt; provided by O'Reilly's Web Service Essentials. I have added the necessary extensions to require the security token. Our WSDL now looks like this:&lt;/div&gt;&lt;pre class="prettyprint"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;definitions xmlns:tns="http://www.acme.co.uk/wsdl/HelloService.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloService" targetNamespace="http://www.acme.co.uk/wsdl/HelloService.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/"&amp;gt;
  &amp;lt;types&amp;gt;
    &amp;lt;xsd:schema&amp;gt;
      &amp;lt;xsd:import schemaLocation="oasis-200401-wss-wssecurity-secext-1.0.xsd" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" /&amp;gt;
    &amp;lt;/xsd:schema&amp;gt;
  &amp;lt;/types&amp;gt;
  &amp;lt;message name="SecurityHeader"&amp;gt;
    &amp;lt;part name="header" element="wsse:Security" /&amp;gt;
  &amp;lt;/message&amp;gt;
  &amp;lt;message name="SayHelloRequest"&amp;gt;
    &amp;lt;part name="firstName" type="xsd:string" /&amp;gt;
  &amp;lt;/message&amp;gt;
  &amp;lt;message name="SayHelloResponse"&amp;gt;
    &amp;lt;part name="greeting" type="xsd:string" /&amp;gt;
  &amp;lt;/message&amp;gt;
  &amp;lt;portType name="Hello_PortType"&amp;gt;
    &amp;lt;operation name="sayHello"&amp;gt;
      &amp;lt;input message="tns:SayHelloRequest" /&amp;gt;
      &amp;lt;output message="tns:SayHelloResponse" /&amp;gt;
    &amp;lt;/operation&amp;gt;
  &amp;lt;/portType&amp;gt;
  &amp;lt;binding name="Hello_Binding" type="tns:Hello_PortType"&amp;gt;
    &amp;lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /&amp;gt;
    &amp;lt;operation name="sayHello"&amp;gt;
      &amp;lt;soap:operation /&amp;gt;
      &amp;lt;input&amp;gt;
        &amp;lt;soap:header message="tns:SecurityHeader" part="header" use="literal" namespace="urn:examples:helloservice" /&amp;gt;
        &amp;lt;soap:body use="literal" namespace="urn:examples:helloservice" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;output&amp;gt;
        &amp;lt;soap:body use="literal" namespace="urn:examples:helloservice" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /&amp;gt;
      &amp;lt;/output&amp;gt;
    &amp;lt;/operation&amp;gt;
  &amp;lt;/binding&amp;gt;
  &amp;lt;service name="Hello_Service"&amp;gt;
    &amp;lt;documentation&amp;gt;WSDL File for HelloService&amp;lt;/documentation&amp;gt;
    &amp;lt;port name="Hello_Port" binding="tns:Hello_Binding"&amp;gt;
      &amp;lt;soap:address location="http://www.acme.co.uk/axis2/HelloService" /&amp;gt;
    &amp;lt;/port&amp;gt;
  &amp;lt;/service&amp;gt;
&amp;lt;/definitions&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;h2&gt;Generating the client proxy&lt;/h2&gt;&lt;div&gt;The next step is to generate our client proxy classes. The easiest way to do that is to use &lt;a href="http://msdn.microsoft.com/en-us/library/aa347733.aspx"&gt;SvcUtil.exe&lt;/a&gt;. You can just &lt;a href="http://msdn.microsoft.com/en-us/library/bb628652.aspx"&gt;add a Service Reference&lt;/a&gt; and link directly to the WSDL in your project as the source WSDL, or alternatively, you can create a BAT file and execute SvcUtil.exe with the required parameters from a Visual Studio command prompt. I will choose the latter:&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;svcutil /t:code /out:Client.cs /n:*,Turnstile.Amce.v1 *.wsdl *.xsd /config:Client.config
&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;Please be aware that you need local copies of all related schemas on your local file system, and they must be located in the same directly as the WSDL. SvcUtil will not download and navigate remote schema locations for you. At a minimum, you should expect to have the following files in your directory:&lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;oasis-200401-wss-wssecurity-secext-1.0.xsd&lt;/li&gt;
&lt;li&gt;oasis-200401-wss-wssecurity-utility-1.0.xsd&lt;/li&gt;
&lt;li&gt;xml.xsd&lt;/li&gt;
&lt;li&gt;xmldsig-core-schema.xsd&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div&gt;Add a Service Reference works in a similar way, downloading the files for you and changing the internal references to remote XSDs to those within the download directory, before finally executing SvcUtil.exe. However, should you wish to run SvcUtil outside the standard parameters (e.g. namespace changes and the very useful switch &lt;a href="http://msdn.microsoft.com/en-us/library/cc681334.aspx"&gt;UseSerializerForFaults&lt;/a&gt;, then you will need to go through the manual process.&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;Adding the custom behavior&lt;/h2&gt;&lt;div&gt;Now you have a project that contains all of the required code ready to connect to the web service described in the WSDL. We will imagine that we have another project which needs to connect to this web service using the client proxy that we have just generated. We will create a new Message Processing application (Windows Console application, or class library) that will create an instance of the client proxy and execute the SayHello method. I'm going to use a class library, so that it can be used in lots of different applications. After adding the new class library to the solution, I add a reference to the Turnstile project containing the generated client proxy code, and a reference to &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.aspx"&gt;System.ServiceModel&lt;/a&gt;. A new Processor class is added with the following code to execute the sayHello() method.&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;public class Processor
{
    public string SendHello(string firstName)
    {
        // Instance of our Client Proxy
        Hello_PortTypeClient client = new Hello_PortTypeClient("Hello_Binding");

        // Add our custom behavior
        PasswordDigestBehavior behavior = new PasswordDigestBehavior("Username", "Password");
        client.Endpoint.Behaviors.Add(behavior);

        // Say hello
        return client.sayHello(null, firstName);
    }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;h2&gt;Evaluating the output&lt;/h2&gt;&lt;div&gt;If you were to switch on &lt;a href="http://msdn.microsoft.com/en-us/library/ms730064.aspx"&gt;message tracing and logging&lt;/a&gt; on your proxy client service calls, you would now see the following output:&lt;/div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;s:Header&amp;gt;
&amp;lt;Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&amp;gt;
&amp;lt;wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-d8f58af7-527e-4157-8605-8c13576973ef" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&amp;gt;
&amp;lt;wsse:Username&amp;gt;
&amp;lt;!-- Removed--&amp;gt;
&amp;lt;/wsse:Username&amp;gt;
&amp;lt;wsse:Password&amp;gt;
&amp;lt;!-- Removed--&amp;gt;
&amp;lt;/wsse:Password&amp;gt;
&amp;lt;wsse:Nonce&amp;gt;
&amp;lt;!-- Removed--&amp;gt;
&amp;lt;/wsse:Nonce&amp;gt;
&amp;lt;wsu:Created&amp;gt;2015-11-15T13:57:20Z&amp;lt;/wsu:Created&amp;gt;
&amp;lt;/wsse:UsernameToken&amp;gt;
&amp;lt;/Security&amp;gt;
&amp;lt;Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&amp;gt;https://www.acme.co.uk/axis2/services/CreditAccountProvider&amp;lt;/Action&amp;gt;
&amp;lt;/s:Header&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;div&gt;With a little bit of work, the extensibility offered by WCF means that we can deliver .NET based client proxies to any web services that use SOAP regardless of the technology stack being used by the third party to implement their web service.&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;About the author&lt;/h2&gt;&lt;div&gt;Ben Powell is Microsoft .NET developer providing innovative solutions to common business to business integration problems. He has worked on projects for companies such as Dell Computer Corp, Visteon, British Gas, BP Amoco and Aviva Plc. He can be found at &lt;a href="http://blog.benpowell.co.uk/"&gt;http://blog.benpowell.co.uk&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;Supporting downloads&lt;/h2&gt;&lt;div&gt;You can also &lt;a href="http://www.box.net/shared/ooom8db1i0"&gt;download&lt;/a&gt; this article as a PDF document. A demonstration of the code shown in this article can be found in a Visual Studio.NET 2008 solution, which is also available for &lt;a href="http://www.box.net/shared/lu3q83l6kr"&gt;download&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;Other resources&lt;/h2&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=juntocouk-21&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0596805489&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=juntocouk-21&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0470563141&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=juntocouk-21&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0596101627&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=juntocouk-21&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0321440064&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=juntocouk-21&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0596805500&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=juntocouk-21&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0672329484&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4157738486080855643?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-21T14:32:16.901+01:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/11/supporting-ws-i-basic-profile-password.html</feedburner:origLink></item><item><title>Umbraco gets active support from Microsoft [Video]</title><link>http://feedproxy.google.com/~r/benpowell/~3/rWrOhFwISW0/umbraco-gets-active-support-from.html</link><category>open source</category><category>cms</category><category>silverlight</category><category>umbraco</category><category>Microsoft</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 04:48:11 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-2866651709605823560</guid><description>Microsoft have decided to actively promote the open source CMS Umbraco. I'm a big fan of Umbraco and use it on several of my own websites. It runs on ASP.NET, is open source and has a great developer network to support it. This is one of the first times I've seen Microsoft look to actively push an open source project running on the .NET stack.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;The following is video that features some of my favourite Umbraco focused Twitterers including &lt;a href="http://darren-ferguson.com/"&gt;Darren Ferguson&lt;/a&gt;. They discuss a project which was funded by Microsoft that enabled them to enhance Umbraco installations with a Silverlight control for managing media within Umbraco.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="http://video.unrulymedia.com/wildfire_14996503.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
Please feel free to add your comments about the control if you have tried it out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-2866651709605823560?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T13:48:11.528+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/10/umbraco-gets-active-support-from.html</feedburner:origLink></item><item><title>How to remove malware and spyware from Windows</title><link>http://feedproxy.google.com/~r/benpowell/~3/uiUndSr0hoM/how-to-remove-malware-and-spyware-from.html</link><category>malware</category><category>technology</category><category>Linux</category><category>backup</category><category>reinstall</category><category>Apple</category><category>Microsoft</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 02:25:02 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-591828967714277615</guid><description>Due to my profession, friends and family turn to me when they have problems with their computers. 99% of the time, those problems are caused by malware. There are a number of tools that can help you to remove malware and I&amp;nbsp;utilize&amp;nbsp;the well known ones to help me get them back on their feet.&amp;nbsp;&lt;a href="http://www.malwarebytes.org/mbam.php"&gt;Malwarebytes' Anti-Malware&lt;/a&gt; is a great piece of software, as is &lt;a href="http://www.safer-networking.org/en/index.html"&gt;Spybot Search &amp;amp; Destro&lt;/a&gt;y, and &lt;a href="http://free.antivirus.com/hijackthis/"&gt;HijackThis&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
However, not getting malware in the first place is usually the best solution!&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
The internet is like a city. There are certain places in the city you don't wonder around at night. You wouldn't wonder around alone in&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Mogadishu"&gt;Mogadishu&lt;/a&gt;&amp;nbsp;during the day. If some dude walked up to you and said "ppssst, do you want some free [whatever]", would you follow him down the dark alley and then be surprised when you get mugged? Applying some basic common sense to wondering the breadths of internet is a simple task. The rules are relatively&amp;nbsp;similar&amp;nbsp;to real life. If it's free, you're not the customer, you're the product!&lt;br /&gt;
&lt;br /&gt;
When I remove malware from people's computers, I am taking a calculated risk in removing that malware using the tools provided. These tools provide no guarantee that the malware is completely gone, in the same way that your doctor makes to guarantee that the anti-biotics will actually work against the "bladder infection" you got at the party last week. There remains a chance that the tools I am using don't know about a new piece of malware, or have missed a variant of an existing malware program. They are not a panacea!&lt;br /&gt;
&lt;br /&gt;
In reality, the only way to remove malware from your machine is to re-install your operating system. Also remember that the arrogance to believe that &lt;a href="http://www.thexlab.com/faqs/malspyware.html"&gt;Macs&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Linux_malware"&gt;Linux&lt;/a&gt; don't attract malware is also idiotic. Windows, without doubt attracts more malware than anything other OS, but a well patched and up-to-date Windows system used well also has a good chance of staying clean.&lt;br /&gt;
&lt;br /&gt;
Re-installing your operating system is a chore that most of us do not relish. It is time consuming, and for most users it is a scary proposition because they have never done it before. Since talking my friends and family through re-installation over the phone, or via remote access is hell, I don't do it that often for other people. However, re-installation of your operating system isn't just for the removal of malware. It is a necessary cleansing process. It is something you need to learn!&lt;br /&gt;
&lt;br /&gt;
If I use the analogy of your bed-sheets; imagine sleeping in the same sheets for 3 years, brushing out the visible dead skin and hair periodically and thinking "oh yes, that will do - clean as a whistle"! The feeling of jumping into fresh clean bed-sheets is wonderful, and you should treat your computer in the same way.&lt;br /&gt;
&lt;br /&gt;
The truth is that general usage of your computer clogs it up, in the same way that regardless of how healthy we stay in life, eventually, most of us get some degree of arterial clogging by&amp;nbsp;cholesterol. We can't re-install our bodies (yet), but we can wash the sheets, buy a new mattress and we can re-install our operating system!&lt;br /&gt;
&lt;br /&gt;
Re-installing your operating system manually is a laborious process. To make life easier, use a disk imaging solution. There are a range of free options, including several Linux based ones on the &lt;a href="http://www.ultimatebootcd.com/"&gt;Ultimate Boot CD&lt;/a&gt; (UBCD), but my favourite, and one of the few pieces of software that I bought from a commercial vendor, rather than using an open source free version is &lt;a href="http://www.acronis.com/homecomputing/products/trueimage/index.html"&gt;Acronis True Image&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Imaging your drive for a quick re-install is like having a pristine made spare bed kept clean in plastic wrap. Manually re-installation is like throwing the old bed out, going to Ikea, buying a new bed, lugging the packages home, carrying the bits upstairs, unpacking it, building the bed and then finally making the bed ready to sleep in.&lt;br /&gt;
&lt;br /&gt;
The first time you re-install your operating system is sadly going to be the new Ikea bed option. Backup any files and settings you want to keep. Format the drive and installed the vanilla OS. Install the most up-to-date drivers for your hardware. Install ONE good anti-virus program. Download the most up-to-date Windows service pack and then run Windows Update. You can install other pieces of software that might save you time on the next re-install, such as Microsoft Office, but remember that the more you install before you image the drive, the more likely it is that your system will be compromised. Please note that only an idiot would install "that copy of Microsoft Office 2010 that John bought in a Bangkok market"....&lt;br /&gt;
&lt;br /&gt;
Once you are happy with your setup, image the drive. This is now your quick re-install option. Every time you need to re-install, you simply deploy that image over the existing installation (after backing up any personal files and settings beforehand). It is often a good idea to take an image at each stage of the install process. This can allow you re-install at any stage of the process. You'll be surprised how useful that can be.&lt;br /&gt;
&lt;br /&gt;
Your initial re-installation time is going to take hours. It might even take the full day, if you include the time it takes to backup everything you need before starting. You'll curse the fact that you saved files all over the place without a care in the world! Maybe next time you should even consider re-mapping My Documents to another partition (and therefore only re-installing the OS partition).&lt;br /&gt;
&lt;br /&gt;
Once the first re-installation is complete and you have you drive images, you can now sit back, with the knowledge that you have the possibility to re-install your machine, to a freshly made version, just as you like it, in a mere half an hour. Wonderful.&lt;br /&gt;
&lt;br /&gt;
Now test it. Try a re-install. You are going to feel a right idiot when you come to re-installing from that image and it doesn't work! Once you proved that the backup worked, you can copy your personal files back on to the machine.&lt;br /&gt;
&lt;br /&gt;
Now run a virus scan. Then rest easy...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-591828967714277615?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T11:25:02.264+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/09/how-to-remove-malware-and-spyware-from.html</feedburner:origLink></item><item><title>Howto: Flattr Widget for Blogger - The easy way</title><link>http://feedproxy.google.com/~r/benpowell/~3/ecBI_W0CdNg/howto-flattr-widget-for-blogger-easy.html</link><category>Blogger</category><category>widget</category><category>Flattr</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 08 Jul 2011 02:35:53 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4353183095370671309</guid><description>Flattr doesn't automatically add your content to its site. In other words, you need to list your content under your Flattr account (e.g. &lt;a href="http://blog.benpowell.co.uk/"&gt;my home page&lt;/a&gt;) and then you can link to that Flattr content (e.g. &lt;a href="https://flattr.com/thing/47613/Ben-Powells-blog-with-lots-of-helpful-tips"&gt;my Flattr entry for my home page&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
This is why you can't dynamically link the 'current page being viewed on your blog' to your flattr account. It needs to be to a specific Flattr url that you have previously created. If you try any of the current suggestions for integrating Flattr with Blogger, you'll notice that the Javascript generated button will probably show "Error" or "Inactive" rather than showing what you expected. That's because that content hasn't been linked on Flattr.&lt;br /&gt;
&lt;br /&gt;
I soon realised that Flattr expects you need to submit each piece of content individually. That means submitting each blog post manually. Rather than doing that, let's just link all of our blog posts to our Flattr home page and people can Flattr that instead.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Ideally you want to add one little piece of code to have a Flattr button appear across all of the pages on your Blogger based blog. The designer lets you do that, but lets make it even easier and make this a four step process:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Go to the &lt;a href="https://flattr.com/submit" target="_blank"&gt;Flattr submission page&lt;/a&gt; and enter the URL of your blogger website (i.e. http://yourblog.blogspot.com/). Complete the form as if you were submitting your blog generically.&lt;/li&gt;
&lt;li&gt;Grab the unique URL that Flattr generates for your blog. e.g.&amp;nbsp;&lt;a href="https://flattr.com/thing/47613/Ben-Powells-blog-with-lots-of-helpful-tips"&gt;https://flattr.com/thing/47613/Ben-Powells-blog-with-lots-of-helpful-tips&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Paste that URL below, click and rock and roll!&lt;/li&gt;
&lt;li&gt;Come back and don't forget to &lt;a href="https://flattr.com/thing/47613/Ben-Powells-blog-with-lots-of-helpful-tips"&gt;Flattr me&lt;/a&gt;!&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;fieldset&gt;&lt;br /&gt;
&lt;legend&gt;Easy Flattr widget for Blogger&lt;/legend&gt;&lt;script language="JavaScript"&gt;
function isWidgetValid() { var url = document.getElementById('FlattrUrl');var wc = document.getElementById('WidgetContent');if (url.value.length &gt; 0) { wc.value = wc.value.replace('###url###',url.value);return true; } else { alert('enter the url');return false;}}
&lt;/script&gt;&lt;br /&gt;
&lt;form action="http://www.blogger.com/add-widget" method="post" onsubmit="return isWidgetValid();" style="border: 0px; margin: 0px; padding: 0px;" target="_blank"&gt;&lt;input name="infoUrl" type="hidden" value="http://blog.benpowell.co.uk/2010/08/howto-flattr-widget-for-blogger-easy.html" /&gt;&lt;input name="logoUrl" type="hidden" value="http://www.gravatar.com/avatar/369a0d71cfcc16c913da6ae0d379ebce.png" /&gt;&lt;input name="widget.title" type="hidden" value="Flattr for Blogger" /&gt;&lt;label for="flattrurl"&gt;Your Flattr Url&lt;/label&gt;&lt;input id="FlattrUrl" name="FlattrUrl" size="50" type="text" /&gt;&lt;textarea id="WidgetContent" name="widget.content" style="display: none;"&gt;&amp;lt;div style=&amp;quot;position: absolute; top: 10px; left: -55px; z-index:999;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;#39;###url###&amp;#39;&amp;gt;&amp;lt;img src=&amp;#39;http://api.flattr.com/button/button-static-50x60.png&amp;#39; alt=&amp;#39;Flattr this&amp;#39; title=&amp;#39;Flattr this - widget provided by blog.benpowell.co.uk&amp;#39; border=&amp;#39;0&amp;#39; style=&amp;#39;border:0px;&amp;#39; /&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;http://blog.benpowell.co.uk/2010/08/howto-flattr-widget-for-blogger-easy.html&amp;quot;&amp;gt;Get it&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/textarea&gt;&lt;input name="widget.template" type="hidden" value="&amp;lt;data:content/&amp;gt;" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;input alt="Add widget" border="0" name="go" src="http://www.blogger.com/img/add/add2blogger_lg.gif" type="image" /&gt;&lt;/form&gt;&lt;/fieldset&gt;&lt;br /&gt;
&lt;h2&gt;Update:&lt;/h2&gt;&lt;p&gt;I've updated the widget so that it automatically appears alongside your posts (as you'll see on this website). You'll need to remove the widget title (leave empty). This will name the widget 'HTML/Javascript' and you can drag and drop it directly above your 'Blog Posts' section in the 'Page Elements' Designer as per this screenshot:&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-J0o_U4G7ybE/ThbJw6sTudI/AAAAAAAAATs/Rv3MhO7znTA/s1600/Blogger_Flatter_Widget.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="266" width="400" src="http://3.bp.blogspot.com/-J0o_U4G7ybE/ThbJw6sTudI/AAAAAAAAATs/Rv3MhO7znTA/s400/Blogger_Flatter_Widget.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4353183095370671309?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-08T11:35:53.485+02:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-J0o_U4G7ybE/ThbJw6sTudI/AAAAAAAAATs/Rv3MhO7znTA/s72-c/Blogger_Flatter_Widget.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/08/howto-flattr-widget-for-blogger-easy.html</feedburner:origLink></item><item><title>Can Germany win the World Cup 2010</title><link>http://feedproxy.google.com/~r/benpowell/~3/WJ4EH-JjUbs/can-germany-win-world-cup-2010.html</link><category>Germany</category><category>south africa</category><category>world cup</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 02:27:14 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-8310674979193798418</guid><description>I watched the Germany v Australia game live on German TV. Shortly before the game started, the usual German commentators rolled out an amazingly detailed analysis of the Australian style of play. They commented on how the German team should best beat their opposition. They noted the lack of Ozzie midfield play, kick-and-rush style, and stated that any German goals would come by forcing the strong Australian back four out of position on the counter-attack. Awesome graphics and everything!&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Löw and behold; 4 goals came and went and all by the system described by the commentators. As a Brit, I couldn't believe it. That's why Germany wins time and time again! A tried and tested system, determination and almost absolute self belief.&lt;br /&gt;
&lt;br /&gt;
And I thought football was all down to the tried-and-tested English system of a bit of slick passing, individual brilliance, prayers to the "no penalty shootout" gods, and bucket-loads of luck!&lt;br /&gt;
&lt;br /&gt;
The truth is that Germany still plays with the same ruthless systematic approach that they always have. To everyone else it appears to be a more open and flowing style, but in reality the style might have changed, but the system is still just as efficient and utterly devastating to teams that give them the space to play.&lt;br /&gt;
&lt;br /&gt;
I'm really looking forward to see how German can play against a real side. The kick-and-rush approach of the Ozzies was strikingly similar to the approach England played against the USA.&lt;br /&gt;
&lt;br /&gt;
I've had a season ticket at &lt;a href="http://en.wikipedia.org/wiki/SV_Werder_Bremen"&gt;Werder Bremen&lt;/a&gt; for the last year and watched &lt;a href="http://en.wikipedia.org/wiki/Mesut_%C3%96zil"&gt;Mesut Özil&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Marko_Marin"&gt;Marko Marin&lt;/a&gt; tear defences apart. However, I've also seen them play atrociously, especially Özil, who spent the majority of the winter months trotting half-heartily after the ball. It wasn't until the sun came out in the spring that he started playing well again (notably, Özil's other weakness is that he can't cross the ball consistently and Marko Marin crosses the ball consistently at his own "Tom Cruise" head height. i.e. 5'7").&lt;br /&gt;
&lt;br /&gt;
Also consider that Germany haven't let Stefan Kießling and Toni Kroos off the bench yet, and they have both been in devastating form this season in the Bundesliga, Kießling being number two goal scorer in the league (after Dzeko) this season.&lt;br /&gt;
&lt;br /&gt;
This really could be one hell of a World Cup for Germany who are already in 4th gear. England are still stuck in first gear and need to get cracking, but what do I care, I'm a Welsh.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-8310674979193798418?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T11:27:14.596+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/06/can-germany-win-world-cup-2010.html</feedburner:origLink></item><item><title>Multiple sites under a single Umbraco installation on Winhost.com</title><link>http://feedproxy.google.com/~r/benpowell/~3/3uCKPPCTUY8/multiple-sites-under-single-umbraco.html</link><category>sites</category><category>technology</category><category>domains</category><category>ASP.NET</category><category>umbraco</category><category>Winhost.com</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 02:27:34 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-5609255696372664009</guid><description>In part 1 of this series, I discussed the &lt;a href="http://blog.benpowell.co.uk/2010/05/umbraco-on-winhostcom-installation.html"&gt;installation of Umbraco on a Winhost.com basic account&lt;/a&gt;. Umbraco is a&amp;nbsp;&lt;a href="http://umbraco.org/"&gt;free and fully featured .NET based content management system&lt;/a&gt;.&amp;nbsp;This article continues where that article left off, and as promised, shows you how to install multiple sites (domains) under one Umbraco installation. This means that you can have different content sites under one &lt;a href="http://winhost.com/"&gt;Winhost.com&lt;/a&gt; account, without having to manage subdomain redirects to workaround Winhost's &lt;a href="http://blog.benpowell.co.uk/2010/02/winhostcom-how-to-really-run-multiple.html"&gt;lack of multi-site support&lt;/a&gt; under one account.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
This guide assumes that you have already setup Umbraco on your Winhost.com account. If you haven't, please follow that &lt;a href="http://blog.benpowell.co.uk/2010/05/umbraco-on-winhostcom-installation.html"&gt;guide&lt;/a&gt; first.&lt;br /&gt;
&lt;br /&gt;
Settings up Umbraco to support multiple sites is relatively easy. Connect to your existing installation via FTP, and navigate to the config directory. Open the umbracoSettings.config file and under the requestHandler section of the configuration file you will see a child node called useDomainPrefixes. Make sure this is set to true:&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;requestHandler&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;useDomainPrefixes&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;true&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;useDomainPrefixes&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;lt;!-- excluded for brevity --&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;requestHandler&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_9pCbQCJMujA/TAiNb-71vUI/AAAAAAAAAOo/1v_8V7i-2v8/s1600/Content_Hostnames.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_9pCbQCJMujA/TAiNb-71vUI/AAAAAAAAAOo/1v_8V7i-2v8/s320/Content_Hostnames.png" /&gt;&lt;/a&gt;Now login back into your Umbraco administration. Under the content section you'll have the default site installed with the Runway or Creative Website Starter Kit (CWS), which is my preference. The plan is to create a number of home pages for each site you plan to support, all linked out from that base Content root node.&lt;br /&gt;
&lt;br /&gt;
Add your first website. Name it sensibly, because you'll need to know what it is easily if you have a number of sites. Right click on the new home page you have added and click on &lt;b&gt;Manage Hostnames&lt;/b&gt;. Enter the &lt;b&gt;domain name&lt;/b&gt;, select the &lt;b&gt;language&lt;/b&gt; and click &lt;b&gt;Add new Domain&lt;/b&gt;. You can add multiple domains to a single content root node if you want, but normally you wouldn't want to or need to.&lt;br /&gt;
&lt;br /&gt;
Repeat this process to add all of your new root home pages for each site you want to support. Your Umbraco content section will look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9pCbQCJMujA/TAiNjsYfvXI/AAAAAAAAAOw/71SJ-Almjho/s1600/multi-site-umbraco.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_9pCbQCJMujA/TAiNjsYfvXI/AAAAAAAAAOw/71SJ-Almjho/s320/multi-site-umbraco.png" /&gt;&lt;/a&gt;&lt;/div&gt;Now you need to add the domain pointers to your Winhost account. Login to your Winhost.com control panel. Select to manage the appropriate site and click on &lt;b&gt;Domain Pointer&lt;/b&gt;. Add the new domain pointers you require, and enable the email alias if you need it. If your domains are not currently managed by Winhost.com, then you will need to login to your domain name registrars control panel and&lt;span id="goog_473881205"&gt;&lt;/span&gt; &lt;a href="https://support.winhost.com/KB/a507/general-winhost-dns-server-information.aspx"&gt;set the name servers to be the Winhost ones&lt;/a&gt;&lt;span id="goog_473881206"&gt;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
Now your domain names are pointed at the right name servers, that are in turn pointed at the right IP address, that in turn knows which directory to map to via the domain pointer and finally Umbraco knows which content to dispatch to the client based on the hostnames you have setup inside Umbraco.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to visit each domain and see the different home pages you have setup under Umbraco.&lt;br /&gt;
&lt;br /&gt;
You'll notice that all of your sites have the same design template. If you installed CWS then every site will have that rather slick grey / pink theme, but what you really want is different themes for each site.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9pCbQCJMujA/TAiN245r5vI/AAAAAAAAAO4/7H1Ngz31DM0/s1600/Settings_Templates.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_9pCbQCJMujA/TAiN245r5vI/AAAAAAAAAO4/7H1Ngz31DM0/s320/Settings_Templates.png" /&gt;&lt;/a&gt;&lt;/div&gt;To get this to work you need to understand the Umbraco concepts of &lt;b&gt;Templates&lt;/b&gt;, &lt;b&gt;Document Types&lt;/b&gt; and &lt;b&gt;CSS Stylesheets&lt;/b&gt;. Templates are rather standard .NET master and content pages with bits of Umbraco focused controls thrown in. For each different theme you require, you'll need to create a master, and the associated content pages under the &lt;b&gt;Settings - Templates&lt;/b&gt; node. The current CWS Master and child pages would be a good place to start.&lt;br /&gt;
&lt;br /&gt;
Once you have your Master and child templates created, then you'll need to focus your attention on the &lt;b&gt;Document Types&lt;/b&gt;. CWS will have installed a bunch of &lt;b&gt;Document Types&lt;/b&gt; for you. Each will be using the template from the CWS installed templates. I highly suggest that you start to create your new &lt;b&gt;Templates&lt;/b&gt; and &lt;b&gt;Document Types&lt;/b&gt;, following the CWS convention, but prefixed by the theme name you are creating, otherwise you are going to end up with multiple Home Document Types and go quite quickly insane. The example here shows &lt;b&gt;1-Master&lt;/b&gt; and &lt;b&gt;1-Home&lt;/b&gt;, relating to &lt;b&gt;Theme 1&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Once you have got your &lt;b&gt;Templates&lt;/b&gt; and &lt;b&gt;Document Types&lt;/b&gt; setup for each theme, then you can change the Content home pages to use the new Template themes under the &lt;b&gt;Properties&lt;/b&gt; tab of the content editor.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-5609255696372664009?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T11:27:34.508+02:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_9pCbQCJMujA/TAiNb-71vUI/AAAAAAAAAOo/1v_8V7i-2v8/s72-c/Content_Hostnames.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/06/multiple-sites-under-single-umbraco.html</feedburner:origLink></item><item><title>Prepare to delete your Times Online bookmarks</title><link>http://feedproxy.google.com/~r/benpowell/~3/oGtpyF6i1gQ/prepare-to-delete-your-times-online.html</link><category>News</category><category>Subscriptions</category><category>Guardian</category><category>Times Online</category><category>BBC</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 02:28:01 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-5726413343313133432</guid><description>I quite enjoy the &lt;a href="http://www.timesonline.co.uk/"&gt;Times Online&lt;/a&gt;, but not enough to &lt;a href="http://news.bbc.co.uk/2/hi/8588432.stm"&gt;pay for it&lt;/a&gt;. Wrong business model Rupert. Move along.&lt;br /&gt;
&lt;br /&gt;
The Times Online main website is now starting to (confusingly) cross-link its new subscription only content from its free website. They are even deep-linking to subscription content from the main front page.&lt;br /&gt;
&lt;br /&gt;
Luckily, you can still signup for a temporary preview. If you already have account with the Times Online website then you probably won't mind signing up with their new site, but who knows how long the access will last? The terms and conditions state that access can be terminated at any time.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Before you think about signing up for their "&lt;a href="http://www.timesplus.co.uk/welcome/index.htm"&gt;Exclusive Preview&lt;/a&gt;", be aware that neither the Times Online or Times Plus websites offer you an easy way to cancel or remove your account. The only option available to existing account holders is to contact customer services, or if you want to do it yourself, set your name, email address and contact details to something invalid, before departing for pastures greener and freer.&lt;br /&gt;
&lt;br /&gt;
At the point the Times Online starts charging I'll be terminating my "contract", by deleting my account and deleting the prominent bookmark bar entry (that the Times Online had earned). The&amp;nbsp;&lt;a href="http://news.bbc.co.uk/"&gt;free BBC News&lt;/a&gt; and &lt;a href="http://www.guardian.co.uk/"&gt;free Guardian&lt;/a&gt;&amp;nbsp;new content sites will remain my two primary news sources.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-5726413343313133432?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T11:28:01.114+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/06/prepare-to-delete-your-times-online.html</feedburner:origLink></item><item><title>Umbraco on Winhost.com - Installation Guide</title><link>http://feedproxy.google.com/~r/benpowell/~3/OXFrGn_kHno/umbraco-on-winhostcom-installation.html</link><category>technology</category><category>ASP.NET</category><category>umbraco</category><category>Winhost.com</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 02:28:15 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-3155852648440214307</guid><description>I recently installed &lt;a href="http://umbraco.org/"&gt;Umbraco&lt;/a&gt; (4.0.3) on one of my Winhost accounts as part of my move from Webhost4life.com to &lt;a href="http://winhost.com/"&gt;Winhost.com&lt;/a&gt;. I ran into a few problems, so I thought I would post a short guide to help others.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
If you don't know what the Umbraco content management system is, then have a &lt;a href="http://umbraco.org/tour"&gt;read about Umbraco.&lt;/a&gt;&amp;nbsp;It is becoming a &lt;a href="http://www.jobserve.co.uk/JobListing.aspx?shid=CFC4FA4A438E3229F8"&gt;highly desired skill on ASP.NET developer CVs&lt;/a&gt; as well. The learning curve is steep but relatively short. I highly recommend it as a CMS.&lt;br /&gt;
&lt;br /&gt;
To install Umbraco on Winhost.com you need to follow these steps carefully:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open a new &lt;a href="http://www.winhost.com/windows-hosting-plans.aspx"&gt;Basic or Max&lt;/a&gt; plan with Winhost.com. You will need to install Umbraco in the application root. You cannot install it in a virtual or subdirectory. I installed it on a Basic plan.&lt;/li&gt;
&lt;li&gt;Create a new database using the &lt;b&gt;Site Manager&lt;/b&gt; - &lt;b&gt;MS SQL 2008&lt;/b&gt;. At the end of the process you'll have a connection string displayed to you if you click on &lt;b&gt;Manage&lt;/b&gt;. Make a note of it.&lt;/li&gt;
&lt;li&gt;Download the &lt;a href="http://umbraco.codeplex.com/releases/view/33743"&gt;latest version of Umbraco from Codeplex.com&lt;/a&gt;. Unzip the files into a folder on your hard drive.&lt;/li&gt;
&lt;li&gt;Download the suggested 3.5 &lt;a href="http://umbraco.codeplex.com/releases/view/33743#DownloadId=95708"&gt;web.config&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Copy this web.config over the existing one in the unzipped Umbraco folder. Open it is notepad, because you need to edit it.&lt;/li&gt;
&lt;li&gt;Remove the &lt;b&gt;ConnectionStrings&lt;/b&gt; section that Niel Hartvig has left in for testing.&lt;/li&gt;
&lt;li&gt;Remove the associated &lt;b&gt;MembershipProvider&lt;/b&gt; key (&lt;b&gt;AspNetSqlMemberShipProvider&lt;/b&gt;) in the &lt;b&gt;Membership&lt;/b&gt; - &lt;b&gt;Providers&lt;/b&gt; section.&lt;/li&gt;
&lt;li&gt;The &lt;b&gt;Trust&lt;/b&gt; level &lt;b&gt;is currently commented out&lt;/b&gt;. Change it from Medium to &lt;b&gt;Full &lt;/b&gt;and &lt;b&gt;uncomment the line&lt;/b&gt;. See &lt;b&gt;System.Web&lt;/b&gt; - &lt;b&gt;Trust&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;b&gt;Compilation&lt;/b&gt; set &lt;b&gt;Debug&lt;/b&gt; to false&lt;/li&gt;
&lt;li&gt;Disable &lt;b&gt;Tracing&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Do not change the SQL connection for the time being. You can do that in the install process.&lt;/li&gt;
&lt;li&gt;Save the web.config file.&lt;/li&gt;
&lt;li&gt;If you want to run multiple domains/sites under Umbraco, open the &lt;b&gt;config/umbracoSettings.config&lt;/b&gt; and change the&amp;nbsp;&lt;b&gt;useDomainPrefixes&lt;/b&gt; to true (under &lt;b&gt;requestHandler&lt;/b&gt;).&lt;/li&gt;
&lt;li&gt;Now copy all of the files to your hosting account (to the root) using FTP.&lt;/li&gt;
&lt;li&gt;Open your website in your browser. You should be directed to the Umbraco install screen. http://yoursite.com/umbraco/&lt;/li&gt;
&lt;li&gt;Agree to the terms and conditions&lt;/li&gt;
&lt;li&gt;Enter your database connection details and click &lt;b&gt;Confirm&lt;/b&gt;.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;If the database connection works then you can click on &lt;b&gt;Install&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Next check the permissions. Under full trust everything should work. If it doesn't, check the web.config again to make sure that you did actually uncomment the line as well as editing it!&lt;/li&gt;
&lt;li&gt;After the permissions have been checked and everything is ok, click &lt;b&gt;Continue&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Enter the administrative password&lt;/li&gt;
&lt;li&gt;Optionally install Runway. Note that you can always install Runway and the different modules easily later. I advise you don't install it now.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
I would advise you to check out the &lt;a href="http://our.umbraco.org/projects/creative-website-starter-(cws)"&gt;Creative Website Starter Kit&lt;/a&gt; (CWS) package first, as it gets you up and running quicker. Runway is just a bit daunting as a blank canvas to get started. Within the Umbraco administration for your website, you can go to &lt;b&gt;Developer &lt;/b&gt;- &lt;b&gt;Umbraco Package Repository&lt;/b&gt; - &lt;b&gt;Starter Kits&lt;/b&gt; and install it directly from there.&lt;br /&gt;
&lt;br /&gt;
You should now have installed Umbraco. Congratulations! Next time I'll write about how you configure multiple domains/ sites in Umbraco on Winhost.com.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-3155852648440214307?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T11:28:15.813+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/05/umbraco-on-winhostcom-installation.html</feedburner:origLink></item><item><title>SOLVED: SFC asks for SP3 on your Dell</title><link>http://feedproxy.google.com/~r/benpowell/~3/ZP1-2-_nXvI/solved-sfc-asks-for-sp3-on-your-dell.html</link><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 02:28:30 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-8284532340591744789</guid><description>&lt;a href="http://support.microsoft.com/kb/310747"&gt;SFC&lt;/a&gt; checks your existing files to make sure they are the original Microsoft versions. However, since most people will have now installed Windows XP Service Pack 3 (SP3), you may run into a problem when either the Windows XP installation or recovery CD/DVD, or the I386 folder on your machine (e.g. Dell sticks it on c:\I386) are the SP2 versions. The root cause is that SFC will not copy older service pack files over newer service pack versions.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
My Dell has an C:\I386 folder and the solution was&amp;nbsp;to go and get the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5B33B5A8-5E76-401F-BE08-1E1555D4F3D4&amp;amp;displaylang=en"&gt;Windows XP Service Pack 3 Network Installation Package for IT Professionals and Developers&lt;/a&gt;&amp;nbsp;so that I could slipstream the existing I386 assemblies with the SP3 ones. If you do not have an I386 folder then put your Dell Recovery CD in the drive and Explore it. copy the I386 folder and all its contents to your C:\ drive.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Download the file to your C:\ drive.&lt;/li&gt;
&lt;li&gt;Rename the file to XPSP3.exe&lt;/li&gt;
&lt;li&gt;Win + R, or Start -&amp;gt; Run and type:&amp;nbsp;XPSP3.exe&amp;nbsp;-u -s:c:\&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
This will now extract and slipstream your I386 folder.&lt;br /&gt;
&lt;br /&gt;
Now when you run SFC your machine should pick up the correct files and stop complaining. If you machine appears to be looking for the files from a CD/DVD drive then you can change the source path to your I386 folder using the Registry Editor:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\&lt;/li&gt;
&lt;li&gt;Set SourcePath as C:\&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Good luck&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-8284532340591744789?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T11:28:30.074+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/05/solved-sfc-asks-for-sp3-on-your-dell.html</feedburner:origLink></item><item><title>The Ultimate walkthrough guide to Facebook privacy</title><link>http://feedproxy.google.com/~r/benpowell/~3/PbXb8kSR9t0/ultimate-walkthrough-guide-to-facebook.html</link><category>facebook</category><category>privacy</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 02:29:09 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4277176133516985464</guid><description>Facebook wants you to believe that your information is private and that it doesn't share anything that you haven't agreed to with third parties. However, these settings aren't always easy to find, and they aren't always switched on by default. Facebook's business is to get you to share as much as possible, especially with their advertisers, so here is your handy guide to setting up Facebook so that your privacy is as tight as a duck ass.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Please note that this privacy guide may not be for you. With increased privacy, you may have to give up some functionality, including applications, which are the backdoor to your proverbial duck's ass. Do not trust third party applications with your privacy. They see you only as +1 to their total user base. Treat Facebook themselves with that same disrespect. They do not have your best interests at heart. You would be wise to remember this fact. If anything breaks or your lose any data, don't blame me. I accept no liability.&lt;br /&gt;
&lt;br /&gt;
First of all, you should understand Facebook's standard options with regards to privacy. They are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Everyone&lt;/li&gt;
&lt;li&gt;Friends of Friends&lt;/li&gt;
&lt;li&gt;Only Friends&lt;/li&gt;
&lt;li&gt;Customize&lt;/li&gt;
&lt;/ul&gt;In the majority of cases the hardcore fuck-you-Facebook option is hidden under &lt;b&gt;Customize&lt;/b&gt;. So for each and every case you can find in your &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;ref=mb"&gt;Privacy&lt;/a&gt;&lt;/b&gt; settings, you need to choose &lt;b&gt;Customize&lt;/b&gt; and then select &lt;b&gt;Only Me&lt;/b&gt;. We aim to hide everything first, then after everything is tied down, we'll choose to share the things we really want to share.&lt;br /&gt;
&lt;br /&gt;
So, lets get stuck in. Go to the default &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;ref=mb"&gt;Privacy&lt;/a&gt;&lt;/b&gt; screen under &lt;b&gt;&lt;a href="https://register.facebook.com/editaccount.php?ref=mb&amp;amp;drop"&gt;Account&lt;/a&gt;&lt;/b&gt;. It is split into several key areas as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9pCbQCJMujA/S975gNpfY_I/AAAAAAAAAMk/Q_9WE1Ls3Xs/s1600/default_privacy.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="213" src="http://4.bp.blogspot.com/_9pCbQCJMujA/S975gNpfY_I/AAAAAAAAAMk/Q_9WE1Ls3Xs/s400/default_privacy.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Select &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;section=personal_content"&gt;Personal information and posts&lt;/a&gt;:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9pCbQCJMujA/S975oHo6zdI/AAAAAAAAAMs/-XwIxx0UjO4/s1600/default_personal_info.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/_9pCbQCJMujA/S975oHo6zdI/AAAAAAAAAMs/-XwIxx0UjO4/s400/default_personal_info.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Set everything to &lt;b&gt;Customize - Only Me&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
With regards to &lt;a href="http://www.facebook.com/privacy/?view=photos"&gt;Photo albums&lt;/a&gt;&amp;nbsp;privacy, set each album to&lt;b&gt; Customize - Only me&lt;/b&gt;. I actually deleted all of my photos on Facebook apart for the one single default profile photo (that you are "required" to have as a genuine photo). &amp;nbsp;I do not trust Facebook with my photos. There are better and more open and transparent photo sharing methods on the internet.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9pCbQCJMujA/S975tziMYGI/AAAAAAAAAM0/2pz5OKe7eyo/s1600/default_photo_albums.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="141" src="http://4.bp.blogspot.com/_9pCbQCJMujA/S975tziMYGI/AAAAAAAAAM0/2pz5OKe7eyo/s400/default_photo_albums.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy"&gt;Privacy&lt;/a&gt;&lt;/b&gt; and select &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;section=contact"&gt;Contact Information&lt;/a&gt;&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9pCbQCJMujA/S9751WiB0CI/AAAAAAAAAM8/psRmuGf9O1Q/s1600/default_privacy_contact.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://3.bp.blogspot.com/_9pCbQCJMujA/S9751WiB0CI/AAAAAAAAAM8/psRmuGf9O1Q/s400/default_privacy_contact.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Set everything to &lt;b&gt;Customize - Only me&lt;/b&gt;. &lt;b&gt;Add me as a friend&lt;/b&gt; can only be set to &lt;b&gt;Friends of Friends&lt;/b&gt; and &lt;b&gt;Send me a message&lt;/b&gt; should be set to &lt;b&gt;Only friends&lt;/b&gt;. If you have been on Facebook for a while these options will probably suffice. Everyone you know is probably already a friend, or at a minimum a friend of a friend. If you really want to leave that ex-girlfriend from university find you and send you an email, then leave the &lt;b&gt;Send me a message&lt;/b&gt; open. However, you would be wise to remember that you dumped her in the first place because she was a psycho bunny boiler!&lt;br /&gt;
&lt;br /&gt;
Go back to &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy"&gt;Privacy&lt;/a&gt;&lt;/b&gt; and select &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;section=profile_display"&gt;Friends, tags and connections&lt;/a&gt;&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9pCbQCJMujA/S971gkYeE5I/AAAAAAAAALk/fKug_zpK-qY/s1600/default_privacy_friends.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="272" src="http://1.bp.blogspot.com/_9pCbQCJMujA/S971gkYeE5I/AAAAAAAAALk/fKug_zpK-qY/s400/default_privacy_friends.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Set every option to &lt;b&gt;Customize - Only Me&lt;/b&gt;. This will stop any embarrassing photos of you being tagged, any relationship blunders, and friends seeing your list of friends (you might not always want to share this).&lt;br /&gt;
&lt;br /&gt;
Go back to &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy"&gt;Privacy&lt;/a&gt;&lt;/b&gt; and select &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;section=applications"&gt;Applications and Websites&lt;/a&gt;&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9pCbQCJMujA/S972YqTRs1I/AAAAAAAAAL0/avEdrsgRYMM/s1600/default_applications.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="216" src="http://4.bp.blogspot.com/_9pCbQCJMujA/S972YqTRs1I/AAAAAAAAAL0/avEdrsgRYMM/s400/default_applications.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This isn't so simple as setting everything to lock down. You have to dig around a bit. Go through one option at a time. Whilst on this screen lock down &lt;b&gt;Activity on applications and games dashboards&lt;/b&gt; to &lt;b&gt;Customize - Only Me&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Select &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;section=applications&amp;amp;field=friends_share"&gt;What your friends can share about you - Edit settings&lt;/a&gt;&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9pCbQCJMujA/S971qomWAdI/AAAAAAAAALs/CSc43RqUnQo/s1600/default_privacy_applications_websites.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="270" src="http://1.bp.blogspot.com/_9pCbQCJMujA/S971qomWAdI/AAAAAAAAALs/CSc43RqUnQo/s400/default_privacy_applications_websites.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Uncheck every single option. This stops your friends giving access to your information to third party applications. Do you hate Farmville? If any of these options are checked, then your friend that plays Farmville daily can share your information with Farmville, even if you haven't authorised Farmville. Scrub the lot!&lt;br /&gt;
&lt;br /&gt;
Go back to the &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy"&gt;Privacy&lt;/a&gt; &lt;/b&gt;and select&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;section=applications"&gt;Applications and websites&lt;/a&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;. Then s&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;elect &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;section=applications&amp;amp;field=instant_personalization"&gt;Instant Personalization Pilot Program - Edit Setting&lt;/a&gt;&lt;/b&gt;:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9pCbQCJMujA/S975_-nrJhI/AAAAAAAAANE/yHTGf32szbo/s1600/default_privacy_pull_my_pants_down.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="196" src="http://3.bp.blogspot.com/_9pCbQCJMujA/S975_-nrJhI/AAAAAAAAANE/yHTGf32szbo/s400/default_privacy_pull_my_pants_down.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure the box is unchecked!&lt;br /&gt;
&lt;br /&gt;
Go back to &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy"&gt;Privacy&lt;/a&gt;&lt;/b&gt; and select &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;section=search"&gt;Search&lt;/a&gt;:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9pCbQCJMujA/S976E5rMJNI/AAAAAAAAANM/KRiw5dDA9Ak/s1600/default_privacy_search.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="115" src="http://4.bp.blogspot.com/_9pCbQCJMujA/S976E5rMJNI/AAAAAAAAANM/KRiw5dDA9Ak/s400/default_privacy_search.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Set &lt;b&gt;Facebook search results&lt;/b&gt; to &lt;b&gt;Customize - Only friend&lt;/b&gt;s.&amp;nbsp;Uncheck &lt;b&gt;Public search results&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Now the main privacy options are looking good. Now under &lt;b&gt;&lt;a href="https://register.facebook.com/editaccount.php?ref=mb&amp;amp;drop"&gt;Account&lt;/a&gt;&lt;/b&gt; go to &lt;b&gt;&lt;a href="http://www.facebook.com/editapps.php?ref=mb"&gt;Application settings&lt;/a&gt;&lt;/b&gt;. If you are smart (paranoid) about your privacy you will have deleted all of the applications you can. Some of Facebook's own applications cannot be removed. However, we can lock them down.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9pCbQCJMujA/S976J5hrTiI/AAAAAAAAANU/X31F0S1w66A/s1600/default_application_settings_popup.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="166" src="http://3.bp.blogspot.com/_9pCbQCJMujA/S976J5hrTiI/AAAAAAAAANU/X31F0S1w66A/s400/default_application_settings_popup.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each application click on &lt;b&gt;Edit Settings&lt;/b&gt;. Under the &lt;b&gt;Profile&lt;/b&gt; tab remove the &lt;b&gt;Box&lt;/b&gt; and &lt;b&gt;Tab&lt;/b&gt; options, and then set the &lt;b&gt;Privacy&lt;/b&gt; to &lt;b&gt;Customize - Only Me&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Throughout this process Facebook provides a helpful tool that shows you what your profile looks like to other people. Note the &lt;b&gt;Preview My Profile&lt;/b&gt; button shown top right whilst within the privacy settings. You can enter a friend's name to see what your profile looks like to them. Otherwise your profile is shown as it would be seen by any non-friend from a search result or linked from a wall comment or "like". As a side note, the actual default profile used to do the profile check is a user called &lt;b&gt;&lt;a href="http://www.facebook.com/profile.php?id=100000686899395"&gt;Everyone&lt;/a&gt;&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9pCbQCJMujA/S976O8QT49I/AAAAAAAAANc/doMnLX0DBio/s1600/default_privacy_checker.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" src="http://3.bp.blogspot.com/_9pCbQCJMujA/S976O8QT49I/AAAAAAAAANc/doMnLX0DBio/s400/default_privacy_checker.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you profile and information is secure (until Facebook adds a new feature). I deleted everything except for my wall. No photos, videos, links, notes, about me, work experience, current location, religious views, etc.&lt;br /&gt;
&lt;br /&gt;
Now, to make Facebook somewhat a fun experience, you don't want to leave your settings like this. Sometimes you want to update your status and allow friends to comment on it. To re-enable this, go to &lt;b&gt;&lt;a href="http://www.facebook.com/settings/?tab=privacy"&gt;Privacy&lt;/a&gt; - &lt;a href="http://www.facebook.com/settings/?tab=privacy&amp;amp;section=personal_content"&gt;Personal information and posts&lt;/a&gt;&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9pCbQCJMujA/S976VqrILPI/AAAAAAAAANk/ziV1zN4lN9U/s1600/after_personal.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="237" src="http://3.bp.blogspot.com/_9pCbQCJMujA/S976VqrILPI/AAAAAAAAANk/ziV1zN4lN9U/s400/after_personal.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Set &lt;b&gt;Posts by me&lt;/b&gt; and &lt;b&gt;Comments on posts&lt;/b&gt; to &lt;b&gt;Only friends&lt;/b&gt;. You can optionally&lt;b&gt; allow friends to write on your wall&lt;/b&gt;, although your mate Johnny writing "god you were drunk last night" isn't ideal to share with all your friends. Remember that you are opening a backdoor here. If you write a status update or upload a photo that was only destined for your friends, but one of those friends has their wall shared with &lt;b&gt;Everyone&lt;/b&gt;, then &lt;b&gt;anyone &lt;/b&gt;can see the link to your photos or update.&lt;br /&gt;
&lt;br /&gt;
So, you are finished for now. Keep checking through the privacy options every few weeks. Facebook often adds new features, and you need to tighten up the default options when they do so. They don't do it for you!&lt;br /&gt;
&lt;br /&gt;
Happy Facebooking...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4277176133516985464?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T11:29:09.288+02:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_9pCbQCJMujA/S975gNpfY_I/AAAAAAAAAMk/Q_9WE1Ls3Xs/s72-c/default_privacy.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/05/ultimate-walkthrough-guide-to-facebook.html</feedburner:origLink></item><item><title>ASP.NET Tip: If your DropDownList items are lost on postback</title><link>http://feedproxy.google.com/~r/benpowell/~3/hjLU6P4qRpY/aspnet-tip-if-your-dropdownlist-items.html</link><category>technology</category><category>ASP.NET</category><author>noreply@blogger.com (Ben)</author><pubDate>Wed, 28 Apr 2010 12:55:30 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4282189988503089060</guid><description>This might seem obvious but it had me stumped for a while. Most ASP.NET programmers should know that if you set EnableViewState to false on a DropDownList, the items that were bound to that control will not be persisted on postback. What you might forget (as I did) is that if your DropDownList (or any other DataBound control for that matter) is held within another control (such as a Panel) that has viewstate disabled, then it also applied to anything contained within that control.&lt;br /&gt;
&lt;br /&gt;
I added a DevExpress Panel to my MasterPage surrounding a ContentHolder, then wondered why none of my DropdownLists were working correctly.&lt;br /&gt;
&lt;br /&gt;
Mental note to myself this one....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4282189988503089060?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T21:55:30.041+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/04/aspnet-tip-if-your-dropdownlist-items.html</feedburner:origLink></item><item><title>Fixing the iPhone midnight reminders</title><link>http://feedproxy.google.com/~r/benpowell/~3/m2Jy-Ox8XM4/fixing-iphone-midnight-reminders.html</link><category>iPhone</category><category>Outlook</category><category>reminders</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 02:29:38 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4505484897707556340</guid><description>Anyone that syncs Microsoft Outlook with their iPhone will probably have experienced the midnight wake up, only to find that a work colleague is going on holiday, or someone has a birthday.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Outlook doesn't have a default way of seeing all appointments that have reminders, but it is fairly easy to do. Go to your calendar and click on &lt;b&gt;Views&lt;/b&gt; -&amp;gt; &lt;b&gt;Define Views&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Click &lt;b&gt;New&lt;/b&gt; (or &lt;b&gt;Copy&lt;/b&gt; an existing Calendar View). The settings you want are as follows:&lt;br /&gt;
&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Fields&lt;/b&gt;: Icon, Subject, Location, Start, End, Recurrence, Categories, All Day Event, Reminder&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Group By:&lt;/b&gt; None&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Sort: &lt;/b&gt;Recurrence (Ascending), Start (Ascending), End (Ascending)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Filter: &lt;/b&gt;Advanced - Add two new fields: All Day Event equals yes and Reminder equals yes&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9pCbQCJMujA/S86qF2YEoWI/AAAAAAAAAK0/oXJo6q6BY2Q/s1600/All_Day_Reminders.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="303" src="http://4.bp.blogspot.com/_9pCbQCJMujA/S86qF2YEoWI/AAAAAAAAAK0/oXJo6q6BY2Q/s400/All_Day_Reminders.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Name your view "All day events with reminders".&amp;nbsp;Now flick back to the calendar and apply that view under &lt;b&gt;Current View&lt;/b&gt;. You'll see a view not too dissimilar to this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_9pCbQCJMujA/S86rKW8IxZI/AAAAAAAAAK8/HCZUw5xWwQs/s1600/Outlook_Dayy_Day_View.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="332" src="http://2.bp.blogspot.com/_9pCbQCJMujA/S86rKW8IxZI/AAAAAAAAAK8/HCZUw5xWwQs/s400/Outlook_Dayy_Day_View.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
You can now identify those all day events that have reminders. For birthdays, you may want to change the reminder time to something more friendly. For holidays, you can simply click on the reminder icon and the reminder will be removed.&lt;br /&gt;
&lt;br /&gt;
When you next sync your iPhone, you'll find that you won't be woken up at midnight any more.&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/3399926169453259985-4505484897707556340?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T11:29:38.363+02:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_9pCbQCJMujA/S86qF2YEoWI/AAAAAAAAAK0/oXJo6q6BY2Q/s72-c/All_Day_Reminders.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/04/fixing-iphone-midnight-reminders.html</feedburner:origLink></item><item><title>Winhost.com - How to REALLY run multiple sites under one account</title><link>http://feedproxy.google.com/~r/benpowell/~3/NgXLrlKTxus/winhostcom-how-to-really-run-multiple.html</link><category>URL Rewrite</category><category>technology</category><category>Webhost4life.com</category><category>IIS7</category><category>Windows Hosting</category><category>Winhost.com</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 01 Oct 2010 02:43:21 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-3519638112916781657</guid><description>I've just started trialling Winhost.com. I've been with Webhost4life.com for 4 years now but there are a few things that have started to get on my nerves, so I've decided to try out some of the other big ASP.NET hosting specialist companies out there. Winhost.com offers a month-by-month contract, so I can get out any time (we'll see how easy that is in the future) so I didn't feel too bad about trying it out.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;The first thing that struck me was that Winhost.com don't allow you to host multiple domains (or sub domains) as individual websites under one account. Essentially you have one IIS7 Website per account. This is something you can do on Webhost4life.com, and was one of the main reasons I went with them in the first place. I'm a web application developer, which means I want to be able to run numerous websites under one hosting account. It seems that this is a challenge to get for free in a Windows hosting environment.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;My aim is to do the following (S: is the account root path):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;http://www.mydomain.com/ =&amp;gt; S:\MyRoot\Main&lt;/li&gt;
&lt;li&gt;http://sub1.mydomain.com/ =&amp;gt; S:\MyRoot\Sub1&lt;/li&gt;
&lt;li&gt;http://sub2.mydomain.com/ =&amp;gt; s:\MyRoot\Sub2&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;What I don't want (which is what Winhost.com suggest) is to end up with:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;http://www.mydomain.com/main/default.aspx&lt;/li&gt;
&lt;li&gt;http://sub1.mydomain.com/sub1/default.aspx&lt;/li&gt;
&lt;li&gt;http://sub2.mydomain.com/sub2/default.aspx&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Because, face it, that looks like shit.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;So, we'll turn to IIS7's Url Rewrite feature to get this working. First of all configure your "Application Starting Points" from your Winhost.com Site Manager. You'll need four of them:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;/&lt;/li&gt;
&lt;li&gt;/Main&lt;/li&gt;
&lt;li&gt;/Sub1&lt;/li&gt;
&lt;li&gt;/Sub2&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Now login via FTP and create a new web.config file in the root ("/") directory. Paste the following code in:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;

&amp;lt;configuration&amp;gt;

&amp;lt;system.webServer&amp;gt;
&amp;lt;modules runAllManagedModulesForAllRequests="true" /&amp;gt;
&amp;lt;rewrite&amp;gt;
&amp;lt;rules&amp;gt;
&amp;lt;rule name="Rewrite to folder1" stopProcessing="true"&amp;gt;
&amp;lt;match url="(.*)" /&amp;gt;
&amp;lt;conditions&amp;gt;
&amp;lt;add input="{HTTP_HOST}" pattern="^www.mydomain.com$" /&amp;gt;
&amp;lt;/conditions&amp;gt;
&amp;lt;action type="Rewrite" url="main/{R:1}" /&amp;gt;
&amp;lt;/rule&amp;gt;
&amp;lt;rule name="Rewrite to folder2" stopProcessing="true"&amp;gt;
&amp;lt;match url="(.*)" /&amp;gt;
&amp;lt;conditions&amp;gt;
&amp;lt;add input="{HTTP_HOST}" pattern="^sub1.mydomain.com$" /&amp;gt;
&amp;lt;/conditions&amp;gt;
&amp;lt;action type="Rewrite" url="sub1/{R:1}" /&amp;gt;
&amp;lt;/rule&amp;gt;
&amp;lt;rule name="Rewrite to folder3" stopProcessing="true"&amp;gt;
&amp;lt;match url="(.*)" /&amp;gt;
&amp;lt;conditions&amp;gt;
&amp;lt;add input="{HTTP_HOST}" pattern="^sub2.mydomain.com$" /&amp;gt;
&amp;lt;/conditions&amp;gt;
&amp;lt;action type="Rewrite" url="sub2/{R:1}" /&amp;gt;
&amp;lt;/rule&amp;gt;
&amp;lt;/rules&amp;gt;
&amp;lt;/rewrite&amp;gt;

&amp;lt;/system.webServer&amp;gt; 

&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;You can remove any other files from the root folder (i.e. "/").&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This should also work on DiscountASP.net, as they appear to have a very similar set up.&lt;/div&gt;&lt;div&gt;&lt;br /&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/3399926169453259985-3519638112916781657?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-01T11:43:21.323+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">22</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/02/winhostcom-how-to-really-run-multiple.html</feedburner:origLink></item><item><title>ASP.NET MVC Simple authentication without a database</title><link>http://feedproxy.google.com/~r/benpowell/~3/xnMi47BA3wM/aspnet-mvc-simple-authentication.html</link><category>Authentication</category><category>MVC</category><category>technology</category><category>ASP.NET</category><author>noreply@blogger.com (Ben)</author><pubDate>Tue, 19 Oct 2010 08:26:11 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-5014995903958216594</guid><description>Sometimes you just need a really simple authentication method in your ASP.NET MVC applications. The default MVC application has the necessary providers setup so that you can have a more flexible Membership system, but if you just want a single username and password, then this will help you.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
In your web.config change the Authentication section to the following:&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;authentication mode="Forms"&amp;gt;
&amp;lt;forms loginUrl="~/Account/LogOn" timeout="2880"&amp;gt;
&amp;lt;credentials passwordFormat="Clear"&amp;gt;
&amp;lt;user name="test" password="test"/&amp;gt;
&amp;lt;/credentials&amp;gt;
&amp;lt;/forms&amp;gt;
&amp;lt;/authentication&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
Then in the AccountModel.cs file, find the method ValidateUser and change the code to the following:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;public bool ValidateUser(string userName, string password)
{
if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName");
if (String.IsNullOrEmpty(password)) throw new ArgumentException("Value cannot be null or empty.", "password");

return FormsAuthentication.Authenticate(userName, password);
}
&lt;/pre&gt;&lt;br /&gt;
The default setup should now work without using the provider.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-5014995903958216594?l=blog.benpowell.co.uk' alt='' /&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-19T17:26:11.100+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2010/02/aspnet-mvc-simple-authentication.html</feedburner:origLink></item></channel></rss>

