<?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>Santomania</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/asanto/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/asanto/feed.xml</link>
    <description>Addy Santo&amp;#039;s occasional braindumps</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:17:35 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Introducing Shelly</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/introducing-shelly</link>
      <pubDate>Wed, 21 Jun 2006 19:11:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2006/06/21/introducing-shelly/</guid>
      <description><![CDATA[Say hello to the new face which is rocking my world:

Her name is Shelly.
Update:&nbsp; A Shelly...]]></description>
      <content:encoded><![CDATA[<P><FONT face=Arial>Say hello to the new face which is rocking my world:</FONT></P>
<P><FONT face=Arial><IMG src="https://www.addysanto.com/shelly/inoproom1.jpg" width="80%"></FONT></P>
<P><FONT face=Arial>Her name is Shelly.</FONT></P>
<P><FONT face=Arial><STRONG>Update:</STRONG>&nbsp; A Shelly Santo fanclub is now up @ </FONT><A href="https://shellysanto.spaces.msn.com"><FONT face=Arial>https://shellysanto.spaces.msn.com</FONT></A></P>
<P>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>LINQ at the NYC Code Camp this Saturday</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/linq-at-the-nyc-code-camp-this-saturday</link>
      <pubDate>Thu, 23 Feb 2006 15:54:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2006/02/23/linq-at-the-nyc-code-camp-this-saturday/</guid>
      <description><![CDATA[I'll be delivering my famous (ok, not really) "LINQ &amp; C# 3.0 For Mere Mortals" presentation at...]]></description>
      <content:encoded><![CDATA[<P>I'll be delivering my famous (ok, not really) "LINQ &amp; C# 3.0 For Mere Mortals" presentation at the <A href="https://nyc.codecamp.us/">NYC Code Camp</A> this Saturday.&nbsp; For those who haven't registered yet- unfortunately the code camp registration is already full , but another one is already being planned, so don't despair :)</P>
<P>During the presentation I will take a simple real-world&nbsp;application &nbsp;in&nbsp;C#&nbsp;v1.1,&nbsp; port it to C# 2.0, and then to 3.0.&nbsp; Along the way I'll discuss the strengths and weaknesses of the previous and current versions, and also introduce the incredible new features appearing in C# 3.0 and LINQ.&nbsp;&nbsp; By the time the pizza arrives, we will have condensed about 300+ lines of code down into a single one, while also adding some functionality along the way.&nbsp; It should be an interesting presentation!</P>
<P>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>[OT] 0 Items!</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/ot-0-items</link>
      <pubDate>Sun, 12 Feb 2006 00:45:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2006/02/12/ot-0-items/</guid>
      <description><![CDATA[Kirk Allen Evan&nbsp;inspired me to finally take action on something which has been on my to-do list...]]></description>
      <content:encoded><![CDATA[<P><A HREF="/kaevans/archive/2006/02/11/530226.aspx">Kirk Allen Evan</A>&nbsp;inspired me to finally take action on something which has been on my to-do list for months - cleaning out my Inbox, which had (despite all my rules) grown to over 1200 items.&nbsp; It is strangely empowering to look at outlook and see:</P><IMG src="https://www.addysanto.com/blog/outlooknoitems.jpg"> 
<P>(Thanks <A HREF="/kaevans/archive/2006/02/11/530226.aspx">Kirk</A>&nbsp;for both the inspiration and the above image)</P>
<P>[OT] = Off Topic, no technical content here!</P>
<P>&nbsp;</P>
<P>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>[OT] Not enough music!</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/ot-not-enough-music</link>
      <pubDate>Tue, 07 Feb 2006 00:09:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2006/02/07/ot-not-enough-music/</guid>
      <description><![CDATA[I haven't been listening to music much lately, which must mean that I haven't been coding...]]></description>
      <content:encoded><![CDATA[<p>I haven't been listening to music much lately, which must mean that I haven't been coding enough&nbsp;either.&nbsp; Between Scrum-meistering the team, tweaking our infrastructure&nbsp;and&nbsp;completing a few lingering&nbsp;architecural tasks, &nbsp;I haven't had time to squeeze in any serious&nbsp;development work&nbsp;in days.&nbsp;&nbsp; </p>
<p>Oh well, thats what weekends are for, right?&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Anti-Agile development conference</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/anti-agile-development-conference</link>
      <pubDate>Mon, 06 Feb 2006 15:13:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2006/02/06/anti-agile-development-conference/</guid>
      <description><![CDATA[Agile developers should get a smile (at least) from https://www.waterfall2006.com/....]]></description>
      <content:encoded><![CDATA[<p>Agile developers should get a smile (at least) from <a href="https://www.waterfall2006.com/">https://www.waterfall2006.com/</a>. This&nbsp;anti-agile conference&nbsp;couldn't possibly go wrong, they already have it planned down to the smallest detail:</p>
<p><em>"Because it's possible you may want to attend all sessions, Waterfall 2006 features no concurrent sessions. All sessions are run sequentially for your enjoyment. However, since in a waterfall process we don't want testers to know anything about coding, or programmers to know anything about design, and so on, you can only attend sessions that match your job function. When you </em><a href="https://www.waterfall2006.com/register.html"><em>register to attend</em></a><em> you'll be asked to select an appropriate job function. When sessions that are not relevant to you are running you will be required to sit idle in the lobby. </em></p>
<p><em>The conference will also feature a number of workshops. Unlike typical conferences where workshops involve participants talking with each other, all Waterfall 2006 workshops will be conducted by document. Come to a workshop, open up your favorite word processor and state your opinion on something. Email it to other workshop participants. (We'll set up mailing list aliases for this--after all, we want to keep this process efficient!) Then just sit back and wait for someone to reply with their own document. Don't miss this opportunity to participate in vigorous written discussion with your peers."</em></p>
<p>Obviously, superior minds are at work here :-)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>GDI + LINQ = Generate a bar graph in a single line of code</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/gdi-linq-generate-a-bar-graph-in-a-single-line-of-code</link>
      <pubDate>Sun, 22 Jan 2006 19:18:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2006/01/22/gdi-linq-generate-a-bar-graph-in-a-single-line-of-code/</guid>
      <description><![CDATA[This is a simplified version of actual code from an app I'm working on.&nbsp; There are a few lines...]]></description>
      <content:encoded><![CDATA[<P><FONT face=Arial>This is a simplified version of actual code from an app I'm working on.&nbsp; There are a few lines of setup, and then the cool part (the last statement): Using a select statement to iterate over a <FONT size=2><FONT face="Courier New"><SPAN style="COLOR: teal">List</SPAN>&lt;<SPAN style="COLOR: blue">double</SPAN>&gt;</FONT></FONT>, creating a <SPAN style="COLOR: teal"><FONT face="Courier New" size=2>RectangleF </FONT></SPAN>object for each value, packaging them all into an Array, and passing the array to the <FONT face="Courier New" size=2>FillRectangles </FONT>method of the Graphics object.&nbsp; All in a single line of code...</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">// Get values to draw <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">private</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: teal">List</SPAN>&lt;<SPAN style="COLOR: blue">double</SPAN>&gt; performanceHistory = ReadPerformanceValues();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">// Get the Graphics object to draw on<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">Bitmap</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> bmp = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: teal">Bitmap</SPAN>(dimensions.Width,dimensions.Height);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">Graphics</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> canvas =<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: teal">Graphics</SPAN>.FromImage(bmp); <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">// Scale the Graphics object according to the # of values<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">canvas.ScaleTransform(<SPAN style="COLOR: blue">this</SPAN>.Size.Width/ performanceHistory.Count,1 ); <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">// Create an array of RectangleF objects (one for each value) and pass them to FillRectangles<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">canvas.FillRectangles( <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">Brushes</SPAN>.Green, <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>performanceHistory.Select( (v,index) =&gt; <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: teal">RectangleF</SPAN>((<SPAN style="COLOR: blue">float</SPAN>)index, <SPAN style="COLOR: blue">this</SPAN>.Size.Height - (<SPAN style="COLOR: blue">float</SPAN>)v, 1F,<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">this</SPAN>.Size.Height)).ToArray()<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>);<o:p></o:p></SPAN></P>
<P>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Code Snippet:  Setting NTFS permissions</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/code-snippet-setting-ntfs-permissions</link>
      <pubDate>Sun, 22 Jan 2006 18:36:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2006/01/22/code-snippet-setting-ntfs-permissions/</guid>
      <description><![CDATA[My previous post shows how to use Windows32.Security to read and set permissions to the...]]></description>
      <content:encoded><![CDATA[<P><FONT face=Arial size=2>My previous post shows how to use </FONT><A href="https://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9"><FONT face=Arial size=2>Windows32.Security</FONT></A><FONT face=Arial size=2> to read and set permissions to the registry.&nbsp; Doing the same for a&nbsp;NTFS is even simpler:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: blue">bool</SPAN> TestNTFSPermissions(<SPAN style="COLOR: blue">string</SPAN> path, <SPAN style="COLOR: blue">string</SPAN> userName)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SecurityDescriptor secDesc = SecurityDescriptor.GetFileSecurity(path, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Dacl dacl = secDesc.Dacl;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> TestAcl(dacl, userName); <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: blue">void</SPAN> SetNTFSPermissions(<SPAN style="COLOR: blue">string</SPAN> path, <SPAN style="COLOR: blue">string</SPAN> userName)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SecurityDescriptor secDesc = SecurityDescriptor.GetFileSecurity(path, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Dacl dacl = secDesc.Dacl;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Sid sidUser = <SPAN style="COLOR: blue">new</SPAN> Sid (userName);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// allow: folder, subfolder and files<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>dacl.AddAce (<SPAN style="COLOR: blue">new</SPAN> AceAccessAllowed (sidUser, <FONT style="BACKGROUND-COLOR: #ff0000">AccessType.GENERIC_ALL</FONT>, AceFlags.OBJECT_INHERIT_ACE | AceFlags.CONTAINER_INHERIT_ACE));<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>secDesc.SetDacl(dacl);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>secDesc.SetFileSecurity(path, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION);<SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}</SPAN></P>
<P><FONT face=Arial size=2>There is one caviat - I couldn't find a way to automagically apply a setting to a folder and recursively to all the subfolders &amp; files. The following snippet takes care of that:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: blue">void</SPAN> SetRecursiveNTFSPermissions(<SPAN style="COLOR: blue">string</SPAN> path, <SPAN style="COLOR: blue">string</SPAN> userName)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SetNTFSPermissions(path,userName);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">foreach</SPAN>(<SPAN style="COLOR: blue">string</SPAN> file <SPAN style="COLOR: blue">in</SPAN> Directory.GetFiles(path))<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SetNTFSPermissions(file,userName);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">foreach</SPAN>(<SPAN style="COLOR: blue">string</SPAN> dir <SPAN style="COLOR: blue">in</SPAN> Directory.GetDirectories(path))<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>SetRecursiveNTFSPermissions(dir,userName);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}</SPAN></P>
<P>
<P>&nbsp;</P></P>]]></content:encoded>
    </item>
    <item>
      <title>Code Snippet:  Working with Permissions (ACLs/ACEs) in C# under .Net 1.1</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/code-snippet-working-with-permissions-aclsaces-in-c-under-net-1-1</link>
      <pubDate>Sun, 22 Jan 2006 17:27:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2006/01/22/code-snippet-working-with-permissions-aclsaces-in-c-under-net-1-1/</guid>
      <description><![CDATA[I've been working lately on adding "self-healing" capabilities to a certain application.&nbsp; The...]]></description>
      <content:encoded><![CDATA[<P><FONT face=Arial size=2>I've been working lately on adding "self-healing" capabilities to a certain application.&nbsp; The idea is to create a set of utility functions which will validate (and fix if needed) various environmental settings such as NTFS permissions, registry permissions, IIS metabase settings, etc.&nbsp; None if this is rocket science but there still was some work involved in bringing it all together, so I'll list it here in case I (or you) ever need to do it in the future.</FONT></P>
<P><FONT face=Arial size=2>Note: For anything related to security in 1.1, the </FONT><A href="https://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9"><FONT face=Arial size=2>Windows32.Security library&nbsp;</FONT></A><FONT face=Arial size=2>&nbsp;(written by Renaud Paquay) is an indispensable resource. </FONT></P>
<P><STRONG><FONT face=Arial size=2>Snippet #1:&nbsp;&nbsp; Check for permissions on a registry key (using </FONT></STRONG><A href="https://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9"><STRONG><FONT face=Arial size=2>Windows32.Security</FONT></STRONG></A><STRONG><FONT face=Arial size=2>)</FONT></STRONG> </P><PRE class=csharpcode><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: blue">bool</SPAN> TestRegistryKeyPermissions(<SPAN style="COLOR: blue">string</SPAN> keyName, <SPAN style="COLOR: blue">string</SPAN> userName)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// get a handle to the key <o:p></o:p></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>IntPtr hKey; <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (Microsoft.Win32.Security.Win32.RegOpenKey(Win32Consts.HKEY_LOCAL_MACHINE, keyName, <SPAN style="COLOR: blue">out</SPAN> hKey) != Microsoft.Win32.Security.Win32.SUCCESS) <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">false</SPAN>;<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">try</SPAN> <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// get the security descriptor <o:p></o:p></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">using</SPAN> (SecurityDescriptor sd = SecurityDescriptor.GetRegistryKeySecurity (hKey, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION)) <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// check whether the specified user has an ACE in the ACL <o:p></o:p></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Dacl acl = sd.Dacl; <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> TestAcl(acl,userName);<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">catch<o:p></o:p></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">false</SPAN>;<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}</SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"></SPAN>&nbsp;</P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"></SPAN><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: blue">bool</SPAN> TestAcl(Dacl acl, <SPAN style="COLOR: blue">string</SPAN> userName) <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">for</SPAN>(<SPAN style="COLOR: blue">int</SPAN> i=0; i&lt;acl.AceCount;i++)<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Ace ace= acl.GetAce(i);<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (ace.Sid.AccountName == userName) <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">true</SPAN>;<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> <SPAN style="COLOR: blue">false</SPAN>;<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><FONT face="Times New Roman">&nbsp;</FONT></P><P><STRONG><FONT face=Arial>Snippet #2:&nbsp;&nbsp; Set permissions on a registry key (using </FONT></STRONG><A href="https://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9"><STRONG><FONT face=Arial>Windows32.Security</FONT></STRONG></A><FONT face=Arial><STRONG>)</STRONG> </FONT></P><P>&nbsp;</P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: blue">void</SPAN> SetRegistryKeyPermissions(<SPAN style="COLOR: blue">string</SPAN> keyName, <SPAN style="COLOR: blue">string</SPAN> userName)<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// get a handle to the key <o:p></o:p></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>IntPtr hKey; <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (Microsoft.Win32.Security.Win32.RegOpenKey(Win32Consts.HKEY_LOCAL_MACHINE, keyName, <SPAN style="COLOR: blue">out</SPAN> hKey) != Microsoft.Win32.Security.Win32.SUCCESS) <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">throw</SPAN> <SPAN style="COLOR: blue">new</SPAN> Exception ("failed to access registry key " + keyName); <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">try</SPAN> <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// get the security descriptor <o:p></o:p></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">using</SPAN> (SecurityDescriptor sd = SecurityDescriptor.GetRegistryKeySecurity (hKey, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION)) <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// give the service user standard read access. <o:p></o:p></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Dacl acl = sd.Dacl; <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Sid serviceUserSID = <SPAN style="COLOR: blue">new</SPAN> Sid(userName); <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>acl.RemoveAces (serviceUserSID); <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>AccessType aclAccessType =<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><FONT style="BACKGROUND-COLOR: #ff0000">AccessType.GENERIC_ALL</FONT> ;<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>acl.AddAce (<SPAN style="COLOR: blue">new</SPAN> AceAccessAllowed (serviceUserSID, aclAccessType , AceFlags.OBJECT_INHERIT_ACE | AceFlags.CONTAINER_INHERIT_ACE));<o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// set the values <o:p></o:p></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>sd.SetDacl(acl); <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>sd.SetRegistryKeySecurity (hKey, SECURITY_INFORMATION.DACL_SECURITY_INFORMATION); <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">finally</SPAN> <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Microsoft.Win32.Security.Win32.RegCloseKey (hKey); <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} <o:p></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}<o:p></o:p></SPAN></P><P>&nbsp;</P><P>&nbsp;</P></PRE>]]></content:encoded>
    </item>
    <item>
      <title>[OT] Coolest 360 upgrade yet (might be a bit pricey though)</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/ot-coolest-360-upgrade-yet-might-be-a-bit-pricey-though</link>
      <pubDate>Thu, 29 Dec 2005 08:37:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2005/12/29/ot-coolest-360-upgrade-yet-might-be-a-bit-pricey-though/</guid>
      <description><![CDATA[https://www.microsoft.com/presspass/press/2005/dec05/12-27URGE360PR.mspx
"Conceived by Nissan Design...]]></description>
      <content:encoded><![CDATA[<P><A href="https://www.microsoft.com/presspass/press/2005/dec05/12-27URGE360PR.mspx">https://www.microsoft.com/presspass/press/2005/dec05/12-27URGE360PR.mspx</A></P>
<P><EM>"Conceived by Nissan Design America Inc. (NDA) and equipped with the Xbox 360™ next-generation video game and entertainment system from Microsoft, the Nissan URGE concept car allows drivers (while parked) to play “Project Gotham Racing<SUP>®</SUP> 3” using the car’s own steering wheel, gas pedal and brake pedal while viewing the game on a flip-down seven-inch LCD screen. “PGR<SUP>®</SUP> 3” is developed exclusively for Xbox 360 by Bizarre Creations Ltd. for Microsoft Game Studios."</EM></P>
<P>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Something really was wrong with Google's original PageRank...</title>
      <link>https://docs.microsoft.com/archive/blogs/asanto/something-really-was-wrong-with-googles-original-pagerank</link>
      <pubDate>Fri, 16 Dec 2005 22:45:00 GMT</pubDate>
      <dc:creator><![CDATA[Addys]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/asanto/2005/12/16/something-really-was-wrong-with-googles-original-pagerank/</guid>
      <description><![CDATA[... and this guy put his finger on it:&nbsp;&nbsp; 

Something is Wrong with Google's Mathematical...]]></description>
      <content:encoded><![CDATA[... and this guy put his finger on it:&nbsp;&nbsp; <br>
<br>
<a href="https://www2.mta.ac.il/%7Ehillel/data_mining/faults_of_PageRank.pdf">Something is Wrong with Google's Mathematical Model</a>&nbsp;  <br>
<br>
(Math alert: Eigenvalue problems and general hilary ensue).<br>
<br>
<br>
<br>
<br>
<br>
]]></content:encoded>
    </item>
  </channel>
</rss>