<?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:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Martin Normark's blog</title>
	
	<link>http://martinnormark.com</link>
	<description />
	<lastBuildDate>Sat, 31 Jul 2010 08:59:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/martinnormark" /><feedburner:info uri="martinnormark" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>The (almost) Ultimate Developer PC 2.0</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/ciluRUuquFw/the-almost-ultimate-developer-pc-2-0</link>
		<comments>http://martinnormark.com/2010/07/31/the-almost-ultimate-developer-pc-2-0#comments</comments>
		<pubDate>Sat, 31 Jul 2010 08:59:00 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://martinnormark.com/2010/07/31/the-almost-ultimate-developer-pc-2-0</guid>
		<description><![CDATA[There’s a lot of talk on Twitter and blogs about The Ultimate Developer PC 2.0. The Ultimate Developer PC, was something started three years ago by Scott Hanselman and Jeff Atwood, when Scott wanted a new machine and went for the best of the best. Jeff Atwood came up with his take, known as The [...]]]></description>
			<content:encoded><![CDATA[<p><font size="2">There’s a lot of </font><a href="http://search.twitter.com/search?q=&amp;ands=Ultimate+Developer+PC+2.0&amp;phrase=&amp;ors=&amp;nots=&amp;tag=&amp;lang=all&amp;from=&amp;to=&amp;ref=&amp;near=&amp;within=15&amp;units=mi&amp;since=&amp;until=2010-07-31&amp;rpp=15"><font size="2">talk on Twitter</font></a><font size="2"> and blogs about </font><a href="http://www.hanselman.com/blog/UltimateDeveloperPC20Part1BuildingAWEI79AndRFCForBuildingAGOMGodsOwnMachine.aspx"><font size="2">The</font></a><font size="2"> </font><a href="http://www.hanselman.com/blog/UltimateDeveloperPC20Part2UPDATEAndPODCASTOnBuildingAWEI79AndRFCForBuildingAGOMGodsOwnMachine.aspx"><font size="2">Ultimate</font></a><font size="2"> </font><a href="http://www.hanselman.com/blog/UltimateDeveloperPC20Part3UPDATEOnBuildingAWEI79AndRFCForBuildingAGOMGodsOwnMachine.aspx"><font size="2">Developer</font></a><font size="2"> </font><a href="http://10rem.net/blog/2010/07/28/the-ultimate-developer-machine-20"><font size="2">PC</font></a><font size="2"> </font><a href="http://10rem.net/blog/2010/07/30/last-nights-ultimate-pc-live-bench-build"><font size="2">2.0</font></a><font size="2">. The Ultimate Developer PC, was something started three years ago by </font><a href="http://twitter.com/shanselman"><font size="2">Scott Hanselman</font></a><font size="2"> and </font><a href="http://twitter.com/codinghorror"><font size="2">Jeff Atwood</font></a><font size="2">, when Scott wanted a new machine and went for the best of the best. </font><a href="http://www.codinghorror.com/blog/2007/07/building-a-pc-part-i.html"><font size="2">Jeff Atwood came up with</font></a><font size="2"> his take, known as </font><a href="http://www.hanselman.com/blog/TheCodingHorrorUltimateDeveloperRigThrowdownPart2.aspx"><font size="2">The Coding Horror Ultimate Developer Rig</font></a><font size="2">.</font></p>
<p><font size="2">The same story goes for The Ultimate Developer PC 2.0, only that now it’s Scott Hanselman and Pete Brown building their new machines with an obession of having to achieve a 7.9 score on the Windows Experience Index (WEI).</font></p>
<p><font size="2">Back in August 2007 with The Ultimate Developer PC 1.0, Scott Hanselman </font><a href="http://www.hanselman.com/blog/GoneQuadDay0WithTheUltimateDeveloperPC.aspx"><font size="2">achieved a WEI of 5.8</font></a><font size="2">. I guess what started the 7.9 WEI obsession, is the </font><a href="http://weishare.cloudapp.net/"><font size="2">WEI Share</font></a><font size="2"> website where you can show off your score, and throw down your parts list. Great idea.</font></p>
<h2>Is it worth spending $3,168, to get WEI 7.9?</h2>
<p><font size="2">Looking at Scott Hanselman’s</font> purchase, it totals $3,168. That’s a lot, but if you do get value for money – that is awesome. I have no problem with that!</p>
<p>But how much value are you really getting for the last $1,000? Could you make a PC that was almost as powerful for $2,000?</p>
<p>I built my machine back in <strong>November 2009</strong>. I had one goal: To built a kick ass machine, that didn’t break the bank completely. I’m not a gamer. I have an XBOX 360 for that. I do pick up a game occasionally, though, Starcraft 2 is in my thoughts – but I resist. Modern Warfare 2 has been lying on my PC unopened for almost two months now.</p>
<p>The video card must be able to power up my <a href="http://accessories.us.dell.com/sna/products/Displays/productdetail.aspx?c=us&amp;l=en&amp;s=dhs&amp;cs=19&amp;sku=223-4890">Dell 30” primary monitor</a>, and my <a href="http://accessories.us.dell.com/sna/products/Displays/productdetail.aspx?c=us&amp;l=en&amp;s=dhs&amp;cs=19&amp;sku=320-8277">Dell 24” secondary monitor</a>, without long wait times for repainting and such.</p>
<p>Here goes my parts lists including the current price found at NewEgg.com:</p>
<ul>
<li>Case: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16811129061&amp;Tpk=antec%20p183">Antec P183 Aluminum</a>.       <br />$154.99      </li>
<li>PSU: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16817139005&amp;cm_re=corsair_650-_-17-139-005-_-Product">CORSAIR CMPSU-650TX 650W</a>      <br />$89.99</li>
<p> 
<li>Motherboard: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16813188049&amp;Tpk=evga%20x58%20sli%20le">EVGA X58 SLI LE</a>      <br />$199.99      </li>
<li>CPU: Intel Core i7 Quad Processor i7-920 (not on NewEgg today)     <br />Price back then: ~$300      </li>
<li>Cooler: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16835242001&amp;Tpk=megahalems">Prolimatech Megahalems Rev.B</a>      <br />$62.00</li>
<p> 
<li>Memory: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820145292&amp;cm_re=Corsair_Dominator_ddr3_6GB-_-20-145-292-_-Product">CORSAIR DOMINATOR-GT 6GB (3 x 2GB) 240-Pin DDR3 SDRAM DDR3 1866</a>      <br />$229.99      </li>
<li>SSD: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820167017&amp;cm_re=intel_ssd-_-20-167-017-_-Product">Intel X25-M Mainstream SSDSA2M160G2XXX 2.5&quot; 160GB SATA II MLC</a>      <br />$424.99      </li>
<li>Video card: <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16814150436&amp;Tpk=xfx%20hd%204870">XFX Radeon HD 4870 1GB</a>      <br />$144.99</li>
</ul>
<p><font size="3"><strong>That totals</strong></font>: <font size="5"><strong><u>$1,606.99</u></strong></font> – nearly half the price compared to Scott’s purchase.</p>
<p>&#160;</p>
<h2>Yeah – but what about the WEI score?</h2>
<p>Remember the point of The Ultimate Developer PC 2.0 was to get a 7.9 WEI score? That cost $3,168?</p>
<p>So, what score does a machine for half the price get on the Windows Experience Index:</p>
<p><a href="http://martinnormark.com/wp-content/uploads/2010/07/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="http://martinnormark.com/wp-content/uploads/2010/07/image_thumb.png" width="615" height="500" /></a></p>
<p>I think that is a pretty good achievement. And remember that these parts are from November 2009! I didn’t pick the newest parts at that time, basically because I think you get a lot more value for money by picking parts that has been released for a month or two.</p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/ciluRUuquFw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2010/07/31/the-almost-ultimate-developer-pc-2-0/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2010/07/31/the-almost-ultimate-developer-pc-2-0?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
		<item>
		<title>Generate HTML e-mail body in C# using templates</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/5i6qEPbhlN4/generate-html-e-mail-body-in-c-using-templates</link>
		<comments>http://martinnormark.com/2010/03/13/generate-html-e-mail-body-in-c-using-templates#comments</comments>
		<pubDate>Sat, 13 Mar 2010 23:42:00 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Hidden features of .NET]]></category>

		<guid isPermaLink="false">/post/Generate-HTML-e-mail-body-in-C-using-templates.aspx</guid>
		<description><![CDATA[Almost a year ago, I answered a question on StackOverflow, about if there’s a better way to generate HTML e-mails in C# than using a StringBuilder and just appending strings one by one. I think that any modern piece of software today, needs to send e-mail. Whether it being password recovery e-mails, rich reports, newsletters [...]]]></description>
			<content:encoded><![CDATA[<p>Almost a year ago, I <a href="http://stackoverflow.com/questions/886728/generating-html-email-body-in-c/886750#886750">answered</a> a <a href="http://stackoverflow.com/questions/886728/generating-html-email-body-in-c">question</a> on <a href="http://stackoverflow.com/">StackOverflow</a>, about if there’s a <a href="http://stackoverflow.com/questions/886728/generating-html-email-body-in-c/886750#886750">better way to generate HTML e-mails in C#</a> than using a <a href="http://msdn.microsoft.com/en-us/library/system.text.stringbuilder(VS.100).aspx">StringBuilder</a> and just appending strings one by one.</p>
<p>I think that any modern piece of software today, needs to send e-mail. Whether it being password recovery e-mails, rich reports, newsletters or anything else – being able to easily see and customize the look and feel of your e-mails is vital.</p>
<p>So, the worst way I could think of is having your HTML hidden away in some StringBuilder.Append() hell. The best solution (in my opinion) would be, if you could have plain old HTML files with parameters like &lt;#FirstName#&gt; so you could dynamically replace those at runtime.</p>
<h1>The MailDefinition class</h1>
<p>Luckily, there’s a class for that! If you read the comments on my answer on <a href="http://stackoverflow.com/">StackOverflow</a>, you’ll notice that none of them was familiar with that class and it came as a bit of a surprise. It did for me too, I actually wrote my own “<a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.maildefinition(VS.100).aspx">MailDefinition</a>” class that did just about the same thing. A complete waste of time, and it only tells me that us, developers, are sometimes too trigger happy on the keyboard instead of doing some research first. A quick search in the <a href="http://msdn.microsoft.com/en-us/library/ms229335(VS.100).aspx">MSDN documentation</a> would have saved me some work here and there.</p>
<p>Using the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.maildefinition(VS.100).aspx">MailDefinition</a> class is pretty straight forward. You use the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.maildefinition(VS.100).aspx">MailDefinition</a> class to create an instance of <a href="http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage(VS.100).aspx">MailMessage</a>, which you can send straightaway:</p>
<p><code></p>
<pre class="csharpcode">MailDefinition md = <span class="kwrd">new</span> MailDefinition();
md.From = <span class="str">"test@domain.com"</span>;
md.IsBodyHtml = <span class="kwrd">true</span>;
md.Subject = <span class="str">"Test of MailDefinition"</span>;

ListDictionary replacements = <span class="kwrd">new</span> ListDictionary();
replacements.Add(<span class="str">"&lt;%Name%&gt;"</span>, <span class="str">"Martin"</span>);
replacements.Add(<span class="str">"&lt;%Country%&gt;"</span>, <span class="str">"Denmark"</span>);

<span class="kwrd">string</span> body = <span class="str">"&lt;html&gt;&lt;head&gt;&lt;title&gt;E-mail&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;div&gt;Hello &lt;b&gt;&lt;%Name%&gt;"</span>+
    <span class="str">"&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You're from &lt;%Country%&gt;.&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;"</span>;

MailMessage msg = md.CreateMailMessage(<span class="str">"you@anywhere.com"</span>, replacements,
    body, <span class="kwrd">new</span> System.Web.UI.Control());</pre>
<p></code><br />
Instead of having the HTML inside the code, you could easily have it in your database or as a file on the computer. That will also enable you to edit the look and feel of the HTML template at any time, without having to rebuild and deploy your application.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.maildefinition(VS.100).aspx">MailDefinition</a> is located in the <strong>System.Web assembly</strong>, so don’t forget to add reference to that from your project.</p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/5i6qEPbhlN4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2010/03/13/generate-html-e-mail-body-in-c-using-templates/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2010/03/13/generate-html-e-mail-body-in-c-using-templates?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
		<item>
		<title>IISAPP equivalent in IIS 7 and beyond</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/0FwGqA2P6to/iisapp-equivalent-in-iis-7-and-beyond</link>
		<comments>http://martinnormark.com/2010/03/08/iisapp-equivalent-in-iis-7-and-beyond#comments</comments>
		<pubDate>Mon, 08 Mar 2010 23:53:00 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[IIS7]]></category>

		<guid isPermaLink="false">/post/IISAPP-equivalent-in-IIS-7-and-beyond.aspx</guid>
		<description><![CDATA[If there’s one change I hate about IIS 7 and beyond, it is the lack of the very useful IISAPP script that was present on IIS 6 installations. Run it from a command prompt, and you will see a list of all running worker processes, the process id and the application pool name the process [...]]]></description>
			<content:encoded><![CDATA[<p>If there’s one change I hate about IIS 7 and beyond, it is the lack of the very useful IISAPP script that was present on IIS 6 installations. Run it from a command prompt, and you will see a list of all running worker processes, the process id and the application pool name the process is serving. Very useful if you need to shut down a single site.</p>
<p>As I mentioned, that script was removed in IIS 7 and beyond. I find myself constantly running IISAPP without any luck several time a week, and I’ve decided that this is a habit that I cannot leave behind.</p>
<p>So, to solve the problem I’ve created this small .bat file and copied it to the C:\Windows\System32\inetsrv folder. The content of the iisapp.bat file is just a single line, that does exactly the same as the old IISAPP did – just using the new APPCMD in IIS 7 instead:</p>
<blockquote>
<pre class="csharpcode">appcmd list wp</pre>
</blockquote>
<p>Now I can call IISAPP and see a list of running applications:</p>
<p><a href="http://dnknormark.net/image.axd?picture=image_4.png"><img style="display: inline; border: 0px;" title="image" src="http://dnknormark.net/image.axd?picture=image_thumb_4.png" border="0" alt="image" width="639" height="335" /></a><br />
And now my day got a whole lot better. To wrap it up, I’ll put the path to the inetsrv folder in my PATH environment variable so that I can call IISAPP form anywhere.</p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/0FwGqA2P6to" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2010/03/08/iisapp-equivalent-in-iis-7-and-beyond/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2010/03/08/iisapp-equivalent-in-iis-7-and-beyond?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
		<item>
		<title>Unit test for verifying references from DataAnnotation validation to the ErrorMessageResourceName value</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/1rtrXTFXb2Q/unit-test-for-verifying-references-from-dataannotation-validation-to-the-errormessageresourcename-value</link>
		<comments>http://martinnormark.com/2010/03/04/unit-test-for-verifying-references-from-dataannotation-validation-to-the-errormessageresourcename-value#comments</comments>
		<pubDate>Thu, 04 Mar 2010 17:52:00 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Internationalization]]></category>
		<category><![CDATA[Unit testing]]></category>

		<guid isPermaLink="false">/post/Unit-test-for-verifying-references-from-DataAnnotation-validation-to-the-ErrorMessageResourceName-value.aspx</guid>
		<description><![CDATA[I love the new model validation features in System.ComponentModel.DataAnnotations. One thing I don’t like though, is that the ErrorMessageResourceName is loosely typed. The ErrorMessageResourceType, however, is a System.Type which will be strongly typed by assigning its value using the typeof(Namespace.ResourceSetType) method. Since there’s no build-breaking reference between a resource file and the value of the [...]]]></description>
			<content:encoded><![CDATA[<p>I love the new model validation features in System.ComponentModel.DataAnnotations. One thing I don’t like though, is that the ErrorMessageResourceName is loosely typed. The ErrorMessageResourceType, however, is a System.Type which will be strongly typed by assigning its value using the typeof(Namespace.ResourceSetType) method.</p>
<p>Since there’s no build-breaking reference between a resource file and the value of the ErrorMessageResourceName on all classes where you use it, I thought it would be cool to have a unit test that verifies the existence of all referenced resource keys.</p>
<p>Remember to add a reference to System.ComponentModel.DataAnnotations.</p>
<h2>Code</h2>
<pre class="csharpcode"><span class="rem">/// &lt;summary&gt;</span>
<span class="rem">/// Verifies that all properties that are decorated with validation data-annotations, refers to </span>
<span class="rem">/// an existing resource. This will make sure, that missing resources are not referenced.</span>
<span class="rem">/// &lt;/summary&gt;</span>
[TestMethod]
<span class="kwrd">public</span> <span class="kwrd">void</span> All_Properties_With_Validation_Annotations_Must_Refer_To_Existing_Resource()
{
    Assembly assembly = Assembly.Load(<span class="kwrd">new</span> AssemblyName(<span class="str">"MyApp.Model.Namespace"</span>));
    var types = assembly.GetTypes().Where&lt;Type&gt;(t =&gt; t.IsClass &amp;&amp; !t.IsAbstract);

    <span class="kwrd">foreach</span> (var type <span class="kwrd">in</span> types)
    {
        var properties = type.GetProperties();

        <span class="kwrd">foreach</span> (PropertyInfo property <span class="kwrd">in</span> properties)
        {
            var attributes = property.GetCustomAttributes(<span class="kwrd">true</span>);

            <span class="kwrd">foreach</span> (var item <span class="kwrd">in</span> attributes)
            {
                <span class="kwrd">if</span> (item <span class="kwrd">is</span> ValidationAttribute)
                {
                    ValidationAttribute val = item <span class="kwrd">as</span> ValidationAttribute;

                    Assert.IsNotNull(val);

                    <span class="kwrd">if</span> (val.ErrorMessageResourceType != <span class="kwrd">null</span>)
                    {
                        Assert.AreNotEqual(String.Empty, val.ErrorMessageResourceName,
                            String.Format(<span class="str">@"Validation Error Resource specified on property:
                        {0}.{1} is empty!"</span>, type.ToString(), property.Name));

                        <span class="kwrd">try</span>
                        {
                            ResourceManager rm = <span class="kwrd">new</span> ResourceManager(val.ErrorMessageResourceType);
                            <span class="kwrd">string</span> resourceValue = rm.GetString(val.ErrorMessageResourceName);
                            Assert.IsFalse(String.IsNullOrEmpty(resourceValue),
                                String.Format(<span class="str">@"The value of the Validation Error Resource specified on property:
                            {0}.{1} is empty!"</span>, type.ToString(), property.Name));
                        }
                        <span class="kwrd">catch</span> (MissingManifestResourceException)
                        {
                            Assert.Fail(String.Format(<span class="str">@"Validation Error Resource specified on property:
                            {0}.{1} could not be found!"</span>, type.ToString(), property.Name));
                        }
                    }
                }
            }
        }
    }
}</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/1rtrXTFXb2Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2010/03/04/unit-test-for-verifying-references-from-dataannotation-validation-to-the-errormessageresourcename-value/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2010/03/04/unit-test-for-verifying-references-from-dataannotation-validation-to-the-errormessageresourcename-value?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
		<item>
		<title>Multiple SSL certificates on IIS using host headers</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/JwN8CQGYmJo/multiple-ssl-certificates-on-iis-using-host-headers</link>
		<comments>http://martinnormark.com/2010/03/04/multiple-ssl-certificates-on-iis-using-host-headers#comments</comments>
		<pubDate>Thu, 04 Mar 2010 00:35:00 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[IIS7]]></category>

		<guid isPermaLink="false">/post/Multiple-SSL-certificates-on-IIS-using-host-headers.aspx</guid>
		<description><![CDATA[In IIS SSL sites have seemed to be limited to only one site per network interface, since you (from IIS Manager) cannot specify a host header binding on the HTTPS protocol. It turns out, that it is only a limitation in the UI. So to have e.g. two sites with their own dedicated SSL certificate [...]]]></description>
			<content:encoded><![CDATA[<p>In IIS SSL sites have seemed to be limited to only one site per network interface, since you (from IIS Manager) cannot specify a host header binding on the HTTPS protocol.</p>
<p>It turns out, that it is only a limitation in the UI. So to have e.g. two sites with their own dedicated SSL certificate we need to add a host header binding on port 443 from either appcmd, managed code or by editing the applicationHosts.config file.</p>
<p>I like managed code the most, so I’ve written a small method in C# that does the trick. You need to have two SSL certificates named <a href="http://www.ssl1.com">www.ssl1.com</a> and <a href="http://www.ssl2.com">www.ssl2.com</a> installed on the machine. I just created a self signed certificate for both of them using the IIS Manager.</p>
<pre class="csharpcode"><span class="kwrd">using</span> System.Security.Cryptography.X509Certificates;
<span class="kwrd">using</span> Microsoft.Web.Administration;

<span class="kwrd">namespace</span> IisSsl
{
    <span class="kwrd">class</span> Program
    {
        <span class="kwrd">static</span> <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[] args)
        {
            <span class="kwrd">using</span> (ServerManager _serverManager = <span class="kwrd">new</span> ServerManager())
            {
                <span class="kwrd">string</span> siteName = <span class="str">"SSL2"</span>;
                <span class="kwrd">string</span> certName = <span class="str">"www.ssl2.com"</span>;

                X509Store store = <span class="kwrd">new</span> X509Store(StoreName.My, StoreLocation.LocalMachine);
                store.Open(OpenFlags.ReadOnly);

                X509Certificate2 certificate = store.Certificates[0];

                Site site = _serverManager.Sites[siteName];

                <span class="kwrd">if</span> (site != <span class="kwrd">null</span>)
                {
                    site.Bindings.Add(<span class="str">"*:443:"</span> + certName,
                        certificate.GetCertHash(), store.Name);
                }
                store.Close();

                _serverManager.CommitChanges();
            }
        }
    }
}</pre>
<p>Remember to add a reference to C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll in order to use the ServerManager class.</p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/JwN8CQGYmJo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2010/03/04/multiple-ssl-certificates-on-iis-using-host-headers/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2010/03/04/multiple-ssl-certificates-on-iis-using-host-headers?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
		<item>
		<title>ASP.NET MVC View Page Editor in Visual Studio 2010 Beta 2 won’t recognize HTML tags</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/eRdTTGY9iS4/asp-net-mvc-view-page-editor-in-visual-studio-2010-beta-2-won%e2%80%99t-recognize-html-tags</link>
		<comments>http://martinnormark.com/2009/10/21/asp-net-mvc-view-page-editor-in-visual-studio-2010-beta-2-won%e2%80%99t-recognize-html-tags#comments</comments>
		<pubDate>Wed, 21 Oct 2009 13:24:00 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">/post/ASPNET-MVC-View-Page-Editor-in-Visual-Studio-2010-Beta-2-wone28099t-recognize-HTML-tags.aspx</guid>
		<description><![CDATA[I love the new IntelliSense dialog in Visual Studio 2010 Beta 2, that ScottGu has blogged about. But when editing an ASP.NET MVC View Page in Visual Studio 2010 Beta 2, you end up fighting the IntelliSense. That is because IntelliSense and the HTML Editor doesn’t recognize *any* HTML tags. Trying to add a simple [...]]]></description>
			<content:encoded><![CDATA[<p>I love the new IntelliSense dialog in Visual Studio 2010 Beta 2, that <a href="http://weblogs.asp.net/scottgu/archive/2009/10/22/vs-2010-code-intellisense-improvements-vs-2010-and-net-4-0-series.aspx">ScottGu has blogged about</a>. But when editing an ASP.NET MVC View Page in Visual Studio 2010 Beta 2, you end up fighting the IntelliSense. That is because IntelliSense and the HTML Editor doesn’t recognize *any* HTML tags.</p>
<p><a href="http://dnknormark.net/image.axd?picture=image_1.png"><img style="display: inline; border-width: 0px;" title="image" src="http://dnknormark.net/image.axd?picture=image_thumb_1.png" border="0" alt="image" width="655" height="395" /></a></p>
<p>Trying to add a simple paragraph tag in HTML suggests a panel (code snippet). When you finish the P tag, by typing &gt;, the result is this:</p>
<p><a href="http://dnknormark.net/image.axd?picture=image_2.png"><img style="display: inline; border-width: 0px;" title="image" src="http://dnknormark.net/image.axd?picture=image_thumb_2.png" border="0" alt="image" width="306" height="188" /></a></p>
<p>Pretty annoying to fight with IntelliSense when you want to code! I thought you might be able to fix this, by deleting all the new ASP.NET specific code snippets in the “C:\Program Files\Microsoft Visual Studio 10.0\Web\Snippets\HTML\1033\ASP.NET” folder.</p>
<p>This actually works. Now you can actually see the ASP.NET MVC code snippets, that was hidden in the masses of the ASP.NET ones.</p>
<p><a href="http://dnknormark.net/image.axd?picture=image_3.png"><img style="display: inline; border-width: 0px;" title="image" src="http://dnknormark.net/image.axd?picture=image_thumb_3.png" border="0" alt="image" width="642" height="359" /></a></p>
<p>But it still has all the ASP.NET Server Controls listed. I thought I could get rid of these by removing a namespace reference to System.Web in the Pages section of Web.config. But that is not present. So I don’t know how to fix that.</p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/eRdTTGY9iS4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2009/10/21/asp-net-mvc-view-page-editor-in-visual-studio-2010-beta-2-won%e2%80%99t-recognize-html-tags/feed</wfw:commentRss>
		<slash:comments>64</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2009/10/21/asp-net-mvc-view-page-editor-in-visual-studio-2010-beta-2-won%e2%80%99t-recognize-html-tags?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
		<item>
		<title>Search Twitter from C# using LINQ to XML</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/68eCEyJuYxA/search-twitter-from-c-using-linq-to-xml</link>
		<comments>http://martinnormark.com/2009/03/16/search-twitter-from-c-using-linq-to-xml#comments</comments>
		<pubDate>Mon, 16 Mar 2009 21:28:08 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">/post/Search-Twitter-from-C-using-LINQ-to-XML.aspx</guid>
		<description><![CDATA[In some applications, it could be cool to have a feature that enabled the user to quickly get a glimpse of what people are saying on Twitter about the user or their product, service, company etc. For instance, a service like GetSatisfaction.com has a feature just like that. They call it Overheard, and this is [...]]]></description>
			<content:encoded><![CDATA[<p>In some applications, it could be cool to have a feature that enabled the user to quickly get a glimpse of what people are saying on <a href="http://twitter.com/">Twitter</a> about the user or their product, service, company etc.</p>
<p>For instance, a service like <a href="http://getsatisfaction.com">GetSatisfaction.com</a> has a feature just like that. They call it <a href="http://getsatisfaction.com/dell/overheard">Overheard</a>, and this is what it looks like:</p>
<p><a href="http://www.dnknormark.net/image.axd?picture=overheard.jpg"><img style="display: inline; border: 0px;" title="overheard" src="http://www.dnknormark.net/image.axd?picture=overheard_thumb.jpg" border="0" alt="overheard" width="621" height="513" /></a></p>
<p>There’s nothing like Twitter to give you feedback. I think <a href="http://mediatemple.net/">MediaTemple</a> felt the <a href="http://search.twitter.com/search?q=+mediatemple+since%3A2009-02-26+until%3A2009-02-28">effect of unhappy customers on Twitter</a> when their servers broke down, and stayed there for more than two days!</p>
<p>Anyway. I wanted to search from C#, and get back a DataTable. Here’s how it’s done:</p>
<pre class="csharpcode">    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// Searches Twitter for the specified query.</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="rem">/// &lt;param name="query"&gt;The query.&lt;/param&gt;</span>
    <span class="rem">/// &lt;returns&gt;Returns the search results as a DataTable&lt;/returns&gt;</span>
    <span class="kwrd">public</span> DataTable Search(<span class="kwrd">string</span> query)
    {
      DataTable dt = <span class="kwrd">new</span> DataTable();
      dt.Columns.Add(<span class="str">"text"</span>);
      dt.Columns.Add(<span class="str">"html"</span>);
      dt.Columns.Add(<span class="str">"pubdate"</span>);
      dt.Columns.Add(<span class="str">"id"</span>);
      dt.Columns.Add(<span class="str">"link"</span>);
      dt.Columns.Add(<span class="str">"authorname"</span>);
      dt.Columns.Add(<span class="str">"authorlink"</span>);

      XDocument tweetResults = XDocument.Load(String.Format(</pre>
<pre class="csharpcode">      <span class="str">"http://search.twitter.com/search.atom?q={0}"</span>, HttpUtility.UrlEncode(query)));</pre>
<pre class="csharpcode">      XNamespace atomNS = <span class="str">"http://www.w3.org/2005/Atom"</span>;
      var q = from tweet <span class="kwrd">in</span> tweetResults.Descendants(atomNS + <span class="str">"entry"</span>)
              select <span class="kwrd">new</span>
              {
                Text = (<span class="kwrd">string</span>)tweet.Element(atomNS + <span class="str">"title"</span>),
                Html = (<span class="kwrd">string</span>)tweet.Element(atomNS + <span class="str">"content"</span>),
                DatePublished = DateTime.Parse((<span class="kwrd">string</span>)tweet.Element(atomNS + <span class="str">"published"</span>)),
                Id = (<span class="kwrd">string</span>)tweet.Element(atomNS + <span class="str">"id"</span>),
                Link = (<span class="kwrd">string</span>)tweet.Elements(atomNS + <span class="str">"link"</span>)
                .Where(link =&gt; (<span class="kwrd">string</span>)link.Attribute(<span class="str">"rel"</span>) == <span class="str">"alternate"</span>)
                .Select(link =&gt; (<span class="kwrd">string</span>)link.Attribute(<span class="str">"href"</span>))
                .First(),
                Author = (from author <span class="kwrd">in</span> tweet.Descendants(atomNS + <span class="str">"author"</span>)
                          select <span class="kwrd">new</span>
                          {
                            Name = (<span class="kwrd">string</span>)author.Element(atomNS + <span class="str">"name"</span>),
                            Uri = (<span class="kwrd">string</span>)author.Element(atomNS + <span class="str">"uri"</span>),
                          }).First()
              };

      <span class="kwrd">foreach</span> (var item <span class="kwrd">in</span> q)
      {
        dt.Rows.Add(item.Text, item.Html, item.DatePublished, item.Id, item.Link,</pre>
<pre class="csharpcode">                    item.Author.Name, item.Author.Uri);
      }

      <span class="kwrd">return</span> dt;
    }</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/68eCEyJuYxA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2009/03/16/search-twitter-from-c-using-linq-to-xml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2009/03/16/search-twitter-from-c-using-linq-to-xml?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
		<item>
		<title>Migrate web.config to support the IIS 7 Integrated Pipeline</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/eo8bRvsi6Ak/migrate-web-config-to-support-the-iis-7-integrated-pipeline</link>
		<comments>http://martinnormark.com/2009/03/15/migrate-web-config-to-support-the-iis-7-integrated-pipeline#comments</comments>
		<pubDate>Sun, 15 Mar 2009 22:13:47 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[IIS7]]></category>

		<guid isPermaLink="false">/post/Migrate-webconfig-to-support-the-IIS-7-Integrated-Pipeline.aspx</guid>
		<description><![CDATA[Whenever you deploy a website to IIS 7 that is not compliant with the IIS 7 integrated pipeline, you will get an error like this one: Not the great error message you get. It actually gives you the solution right away: Migrate Web.config to support the integrated pipeline. To do that, start a command prompt, [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever you deploy a website to <strong>IIS 7</strong> that is not compliant with the IIS 7 integrated pipeline, you will get an error like this one:</p>
<p><a href="http://www.dnknormark.net/image.axd?picture=iis7integratedpipelineerror.png"><img style="display: inline; border: 0px;" title="iis7-integrated-pipeline-error" src="http://www.dnknormark.net/image.axd?picture=iis7integratedpipelineerror_thumb.png" border="0" alt="iis7-integrated-pipeline-error" width="644" height="458" /></a></p>
<p>Not the great error message you get. It actually gives you the solution right away: <strong>Migrate Web.config to support the integrated pipeline. </strong>To do that, start a command prompt, and execute:</p>
<p><strong>%SystemRoot%\system32\inetsrv\appcmd migrate config &#8220;test/&#8221;</strong></p>
<p>After doing this, our Web.config is changed to support the IIS 7 integrated pipeline and we can see the website.</p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/eo8bRvsi6Ak" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2009/03/15/migrate-web-config-to-support-the-iis-7-integrated-pipeline/feed</wfw:commentRss>
		<slash:comments>53</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2009/03/15/migrate-web-config-to-support-the-iis-7-integrated-pipeline?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
		<item>
		<title>Automatically translate Global and Local Resource (resx) files</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/z8p54_GTALk/automatically-translate-global-and-local-resource-resx-files</link>
		<comments>http://martinnormark.com/2009/03/13/automatically-translate-global-and-local-resource-resx-files#comments</comments>
		<pubDate>Fri, 13 Mar 2009 22:31:14 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Internationalization]]></category>

		<guid isPermaLink="false">/post/Automatically-translate-Global-and-Local-Resource-(resx)-files.aspx</guid>
		<description><![CDATA[Yesterday, I blogged about how you can use Google Translate to translate a string in C#. To make it more useful than just a simple translator, and because I need to translate some Global Resource files for an E-commerce website that I’m working on, I wanted to create a small Windows Application in C# that [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I blogged about how you can <a href="http://dnknormark.net/post/Translate-text-in-C-using-Google-Translate.aspx">use Google Translate to translate a string in C#</a>. To make it more useful than just a simple translator, and because I need to translate some Global Resource files for an E-commerce website that I’m working on, I wanted to create a small Windows Application in C# that could read a Global Resource file (.resx) and translate it into a selected language using the <a href="http://dnknormark.net/post/Translate-text-in-C-using-Google-Translate.aspx">method for translating a word in C#</a> that i blogged about yesterday.</p>
<p><a href="http://www.dnknormark.net/image.axd?picture=image.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.dnknormark.net/image.axd?picture=image_thumb.png" border="0" alt="image" width="451" height="166" /></a></p>
<p>This is how it looks so far. You simply select the resource file you want to translate. Select the current language of the resource file in the middle box, and select the language you want to translate it to in the last box. Click <strong>Translate</strong> at it should work. The new resource file will be saved in the same location as the application itself.</p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/z8p54_GTALk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2009/03/13/automatically-translate-global-and-local-resource-resx-files/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2009/03/13/automatically-translate-global-and-local-resource-resx-files?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
		<item>
		<title>Translate text in C#, using Google Translate</title>
		<link>http://feedproxy.google.com/~r/martinnormark/~3/ESJ6hpSzCpc/translate-text-in-c-using-google-translate</link>
		<comments>http://martinnormark.com/2009/03/12/translate-text-in-c-using-google-translate#comments</comments>
		<pubDate>Thu, 12 Mar 2009 00:14:26 +0000</pubDate>
		<dc:creator>Martin H. Normark</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">/post/Translate-text-in-C-using-Google-Translate.aspx</guid>
		<description><![CDATA[Sometimes, it would be great to be able to translate a text from e.g. English to Danish directly from C#. This could be useful when you want to translate a Resource file into another language. Google Translate is awesome. There’s also Windows Live Translator, but Microsoft are far behind Google (also) in this game. Code: [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, it would be great to be able to translate a text from e.g. English to Danish directly from C#. This could be useful when you want to translate a <a href="http://msdn.microsoft.com/en-us/library/ekyft91f(VS.80).aspx">Resource file</a> into another language.</p>
<p><a href="http://translate.google.com/">Google Translate</a> is awesome. There’s also <a href="http://www.windowslivetranslator.com/">Windows Live Translator</a>, but Microsoft are far behind Google (also) in this game.</p>
<p>Code:</p>
<pre class="csharpcode"><span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Net;
<span class="kwrd">using</span> System.Text;
<span class="kwrd">using</span> System.Text.RegularExpressions;

<span class="kwrd">namespace</span> Utilities
{
  <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">class</span> Translator
  {
    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// Translates the text.</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="rem">/// &lt;param name="input"&gt;The input.&lt;/param&gt;</span>
    <span class="rem">/// &lt;param name="languagePair"&gt;The language pair.&lt;/param&gt;</span>
    <span class="rem">/// &lt;returns&gt;&lt;/returns&gt;</span>
    <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> TranslateText(<span class="kwrd">string</span> input, <span class="kwrd">string</span> languagePair)
    {
      <span class="kwrd">return</span> TranslateText(input, languagePair, System.Text.Encoding.UTF7);
    }

    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// Translate Text using Google Translate</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="rem">/// &lt;param name="input"&gt;The string you want translated&lt;/param&gt;</span>
    <span class="rem">/// &lt;param name="languagePair"&gt;2 letter Language Pair, delimited by "|". </span>
    <span class="rem">/// e.g. "en|da" language pair means to translate from English to Danish&lt;/param&gt;</span>
    <span class="rem">/// &lt;param name="encoding"&gt;The encoding.&lt;/param&gt;</span>
    <span class="rem">/// &lt;returns&gt;Translated to String&lt;/returns&gt;</span>
    <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> TranslateText(<span class="kwrd">string</span> input, <span class="kwrd">string</span> languagePair, Encoding encoding)
    {
      <span class="kwrd">string</span> url = String.Format(<span class="str">"http://www.google.com/translate_t?hl=en&amp;ie=UTF8&amp;text={0}&amp;langpair={1}"</span>, input, languagePair);

      <span class="kwrd">string</span> result = String.Empty;

      <span class="kwrd">using</span> (WebClient webClient = <span class="kwrd">new</span> WebClient())
      {
        webClient.Encoding = encoding;
        result = webClient.DownloadString(url);
      }

      Match m = Regex.Match(result, <span class="str">"(?&lt;=&lt;div id=result_box dir=\"ltr\"&gt;)(.*?)(?=&lt;/div&gt;)"</span>);

      <span class="kwrd">if</span> (m.Success)
        result = m.Value;

      <span class="kwrd">return</span> result;
    }
  }
}</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>The translated string is fetched by the RegEx close to the bottom. This could of course change, and you have to keep it up to date.</p>
<img src="http://feeds.feedburner.com/~r/martinnormark/~4/ESJ6hpSzCpc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://martinnormark.com/2009/03/12/translate-text-in-c-using-google-translate/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>
	<feedburner:origLink>http://martinnormark.com/2009/03/12/translate-text-in-c-using-google-translate?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</feedburner:origLink></item>
	</channel>
</rss>
