<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>You had me at "Hello World"</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/helloworld/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/helloworld/feed.xml</link>
    <description>Programming, Love at First Sight</description>
    <lastBuildDate>Fri, 26 Feb 2016 06:25:33 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Windows Hardware Compatibility List for Windows RT</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/windows-hardware-compatibility-list-for-windows-rt</link>
      <pubDate>Mon, 05 Nov 2012 11:47:37 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2012/11/05/windows-hardware-compatibility-list-for-windows-rt/</guid>
      <description><![CDATA[Just bought a Surface RT device? Congratulations! I purchased a Microsoft Surface RT, and I am very...]]></description>
      <content:encoded><![CDATA[<p>Just bought a Surface RT device? Congratulations! I purchased a <a title="https://www.microsoft.com/Surface/en-US" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Microsoft Surface RT" target="_blank">Microsoft Surface RT</a>, and I am very happy with mine.</p>
<p>If you want to know if your device works with your new Surface RT, check Windows Hardware Compatibility List for Windows RT.</p>
<p><a href="https://www.microsoft.com/en-us/windows/compatibility/winrt/CompatCenter/Home">https://www.microsoft.com/en-us/windows/compatibility/winrt/CompatCenter/Home</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Metrics and Information for Your Windows Phone 7 App</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/metrics-and-information-for-your-windows-phone-7-app</link>
      <pubDate>Tue, 03 May 2011 10:07:55 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2011/05/03/metrics-and-information-for-your-windows-phone-7-app/</guid>
      <description><![CDATA[So you wrote and published Windows Phone 7 apps, and of course you want to know how well your apps...]]></description>
      <content:encoded><![CDATA[<p>So you wrote and published Windows Phone 7 apps, and of course you want to know how well your apps are doing. Below are some resources to help you see the reviews left for your apps from different part of the world.</p>  <p><a title="https://sorokoletov.com/ztop/" href="https://sorokoletov.com/ztop/">https://sorokoletov.com/ztop/</a></p>  <p><a title="https://wp7reviews.tomverhoeff.com/" href="https://wp7reviews.tomverhoeff.com/">https://wp7reviews.tomverhoeff.com/</a></p>  <p>If you want to see the metrics for ranking and download reports, <a href="https://www.distimo.com">https://www.distimo.com</a> is a good resource.</p>]]></content:encoded>
    </item>
    <item>
      <title>Productivity Power Tools for Visual Studio 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/productivity-power-tools-for-visual-studio-2010</link>
      <pubDate>Sat, 29 Jan 2011 12:32:46 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2011/01/29/productivity-power-tools-for-visual-studio-2010/</guid>
      <description><![CDATA[I just installed Visual Studio 2010 on a different machine, and I noticed I missed several things...]]></description>
      <content:encoded><![CDATA[<p>I just installed Visual Studio 2010 on a different machine, and I noticed I missed several things that I really enjoyed on my primary machine. I was looking for a missing updates, and my machine and Visual Studio is fully updated. I realized, I did not install productivity power tools.</p>  <p>If you have not used it, download it here. <a href="https://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/">https://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Free Electronic Book: Programming Windows Phone 7</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/free-electronic-book-programming-windows-phone-7</link>
      <pubDate>Thu, 28 Oct 2010 01:57:00 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2010/10/28/free-electronic-book-programming-windows-phone-7/</guid>
      <description><![CDATA[You can get a free ebook, Programming Windows Phone 7, by Charles Petzold here:...]]></description>
      <content:encoded><![CDATA[<p>You can get a free ebook, Programming Windows Phone 7, by Charles Petzold here: </p>  <p><a href="https://blogs.msdn.com/b/microsoft_press/archive/2010/10/28/free-ebook-programming-windows-phone-7-by-charles-petzold.aspx">https://blogs.msdn.com/b/microsoft_press/archive/2010/10/28/free-ebook-programming-windows-phone-7-by-charles-petzold.aspx</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Windows 7 Shortcuts</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/windows-7-shortcuts</link>
      <pubDate>Wed, 21 Jul 2010 12:14:00 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2010/07/21/windows-7-shortcuts/</guid>
      <description><![CDATA[I read this article that I found really helpful. It covers some keyboard shortcuts that can be...]]></description>
      <content:encoded><![CDATA[<p>I read this article that I found really helpful. It covers some keyboard shortcuts that can be useful. My favorites have always been Win+Keypad and Shift+Right Click on a folder, now I found out more.</p>  <p><a title="https://www.guidingtech.com/4535/windows-7-keyboard-shortcut/" href="https://www.guidingtech.com/4535/windows-7-keyboard-shortcut/">https://www.guidingtech.com/4535/windows-7-keyboard-shortcut/</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Understanding WPF Dependency Property and Attached Property</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/understanding-wpf-dependency-property-and-attached-property</link>
      <pubDate>Fri, 25 Jun 2010 12:10:51 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2010/06/25/understanding-wpf-dependency-property-and-attached-property/</guid>
      <description><![CDATA[One of my biggest challenge to understand WPF is the concept of attached property and dependency...]]></description>
      <content:encoded><![CDATA[<p>One of my biggest challenge to understand WPF is the concept of attached property and dependency property. Every time I ask someone, I have a slightly different answer.</p>  <p>I think I have a good grasp of the concept, this is how I can explain how dependency property and Attached Property works.</p>  <p><strong>Dependency Property</strong></p>  <p>This is WPF property system, even though this is a property, it is not the same as regular property. The properties are not stored in an internal field, but it is stored in an internal storage system that stores per-instance value of the property.</p>  <p>The dependency property is a public static read-only field that must be registered first. After it has been registered, this static property is used to get and set the value in the internal storage system.</p>  <p><strong>Attached Property</strong></p>  <p>This is also dependency property. The internal storage system takes a DependencyProperty as key to get and set value. Attached property allows an object to to store a value using key that belongs to another class.</p>  <p>Imagine WPF property system is a property bag, and the property bag can take any kind of values. In most cases, the key for this property bag is defined in the class itself, but for attached property, the key is defined in other class.</p>  <p>To illustrate:</p>  <p>Imagine a person represents a class with dependency property. Let says his name is John. Whenever a dependency property is set, John writes this property in his notebook. When the property value is requested, he reads the note and return the value. John can only writes value for the property that he knows.</p>  <p>Now, imagine there is another person, Jane. She has her notebook, and she has a note, that one property in her notebook is also an attached property. The meaning of this property is relevant only for Jane, but everyone can keep it in their notebook. Everyone in the office knows about the attached properties.</p>  <p>John is assigned a property value, and he notices that this is value is for a property belongs to Jane and it is an attached property. He does not know what to do, but because this is an attached property, he writes it down in his notebook.</p>  <p>Jane asked John, if he has a value for a property which she understands, John reads his notebook, and give Jane the value. Based on that, Jane can do something.</p>  <p>Now replace John with Button class, Jane with Grid class, and the attached property with Grid.Row and Grid.Column.</p>]]></content:encoded>
    </item>
    <item>
      <title>Exposing WCF REST Interface, Step by Step</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/exposing-wcf-rest-interface-step-by-step</link>
      <pubDate>Tue, 26 Jan 2010 14:14:49 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2010/01/26/exposing-wcf-rest-interface-step-by-step/</guid>
      <description><![CDATA[It is really hard for me to think another way to build services, other than WCF. WCF team did a very...]]></description>
      <content:encoded><![CDATA[<p>It is really hard for me to think another way to build services, other than WCF. WCF team did a very good job handling all the necessary plumbing.</p>  <p>This post shows a quick tutorial on how to expose a WCF service as a REST service, using IIS. This post assumes that there is already a working service called Foo, with one method that returns FooData. Just add a WCF service within Visual Studio.</p>  <pre class="code">[<span style="color: #2b91af">ServiceContract</span>]
<span style="color: blue">public interface </span><span style="color: #2b91af">IFoo
</span>{
    [<span style="color: #2b91af">OperationContract</span>]
    <span style="color: #2b91af">FooData </span>GetFooData();
}

[<span style="color: #2b91af">DataContract</span>]
<span style="color: blue">public class </span><span style="color: #2b91af">FooData
</span>{
    [<span style="color: #2b91af">DataMember</span>]
    <span style="color: blue">public string </span>Data { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
}

<span style="color: blue">public class </span><span style="color: #2b91af">Foo </span>: <span style="color: #2b91af">IFoo
</span>{
    <span style="color: blue">public </span><span style="color: #2b91af">FooData </span>GetFooData()
    {
        <span style="color: blue">return new </span><span style="color: #2b91af">FooData</span>() { Data = <span style="color: #a31515">&quot;You Had Me at Hello World.&quot; </span>};
    }
}
<span style="color: blue">&lt;</span><span style="color: #a31515">configuration</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">services</span><span style="color: blue">&gt;
</span><span style="color: blue">      &lt;</span><span style="color: #a31515">service </span><span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">FooBehavior</span>&quot; <span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Foo</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">address</span><span style="color: blue">=</span>&quot;&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">wsHttpBinding</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">IFoo</span>&quot;<span style="color: blue">&gt;
          &lt;</span><span style="color: #a31515">identity</span><span style="color: blue">&gt;
            &lt;</span><span style="color: #a31515">dns </span><span style="color: red">value</span><span style="color: blue">=</span>&quot;<span style="color: blue">localhost</span>&quot; <span style="color: blue">/&gt;
          &lt;/</span><span style="color: #a31515">identity</span><span style="color: blue">&gt;
        &lt;/</span><span style="color: #a31515">endpoint</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">mex</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">mexHttpBinding</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">IMetadataExchange</span>&quot; <span style="color: blue">/&gt;
      &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">services</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
</span><span style="color: blue">      &lt;</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
</span><span style="color: blue">        &lt;</span><span style="color: #a31515">behavior </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">FooBehavior</span>&quot;<span style="color: blue">&gt;
          &lt;</span><span style="color: #a31515">serviceMetadata </span><span style="color: red">httpGetEnabled</span><span style="color: blue">=</span>&quot;<span style="color: blue">true</span>&quot; <span style="color: blue">/&gt;
          &lt;</span><span style="color: #a31515">serviceDebug </span><span style="color: red">includeExceptionDetailInFaults</span><span style="color: blue">=</span>&quot;<span style="color: blue">false</span>&quot; <span style="color: blue">/&gt;
        &lt;/</span><span style="color: #a31515">behavior</span><span style="color: blue">&gt;
      &lt;/</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">configuration</span><span style="color: blue">&gt;</span></pre>
<a href="https://11011.net/software/vspaste"></a>

<p>To expose a REST interface of that service, these are the steps:</p>

<ol>
  <li>Decorate the method with WebGet or WebInvoke attribute (in System.ServiceModel.Web. 
    <pre class="code">[<span style="color: #2b91af">ServiceContract</span>]
<span style="color: blue">public interface </span><span style="color: #2b91af">IFoo
</span>{
    [<span style="color: #2b91af">OperationContract</span>]
    <strong><font size="4"><em>[<span style="color: #2b91af">WebGet</span>(UriTemplate=<span style="color: #a31515">&quot;GetFooData&quot;</span>)]</em></font>
</strong>    <span style="color: #2b91af">FooData </span>GetFooData();
}</pre>
  </li>

  <li>Update the configuration 
    <ol>
      <li>Add endpointBehaviors. 
        <pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">endpointBehaviors</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">behavior </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">web</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">webHttp </span><span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">behavior</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">endpointBehaviors</span><span style="color: blue">&gt;</span></pre>
        <a href="https://11011.net/software/vspaste"></a></li>

      <li>Update the endPoint by changing the binding to webHttpBinding, and add behaviorConfiguration to the endPoint node to point to the endpointBehavior from step 1. 
        <pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">address</span><span style="color: blue">=</span>&quot;&quot; <strong><em><font size="4"><span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">webHttpBinding</span>&quot;</font></em></strong> <strong><em><font size="4"><span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">web</span>&quot;</font></em></strong> <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">IFoo</span>&quot;<span style="color: blue">&gt;</span></pre>
      </li>
    </ol>
  </li>
</ol>

<blockquote>
  <p>At the end, this is the final configuration looks like.</p>

  <pre class="code"><span style="color: blue">&lt;/</span><span style="color: #a31515">configuration</span><span style="color: blue">&gt;<br /></span><span style="color: blue">  &lt;</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">services</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">service </span><span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">FooBehavior</span>&quot; <span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Foo</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">address</span><span style="color: blue">=</span>&quot;&quot; <strong><em><font size="4"><span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">webHttpBinding</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">web</span>&quot;</font></em></strong> <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">IFoo</span>&quot;<span style="color: blue">&gt;
          &lt;</span><span style="color: #a31515">identity</span><span style="color: blue">&gt;
            &lt;</span><span style="color: #a31515">dns </span><span style="color: red">value</span><span style="color: blue">=</span>&quot;<span style="color: blue">localhost</span>&quot; <span style="color: blue">/&gt;
          &lt;/</span><span style="color: #a31515">identity</span><span style="color: blue">&gt;
        &lt;/</span><span style="color: #a31515">endpoint</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">mex</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">mexHttpBinding</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">IMetadataExchange</span>&quot; <span style="color: blue">/&gt;
      &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">services</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
<strong><em><font size="4"><font size="2">      </font>&lt;</font></em></strong></span><span style="color: #a31515"><strong><em><font size="4">endpointBehaviors</font></em></strong></span><strong><em><font size="4"><span style="color: blue">&gt;
<font size="2">        </font>&lt;</span><span style="color: #a31515">behavior </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">web</span>&quot;</font></em></strong><strong><em><font size="4"><span style="color: blue">&gt;
<font size="2">          </font>&lt;</span><span style="color: #a31515">webHttp </span></font></em></strong><strong><em><font size="4"><span style="color: blue">/&gt;
        &lt;/</span><span style="color: #a31515">behavior</span></font></em></strong><strong><em><font size="4"><span style="color: blue">&gt;
<font size="2">      </font>&lt;/</span><span style="color: #a31515">endpointBehaviors</span></font></em></strong><span style="color: blue"><strong><em><font size="4">&gt;</font></em></strong>
      &lt;</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">behavior </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">FooBehavior</span>&quot;<span style="color: blue">&gt;
          &lt;</span><span style="color: #a31515">serviceMetadata </span><span style="color: red">httpGetEnabled</span><span style="color: blue">=</span>&quot;<span style="color: blue">true</span>&quot; <span style="color: blue">/&gt;
          &lt;</span><span style="color: #a31515">serviceDebug </span><span style="color: red">includeExceptionDetailInFaults</span><span style="color: blue">=</span>&quot;<span style="color: blue">false</span>&quot; <span style="color: blue">/&gt;
        &lt;/</span><span style="color: #a31515">behavior</span><span style="color: blue">&gt;
      &lt;/</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">configuration</span><span style="color: blue">&gt;</span></pre>
</blockquote>

<p>It is done. Now open your browser and point it to your REST url (the .svc uri + the method name as specified in UriTemplate attribute (GetFooData in this example). <a href="https://localhost:8081/Foo.svc/GetFooData">https://localhost:8081/Foo.svc/GetFooData</a>, and you will get:</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/helloworld/WindowsLiveWriter/ImplementingRESTfulServiceinWCFStepbySte_8E1F/image_6.png" original-url="https://blogs.msdn.com/blogfiles/helloworld/WindowsLiveWriter/ImplementingRESTfulServiceinWCFStepbySte_8E1F/image_6.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/helloworld/WindowsLiveWriter/ImplementingRESTfulServiceinWCFStepbySte_8E1F/image_thumb_2.png" original-url="https://blogs.msdn.com/blogfiles/helloworld/WindowsLiveWriter/ImplementingRESTfulServiceinWCFStepbySte_8E1F/image_thumb_2.png" width="863" height="179" /></a> </p>

<p>That’s it. Two simple steps, and you have a REST interface for your WCF service.</p>]]></content:encoded>
    </item>
    <item>
      <title>@BillGates</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/billgates</link>
      <pubDate>Tue, 19 Jan 2010 21:32:00 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2010/01/19/billgates/</guid>
      <description><![CDATA[I just found out that Bill Gates joins Twitter (link), and also has a facebook account (link).]]></description>
      <content:encoded><![CDATA[I just found out that Bill Gates joins Twitter (<A title=@billgates href="https://twitter.com/BillGates" target=_blank mce_href="https://twitter.com/BillGates">link</A>), and also has a facebook account (<A title=https://www.facebook.com/BillGates href="https://www.facebook.com/BillGates" mce_href="https://www.facebook.com/BillGates">link</A>).]]></content:encoded>
    </item>
    <item>
      <title>Attaching an Event Handler</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/attaching-an-event-handler</link>
      <pubDate>Wed, 30 Sep 2009 18:25:00 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2009/09/30/attaching-an-event-handler/</guid>
      <description><![CDATA[Whenever I need to attach an event handler, usually I use one of these methods, a delegate,...]]></description>
      <content:encoded><![CDATA[<p>Whenever I need to attach an event handler, usually I use one of these methods, a delegate, anonymous method, or lambda expression.</p>  <p>For complex events (more than 3 lines of code), I create a separate method. If the method is short, I use anonymous method. But if the event is just one line, I use lambda expression.</p>  <pre class="code"><span style="color: blue">private void </span>button1_Click(<span style="color: blue">object </span>sender, <span style="color: #2b91af">EventArgs </span>e)
{
    <span style="color: #2b91af">MessageBox</span>.Show(<span style="color: #a31515">&quot;Hello World!&quot;</span>);
}

<span style="color: blue">private void </span>Form1_Load(<span style="color: blue">object </span>sender, <span style="color: #2b91af">EventArgs </span>e)
{
    <span style="color: green">//This is good for complex events.
    </span>button1.Click += button1_Click;
    <span style="color: green">//Anonymous method, suitable for short event.
    </span>button2.Click += <span style="color: blue">delegate</span>(<span style="color: blue">object </span>obj, <span style="color: #2b91af">EventArgs </span>arg)
    {
        <span style="color: #2b91af">MessageBox</span>.Show(<span style="color: #a31515">&quot;Hello World!&quot;</span>);
    };
    <span style="color: green">//Lambda expression, great for one line event.
    </span>button3.Click += ((x, y) =&gt; <span style="color: #2b91af">MessageBox</span>.Show(<span style="color: #a31515">&quot;Hello World!&quot;</span>));
}</pre>
<a href="https://11011.net/software/vspaste"></a>]]></content:encoded>
    </item>
    <item>
      <title>How to Give Authenticated Users or Everyone Access to Your Share Programmatically</title>
      <link>https://docs.microsoft.com/archive/blogs/helloworld/how-to-give-authenticated-users-or-everyone-access-to-your-share-programmatically</link>
      <pubDate>Mon, 13 Jul 2009 12:41:40 GMT</pubDate>
      <dc:creator><![CDATA[YouHadMeAtHelloWorld]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/helloworld/2009/07/13/how-to-give-authenticated-users-or-everyone-access-to-your-share-programmatically/</guid>
      <description><![CDATA[Another follow-up from my previous article, Programmatically Configuring Permissions on a Share,...]]></description>
      <content:encoded><![CDATA[<p>Another follow-up from my previous article, <a href="https://blogs.msdn.com/helloworld/archive/2008/06/06/programmatically-configuring-permissions-on-a-share-in-c.aspx">Programmatically Configuring Permissions on a Share</a>, David B asked a question, how to share a folder to Everyone, instead of to a specific users. This article will answer that question, based on the code on my previous article.</p>  <p>That is an interesting question, since ‘Everyone’ can be replaced with ‘Authenticated Users’, ‘Network Service’, etc.</p>  <p>First, if you need only to give Everyone read-only access permission, the easiest thing is to set the DACL property of Win32_SecurityDescriptor to null. This is not equal with an array of null. An array of null will lock everyone out from this share.</p>  <pre class="code"><span style="color: #2b91af">ManagementObject </span>secDescriptor = <span style="color: blue">new </span><span style="color: #2b91af">ManagementClass</span>(<span style="color: blue">new </span><span style="color: #2b91af">ManagementPath</span>(<span style="color: #a31515">&quot;Win32_SecurityDescriptor&quot;</span>), <span style="color: blue">null</span>);
secDescriptor[<span style="color: #a31515">&quot;ControlFlags&quot;</span>] = 4; <span style="color: green">//SE_DACL_PRESENT 
</span>secDescriptor[<span style="color: #a31515">&quot;DACL&quot;</span>] = <span style="color: blue">null</span>; </pre>
<a href="https://11011.net/software/vspaste"></a>

<p>If you need to be more explicit, or you need to assign other security principal different access, that method above will not work. As soon as you assign someone access to the share, ‘Everyone’ will lose its read access.</p>

<p>To assign the permission explicitly, the key is to form the correct Win32_Trustee to represent that special account (Network Service, Everyone, Authenticated Users, etc.). Take a look at <a href="https://msdn.microsoft.com/en-us/library/system.security.principal.genericprincipal.aspx">System.Security.Principal.WellKnownSidType</a> enum. It has a number of well known sid that you might be interested with.</p>

<p>What needs to be done is to assign the SID property of the Win32_Trustee object with the security identifier derived from the well known sid.</p>

<p>Let assume you have this method:</p>

<pre class="code"><span style="color: blue">private byte</span>[] GetWellKnwonSid(<span style="color: #2b91af">WellKnownSidType </span>SidType)
{
    <span style="color: #2b91af">SecurityIdentifier </span>Result = <span style="color: blue">new </span><span style="color: #2b91af">SecurityIdentifier</span>(SidType, <span style="color: blue">null</span>);
    <span style="color: blue">byte</span>[] sidArray = <span style="color: blue">new byte</span>[Result.BinaryLength];
    Result.GetBinaryForm(sidArray, 0);

    <span style="color: blue">return </span>sidArray;
}</pre>
<a href="https://11011.net/software/vspaste"></a>

<p>Then when Win32_Trustee object is created, assign the SID property as follow:</p>

<pre class="code"><span style="color: #2b91af">ManagementObject </span>Trustee = <span style="color: blue">new </span><span style="color: #2b91af">ManagementClass</span>(<span style="color: blue">new </span><span style="color: #2b91af">ManagementPath</span>(<span style="color: #a31515">&quot;Win32_Trustee&quot;</span>), <span style="color: blue">null</span>);
Trustee[<span style="color: #a31515">&quot;SID&quot;</span>] = GetWellKnwonSid(<span style="color: #2b91af">WellKnownSidType</span>.WorldSid); </pre>
<a href="https://11011.net/software/vspaste"></a>

<p>That code above will create Win32_Trustee for ‘Everyone’. Use this Win32_Trustee to form the Win32_Ace, and you now explicitly assign ‘Everyone’ access to your share.</p>]]></content:encoded>
    </item>
  </channel>
</rss>