<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>biader.it - .net</title>
    <link>http://www.biader.it/</link>
    <description>Su .net, C#, ...</description>
    <language>en-us</language>
    <copyright>Luca Biader Ceipidor</copyright>
    <lastBuildDate>Thu, 06 Aug 2009 04:44:10 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>luca@biader.it</managingEditor>
    <webMaster>luca@biader.it</webMaster>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=7e6829f8-5a29-4e66-a68e-595189dd5656</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,7e6829f8-5a29-4e66-a68e-595189dd5656.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,7e6829f8-5a29-4e66-a68e-595189dd5656.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=7e6829f8-5a29-4e66-a68e-595189dd5656</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Un buona documentazione (non ufficiale) sulla libreria per l'implementazione della
Dependency Injection su tecnologia Microsoft "ObjectBuilder", utilizzata in svariati
application blocks si può trovare qui: 
<br /><a href="http://www.sayedhashimi.com/CategoryView,category,ObjectBuilder.aspx">http://www.sayedhashimi.com/CategoryView,category,ObjectBuilder.aspx</a><br />
Enjoy, 
<br />
Luc. 
</p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=7e6829f8-5a29-4e66-a68e-595189dd5656" />
      </body>
      <title>Object Builder e Dependency Injection</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,7e6829f8-5a29-4e66-a68e-595189dd5656.aspx</guid>
      <link>http://www.biader.it/2009/08/06/ObjectBuilderEDependencyInjection.aspx</link>
      <pubDate>Thu, 06 Aug 2009 04:44:10 GMT</pubDate>
      <description>&lt;p&gt;
Un buona documentazione (non ufficiale) sulla libreria per l'implementazione della
Dependency Injection su tecnologia Microsoft "ObjectBuilder", utilizzata in svariati
application blocks si può trovare qui: 
&lt;br /&gt;
&lt;a href="http://www.sayedhashimi.com/CategoryView,category,ObjectBuilder.aspx"&gt;http://www.sayedhashimi.com/CategoryView,category,ObjectBuilder.aspx&lt;/a&gt; 
&lt;br /&gt;
Enjoy, 
&lt;br /&gt;
Luc. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=7e6829f8-5a29-4e66-a68e-595189dd5656" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,7e6829f8-5a29-4e66-a68e-595189dd5656.aspx</comments>
      <category>.net</category>
      <category>C#</category>
      <category>Dependency Injection</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=c87d69eb-bf53-4289-81af-8fb2ffc51174</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,c87d69eb-bf53-4289-81af-8fb2ffc51174.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,c87d69eb-bf53-4289-81af-8fb2ffc51174.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=c87d69eb-bf53-4289-81af-8fb2ffc51174</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
All'indirizzo: 
</p>
        <p>
          <a href="http://msdn.microsoft.com/en-us/library/ms733768.aspx">http://msdn.microsoft.com/en-us/library/ms733768.aspx</a>
        </p>
        <p>
si può trovare un articolo interessante che spiega come configurare windows per permettere
l'hosting di un servizio wcf su protocollo http. Un esempio al volo: 
</p>
        <p>
(impostazione dell'ip in ascolto)
</p>
        <p>
netsh http add iplisten ipaddress=0.0.0.0:8001 
</p>
        <p>
(impostazione delle acl sull'url per utente)
</p>
        <p>
netsh http add urlacl url=http://+:8001/VirtualDir user=MYCOMPUTER\User 
</p>
        <p>
Enjoy, Luc.
</p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=c87d69eb-bf53-4289-81af-8fb2ffc51174" />
      </body>
      <title>Impostare un servizio self-hosted su http</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,c87d69eb-bf53-4289-81af-8fb2ffc51174.aspx</guid>
      <link>http://www.biader.it/2009/06/21/ImpostareUnServizioSelfhostedSuHttp.aspx</link>
      <pubDate>Sun, 21 Jun 2009 20:07:45 GMT</pubDate>
      <description>&lt;p&gt;
All'indirizzo: 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/ms733768.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms733768.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
si può trovare un articolo interessante che spiega come configurare windows per permettere
l'hosting di un servizio wcf su protocollo http. Un esempio al volo: 
&lt;/p&gt;
&lt;p&gt;
(impostazione dell'ip in ascolto)
&lt;/p&gt;
&lt;p&gt;
netsh http add iplisten ipaddress=0.0.0.0:8001 
&lt;/p&gt;
&lt;p&gt;
(impostazione delle acl sull'url per utente)
&lt;/p&gt;
&lt;p&gt;
netsh http add urlacl url=http://+:8001/VirtualDir user=MYCOMPUTER\User 
&lt;/p&gt;
&lt;p&gt;
Enjoy, Luc.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=c87d69eb-bf53-4289-81af-8fb2ffc51174" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,c87d69eb-bf53-4289-81af-8fb2ffc51174.aspx</comments>
      <category>.net</category>
      <category>SOA</category>
      <category>WCF</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=a7e59bec-55ac-4754-9b16-da724c3e4d3a</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,a7e59bec-55ac-4754-9b16-da724c3e4d3a.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,a7e59bec-55ac-4754-9b16-da724c3e4d3a.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=a7e59bec-55ac-4754-9b16-da724c3e4d3a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font face="Courier New">Leggo di un interessante progetto denominato Stonehenge:</font>
        </p>
        <p>
          <a href="http://incubator.apache.org/stonehenge/index.html">
            <font face="Courier New">http://incubator.apache.org/stonehenge/index.html</font>
          </a>
        </p>
        <p>
          <font face="Courier New">A cui partecipano Microsoft, Red Hat, Eviware, WSO2 ed altri.
Il tema è l'interoperabilità dei sistemi in ambito SOA. Sono fornite delle best-practices
su tecnologia java, .NET, php.</font>
        </p>
        <p>
          <font face="Courier New">Gli obbiettivi ?</font>
        </p>
        <span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 16px 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span">
          <span style="FONT-FAMILY: Verdana; FONT-SIZE: 13px" class="Apple-style-span">
            <ul>
              <li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
                <font size="2" face="Courier New">illustrare e sviluppare linee guida per
l'interoperabilità delle applicazioni; </font>
              </li>
              <li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
                <font size="2" face="Courier New">dimostrare l'interoperabilità fra le piattaforme; </font>
              </li>
              <li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
                <font size="2" face="Courier New">fornire degli esempi da cui partire per implementare
applicazioni; </font>
              </li>
              <li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
                <font size="2" face="Courier New">fornire un aiuto per identificare i problemi di
interoperabilità e le rispettive soluzioni; </font>
              </li>
              <li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
                <font size="2" face="Courier New">ottenere fiducia nello sviluppo e deployment di
tecnologie SOA multi-piattaforma.</font>
              </li>
            </ul>
            <p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
              <font size="2" face="Courier New">Alcuni link interessanti:</font>
            </p>
            <p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
              <a href="http://wso2.com/">
                <font size="2" face="Courier New">http://wso2.com/</font>
              </a>
            </p>
            <p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
              <a href="http://www.eviware.com/">
                <font size="2" face="Courier New">http://www.eviware.com/</font>
              </a>
            </p>
            <p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
              <a href="http://www.microsoft.com/SOA/">
                <font size="2" face="Courier New">http://www.microsoft.com/SOA/</font>
              </a>
            </p>
            <p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
              <a href="http://www.jboss.com/products/platforms/soa/">
                <font size="2" face="Courier New">http://www.jboss.com/products/platforms/soa/</font>
              </a>
            </p>
            <p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
              <font size="2" face="Courier New">Enjoy,</font>
            </p>
            <p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px">
              <font size="2" face="Courier New">Luc.</font>
            </p>
          </span>
        </span>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=a7e59bec-55ac-4754-9b16-da724c3e4d3a" />
      </body>
      <title>Microsoft, Apache, et al. : Stonehenge</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,a7e59bec-55ac-4754-9b16-da724c3e4d3a.aspx</guid>
      <link>http://www.biader.it/2009/06/15/MicrosoftApacheEtAlStonehenge.aspx</link>
      <pubDate>Mon, 15 Jun 2009 09:54:14 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font face="Courier New"&gt;Leggo di un interessante progetto denominato Stonehenge:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://incubator.apache.org/stonehenge/index.html"&gt;&lt;font face="Courier New"&gt;http://incubator.apache.org/stonehenge/index.html&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;A cui partecipano Microsoft, Red Hat, Eviware, WSO2 ed altri.
Il tema è l'interoperabilità dei sistemi in ambito SOA. Sono fornite delle best-practices
su tecnologia java, .NET, php.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;Gli obbiettivi ?&lt;/font&gt;
&lt;/p&gt;
&lt;span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 16px 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class=Apple-style-span&gt;&lt;span style="FONT-FAMILY: Verdana; FONT-SIZE: 13px" class=Apple-style-span&gt; 
&lt;ul&gt;
&lt;li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;font size=2 face="Courier New"&gt;illustrare&amp;nbsp;e&amp;nbsp;sviluppare linee guida per
l'interoperabilità delle applicazioni; &lt;/font&gt; 
&lt;li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;font size=2 face="Courier New"&gt;dimostrare l'interoperabilità fra le piattaforme; &lt;/font&gt; 
&lt;li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;font size=2 face="Courier New"&gt;fornire degli esempi da cui partire per implementare
applicazioni; &lt;/font&gt; 
&lt;li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;font size=2 face="Courier New"&gt;fornire un aiuto per identificare i problemi di interoperabilità
e le rispettive soluzioni; &lt;/font&gt; 
&lt;li style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;font size=2 face="Courier New"&gt;ottenere fiducia nello sviluppo e deployment di tecnologie
SOA multi-piattaforma.&lt;/font&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;font size=2 face="Courier New"&gt;Alcuni link interessanti:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;a href="http://wso2.com/"&gt;&lt;font size=2 face="Courier New"&gt;http://wso2.com/&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;a href="http://www.eviware.com/"&gt;&lt;font size=2 face="Courier New"&gt;http://www.eviware.com/&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;a href="http://www.microsoft.com/SOA/"&gt;&lt;font size=2 face="Courier New"&gt;http://www.microsoft.com/SOA/&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;a href="http://www.jboss.com/products/platforms/soa/"&gt;&lt;font size=2 face="Courier New"&gt;http://www.jboss.com/products/platforms/soa/&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;font size=2 face="Courier New"&gt;Enjoy,&lt;/font&gt;
&lt;/p&gt;
&lt;p style="FONT-FAMILY: Verdana, Helvetica, Arial, sans-serif; FONT-SIZE: 13px"&gt;
&lt;font size=2 face="Courier New"&gt;Luc.&lt;/font&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=a7e59bec-55ac-4754-9b16-da724c3e4d3a" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,a7e59bec-55ac-4754-9b16-da724c3e4d3a.aspx</comments>
      <category>.net</category>
      <category>Biztalk</category>
      <category>SOA</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=1eadea49-8633-42f2-a6a9-c04fbb576e40</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,1eadea49-8633-42f2-a6a9-c04fbb576e40.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,1eadea49-8633-42f2-a6a9-c04fbb576e40.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=1eadea49-8633-42f2-a6a9-c04fbb576e40</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Interessante articolo che spiega come disabilitare il tracking di Biztalk ed utilizzare
BAM in sua vece:
</p>
        <p>
          <a href="http://blogical.se/blogs/mikael/archive/2008/05/22/how-to-replace-tracking-with-bam-in-biztalk.aspx">http://blogical.se/blogs/mikael/archive/2008/05/22/how-to-replace-tracking-with-bam-in-biztalk.aspx</a>
        </p>
        <p>
Utile a chi voglia implementare un sistema di analisi basato su <em>analysis services</em>.
</p>
        <p>
          <em>Luc.</em>
        </p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=1eadea49-8633-42f2-a6a9-c04fbb576e40" />
      </body>
      <title>Sostituire in Biztalk il tracking con BAM</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,1eadea49-8633-42f2-a6a9-c04fbb576e40.aspx</guid>
      <link>http://www.biader.it/2008/08/05/SostituireInBiztalkIlTrackingConBAM.aspx</link>
      <pubDate>Tue, 05 Aug 2008 14:35:15 GMT</pubDate>
      <description>&lt;p&gt;
Interessante articolo che spiega come disabilitare il tracking di Biztalk ed utilizzare
BAM in sua vece:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogical.se/blogs/mikael/archive/2008/05/22/how-to-replace-tracking-with-bam-in-biztalk.aspx"&gt;http://blogical.se/blogs/mikael/archive/2008/05/22/how-to-replace-tracking-with-bam-in-biztalk.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Utile a chi voglia implementare un sistema di analisi basato su &lt;em&gt;analysis services&lt;/em&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Luc.&lt;/em&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=1eadea49-8633-42f2-a6a9-c04fbb576e40" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,1eadea49-8633-42f2-a6a9-c04fbb576e40.aspx</comments>
      <category>.net</category>
      <category>SQL</category>
      <category>Biztalk</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=e2eb2ea6-894b-43d9-9228-e101da846a3c</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,e2eb2ea6-894b-43d9-9228-e101da846a3c.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,e2eb2ea6-894b-43d9-9228-e101da846a3c.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=e2eb2ea6-894b-43d9-9228-e101da846a3c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Mentre combattevo con application pool
di IIS, account Local System et cetera Andrea mi mette a parte di una interessante
serie di chiavi di registro, raccolte nel percorso:<br /><br />
           HKEY_LOCAL_MACHINE -&gt;
System -&gt; CurrentControlSet -&gt; Services -&gt; EventLog<br /><br />
sono tutti gli event sources definiti sulla macchina. Si possono assegnare dei premessi
alle chiavi in modo da non richiedere appartenenza al gruppo amministratori per la
modifica dei log e, di conseguenza, evitare di assegnare, anche se solo per la generazione
dell'eventSource, account <i>Local System</i> all'application pool.<br /><i>Luc.</i><br /><p></p><img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=e2eb2ea6-894b-43d9-9228-e101da846a3c" /></body>
      <title>Chiavi di registro per il log degli eventi ( EventLog ) di windows</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,e2eb2ea6-894b-43d9-9228-e101da846a3c.aspx</guid>
      <link>http://www.biader.it/2008/07/17/ChiaviDiRegistroPerIlLogDegliEventiEventLogDiWindows.aspx</link>
      <pubDate>Thu, 17 Jul 2008 09:51:04 GMT</pubDate>
      <description>Mentre combattevo con application pool di IIS, account Local System et cetera Andrea mi mette a parte di una interessante serie di chiavi di registro, raccolte nel percorso:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HKEY_LOCAL_MACHINE -&amp;gt;
System -&amp;gt; CurrentControlSet -&amp;gt; Services -&amp;gt; EventLog&lt;br&gt;
&lt;br&gt;
sono tutti gli event sources definiti sulla macchina. Si possono assegnare dei premessi
alle chiavi in modo da non richiedere appartenenza al gruppo amministratori per la
modifica dei log e, di conseguenza, evitare di assegnare, anche se solo per la generazione
dell'eventSource, account &lt;i&gt;Local System&lt;/i&gt; all'application pool.&lt;br&gt;
&lt;i&gt;Luc.&lt;/i&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=e2eb2ea6-894b-43d9-9228-e101da846a3c" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,e2eb2ea6-894b-43d9-9228-e101da846a3c.aspx</comments>
      <category>.net</category>
      <category>ASP.net</category>
      <category>C#</category>
      <category>VB</category>
      <category>web</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=d8287010-960c-4413-85ee-5f360da2b2e1</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,d8287010-960c-4413-85ee-5f360da2b2e1.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,d8287010-960c-4413-85ee-5f360da2b2e1.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=d8287010-960c-4413-85ee-5f360da2b2e1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A questo indirizzo:
</p>
        <p>
          <a href="http://www.codeproject.com/KB/cs/LogParser_DataProvider.aspx">http://www.codeproject.com/KB/cs/LogParser_DataProvider.aspx</a>
        </p>
        <p>
si può trovare un data provider custom per il logParser. Con esso si possono effettuare
le query con un formato simile a quello delle normali query SQL, sfruttando le
potenzialità di ADO.NET.
</p>
        <p>
Luc.
</p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=d8287010-960c-4413-85ee-5f360da2b2e1" />
      </body>
      <title>DataProvider per LogParser</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,d8287010-960c-4413-85ee-5f360da2b2e1.aspx</guid>
      <link>http://www.biader.it/2008/05/26/DataProviderPerLogParser.aspx</link>
      <pubDate>Mon, 26 May 2008 15:05:52 GMT</pubDate>
      <description>&lt;p&gt;
A questo indirizzo:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeproject.com/KB/cs/LogParser_DataProvider.aspx"&gt;http://www.codeproject.com/KB/cs/LogParser_DataProvider.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
si può trovare un data provider custom per il logParser. Con esso si possono effettuare
le query con un formato simile a quello delle normali query&amp;nbsp;SQL, sfruttando le
potenzialità di ADO.NET.
&lt;/p&gt;
&lt;p&gt;
Luc.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=d8287010-960c-4413-85ee-5f360da2b2e1" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,d8287010-960c-4413-85ee-5f360da2b2e1.aspx</comments>
      <category>.net</category>
      <category>C#</category>
      <category>scripts</category>
      <category>tools</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=93dde43a-44a9-4ebc-bb7d-6160678e5541</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,93dde43a-44a9-4ebc-bb7d-6160678e5541.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,93dde43a-44a9-4ebc-bb7d-6160678e5541.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=93dde43a-44a9-4ebc-bb7d-6160678e5541</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
L'infrastruttura WMI (Windows Management Instrumentation) permette, tra le altre cose,
una volta definito lo schema di una classe, di instanziarne a runtime delle istanze.
Tale operazione può essere effettuata tramite script wsh oppure sfruttando le classi
presenti nei namespace <em>System.Management</em> e <em>System.Management.Instrumentation</em>.
</p>
        <p>
Anzitutto è necessario istanziare un oggetto della classe <em>ManagementPath</em>,
che identifica la classe da considerare:
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">            ManagementPath
pathObj <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> ManagementPath();
                         pathObj.ClassName <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Win32_IP4RouteTable"</span>;
            pathObj.NamespacePath <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"root\\CimV2"</span>;</span>
        </pre>
        <p>
In questo caso si tratta di una route ip.
</p>
        <p>
Deve essere poi creata l'istanza di classe:
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">            ManagementScope
mgmtScope <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> ManagementScope(pathObj);
            ManagementClass
routeTableClass <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> ManagementClass(mgmtScope,
pathObj, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>);
            ManagementObject
routeTableObj <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> routeTableClass.CreateInstance();</span>
        </pre>
        <p>
Sulla quale viene effettuata l'impostazione delle proprietà:
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">            routeTableObj.SetPropertyValue(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;prop_name&gt;"</span>,
&lt;prop_value&gt;);             ...</span>
        </pre>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" color="#003300" size="2">Ed
infine l'istanza viene salvata:</font>
          </span>
        </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <pre>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">            PutOptions
po <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> PutOptions();
            po.Type <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> PutType.UpdateOrCreate;
            routeTableObj.Put(po); </span>
          </pre>
          <p>
            <font face="Verdana" size="2">Luc.</font>
          </p>
        </span>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=93dde43a-44a9-4ebc-bb7d-6160678e5541" />
      </body>
      <title>WMI e creazione di istanze di classe</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,93dde43a-44a9-4ebc-bb7d-6160678e5541.aspx</guid>
      <link>http://www.biader.it/2008/05/26/WMIECreazioneDiIstanzeDiClasse.aspx</link>
      <pubDate>Mon, 26 May 2008 13:49:42 GMT</pubDate>
      <description>&lt;p&gt;
L'infrastruttura WMI (Windows Management Instrumentation) permette, tra le altre cose,
una volta definito lo schema di una classe, di instanziarne a runtime delle istanze.
Tale operazione può essere effettuata tramite script wsh oppure sfruttando le classi
presenti nei namespace &lt;em&gt;System.Management&lt;/em&gt; e &lt;em&gt;System.Management.Instrumentation&lt;/em&gt;.
&lt;/p&gt;
&lt;p&gt;
Anzitutto è necessario istanziare un oggetto della classe &lt;em&gt;ManagementPath&lt;/em&gt;,
che identifica la classe da considerare:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ManagementPath
pathObj &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ManagementPath();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pathObj.ClassName &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Win32_IP4RouteTable"&lt;/span&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pathObj.NamespacePath &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"root\\CimV2"&lt;/span&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
In questo caso si tratta di una route ip.
&lt;/p&gt;
&lt;p&gt;
Deve essere poi creata l'istanza di classe:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ManagementScope
mgmtScope &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ManagementScope(pathObj);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ManagementClass
routeTableClass &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ManagementClass(mgmtScope,
pathObj, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ManagementObject
routeTableObj &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; routeTableClass.CreateInstance();&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Sulla quale viene effettuata l'impostazione delle proprietà:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;routeTableObj.SetPropertyValue(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"&amp;lt;prop_name&amp;gt;"&lt;/span&gt;,
&amp;lt;prop_value&amp;gt;); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;Ed
infine l'istanza viene salvata:&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PutOptions
po &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; PutOptions();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;po.Type &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; PutType.UpdateOrCreate;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;routeTableObj.Put(po); &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;font face=Verdana size=2&gt;Luc.&lt;/font&gt;
&lt;/span&gt;&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=93dde43a-44a9-4ebc-bb7d-6160678e5541" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,93dde43a-44a9-4ebc-bb7d-6160678e5541.aspx</comments>
      <category>.net</category>
      <category>C#</category>
      <category>networks</category>
      <category>scripts</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=3970b641-4c12-4030-ba68-d9147d9f443a</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,3970b641-4c12-4030-ba68-d9147d9f443a.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,3970b641-4c12-4030-ba68-d9147d9f443a.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=3970b641-4c12-4030-ba68-d9147d9f443a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A volte può essere utile cambiare l'account con cui si esegue una porzione di codice,
p.es. per ottenere dei livelli di trust più elevati. Si possono:
</p>
        <ul>
          <li>
Utilizzare <em>credenziali di rete </em>differenti; 
</li>
          <li>
Acquisire le credenziali di <em>account differenti.</em></li>
        </ul>
        <p>
Il primo caso è più comune in applicazioni che fanno uso di servizi sulla rete (accedono
a pagine web o servizi web) ma che eseguono la maggior parte delle operazioni in locale.
In tal caso una <em>impersonation</em> completa potrebbe essere inopportuna (l'utente
di rete potrebbe non possedere permessi importanti in locale, come p.es. l'accesso
al filesystem per salvare dei file). Si instanzia in questo caso la classe <em>NetworkCredentials</em>,
che viene utilizzata per la connessione.
</p>
        <p>
Il secondo caso si verifica quando un'applicazione ha necessità di acquisire dei permessi
specifici per breve tempo, come p.es. scrivere o leggere su una share di rete da un'applicazione
web che giri in un contesto utente non modificabile (p.es. un utenza NetworkService
di un'application pool, per ragioni di sicurezza). In tal caso è possibile acquisire
per breve tempo un contesto utente differente, eseguire delle operazioni ed infine
tornare al contesto di partenza utilizzando le API di sistema.
</p>
        <p>
Prima debbono essere dichiarati i metodi:
</p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <p>
            <br />
    [DllImport(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"advapi32.dll"</span>,
CharSet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> CharSet.Auto,
SetLastError <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>,
ExactSpelling <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>)] 
<br />
    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">extern</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> LogonUser(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> lpszUsername, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> lpszDomain, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> lpszPassword, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">uint</span> dwLogonType, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">uint</span> dwLogonProvider, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ref</span> IntPtr
phToken); 
<br />
    [DllImport(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"kernel32.dll"</span>,
CharSet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> CharSet.Ansi,
SetLastError <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>,
ExactSpelling <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>)] 
<br />
    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">extern</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">bool</span> CloseHandle(IntPtr
handle); <br />
    <br /></p>
        </span>Che verranno utilizzati per effettuare il logon e l'impersonation:
<pre><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> hresult <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> LogonUser(username,
domain, password, (<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">uint</span>)LogonSessionType.Interactive,
(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">uint</span>)LogonProvider.LogonDefault,
userToken);    WindowsIdentity identity <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> WindowsIdentity(userToken); </span></pre><pre><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   
WindowImpersonationContext context = identity.Impersonate;</span></pre><p>
Che può essere poi rilasciato:
</p><p>
     <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">context.Undo();</span></p><p>
Luc.
</p><a href="http://www.biader.it/public/contenuti/binari/Impersonator.zip">Impersonator.zip
(,83 KB)</a><img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=3970b641-4c12-4030-ba68-d9147d9f443a" /></body>
      <title>.NET e impersonation</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,3970b641-4c12-4030-ba68-d9147d9f443a.aspx</guid>
      <link>http://www.biader.it/2008/05/22/NETEImpersonation.aspx</link>
      <pubDate>Thu, 22 May 2008 16:15:40 GMT</pubDate>
      <description>&lt;p&gt;
A volte può essere utile cambiare l'account con cui si esegue una porzione di codice,
p.es. per ottenere dei livelli di trust più elevati.&amp;nbsp;Si possono:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Utilizzare &lt;em&gt;credenziali di rete &lt;/em&gt;differenti; 
&lt;li&gt;
Acquisire le credenziali di &lt;em&gt;account differenti.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Il primo caso è più comune in applicazioni che fanno uso di servizi sulla rete (accedono
a pagine web o servizi web) ma che eseguono la maggior parte delle operazioni in locale.
In tal caso una &lt;em&gt;impersonation&lt;/em&gt; completa potrebbe essere inopportuna (l'utente
di rete potrebbe non possedere permessi importanti in locale, come p.es. l'accesso
al filesystem per salvare dei file). Si instanzia in questo caso la classe &lt;em&gt;NetworkCredentials&lt;/em&gt;,
che viene utilizzata per la connessione.
&lt;/p&gt;
&lt;p&gt;
Il secondo caso si verifica quando un'applicazione ha necessità di acquisire dei permessi
specifici per breve tempo, come p.es. scrivere o leggere su una share di rete da un'applicazione
web che giri in un contesto utente non modificabile (p.es. un utenza NetworkService
di un'application pool, per ragioni di sicurezza). In tal caso è possibile acquisire
per breve tempo un contesto utente differente, eseguire delle operazioni ed infine
tornare al contesto di partenza utilizzando le API di sistema.
&lt;/p&gt;
&lt;p&gt;
Prima debbono essere dichiarati i metodi:
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; 
&lt;p&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [DllImport(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"advapi32.dll"&lt;/span&gt;,
CharSet &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; CharSet.Auto,
SetLastError &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;,
ExactSpelling &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;)] 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;extern&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; LogonUser(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; lpszUsername, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; lpszDomain, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; lpszPassword, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;uint&lt;/span&gt; dwLogonType, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;uint&lt;/span&gt; dwLogonProvider, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ref&lt;/span&gt; IntPtr
phToken); 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [DllImport(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"kernel32.dll"&lt;/span&gt;,
CharSet &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; CharSet.Ansi,
SetLastError &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;,
ExactSpelling &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;)] 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;extern&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;bool&lt;/span&gt; CloseHandle(IntPtr
handle);&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&lt;/span&gt;Che verranno utilizzati per effettuare il logon e l'impersonation:&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; hresult &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; LogonUser(username,
domain, password, (&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;uint&lt;/span&gt;)LogonSessionType.Interactive,
(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;uint&lt;/span&gt;)LogonProvider.LogonDefault,
userToken); &amp;nbsp;&amp;nbsp;&amp;nbsp;WindowsIdentity identity &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; WindowsIdentity(userToken); &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
WindowImpersonationContext context = identity.Impersonate;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Che può essere poi rilasciato:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;context.Undo();&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Luc.
&lt;/p&gt;
&lt;a href="http://www.biader.it/public/contenuti/binari/Impersonator.zip"&gt;Impersonator.zip
(,83 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=3970b641-4c12-4030-ba68-d9147d9f443a" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,3970b641-4c12-4030-ba68-d9147d9f443a.aspx</comments>
      <category>.net</category>
      <category>C#</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=b45f88e2-7886-4d11-9a75-b90eb358f7f6</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,b45f88e2-7886-4d11-9a75-b90eb358f7f6.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,b45f88e2-7886-4d11-9a75-b90eb358f7f6.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=b45f88e2-7886-4d11-9a75-b90eb358f7f6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Alcuni interessanti articoli trovati su un blog. Il primo spiega come creare uno snap-in
custom per mmc 3.0 con .net:
</p>
        <p>
          <a href="http://community.bartdesmet.net/blogs/bart/archive/2006/09/01/4384.aspx">A
managed code 'task manager' MMC 3.0 snap-in</a>
        </p>
        <p>
un altro, sullo stesso argomento ma in stile 'cook-book':
</p>
        <p>
          <a href="http://community.bartdesmet.net/blogs/bart/archive/2008/02/27/the-managed-mmc-3-0-snap-in-cookbook.aspx">The
managed MMC 3.0 snap-in cookbook</a>
        </p>
        <p>
ed infine un articolo su come creare un comando custom per la powershell:
</p>
        <p>
          <a href="http://community.bartdesmet.net/blogs/bart/archive/2008/02/03/easy-windows-powershell-cmdlet-development-and-debugging.aspx">Easy
Windows PowerShell cmdlet development and debugging</a>
        </p>
        <p>
il blog contiene parecchie informazioni. Da vedere.
</p>
        <p>
Luc.
</p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=b45f88e2-7886-4d11-9a75-b90eb358f7f6" />
      </body>
      <title>mmc e powershell</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,b45f88e2-7886-4d11-9a75-b90eb358f7f6.aspx</guid>
      <link>http://www.biader.it/2008/05/18/mmcEPowershell.aspx</link>
      <pubDate>Sun, 18 May 2008 09:53:03 GMT</pubDate>
      <description>&lt;p&gt;
Alcuni interessanti articoli trovati su un blog. Il primo spiega come creare uno snap-in
custom per mmc 3.0 con .net:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2006/09/01/4384.aspx"&gt;A
managed code 'task manager' MMC 3.0 snap-in&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
un altro, sullo stesso argomento ma in stile 'cook-book':
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/02/27/the-managed-mmc-3-0-snap-in-cookbook.aspx"&gt;The
managed MMC 3.0 snap-in cookbook&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
ed infine un articolo su come creare un comando custom per la powershell:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2008/02/03/easy-windows-powershell-cmdlet-development-and-debugging.aspx"&gt;Easy
Windows PowerShell cmdlet development and debugging&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
il&amp;nbsp;blog contiene parecchie informazioni. Da vedere.
&lt;/p&gt;
&lt;p&gt;
Luc.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=b45f88e2-7886-4d11-9a75-b90eb358f7f6" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,b45f88e2-7886-4d11-9a75-b90eb358f7f6.aspx</comments>
      <category>.net</category>
      <category>C#</category>
      <category>scripts</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=e0dff314-9eb4-4649-ac42-a4a28f8cf77e</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,e0dff314-9eb4-4649-ac42-a4a28f8cf77e.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,e0dff314-9eb4-4649-ac42-a4a28f8cf77e.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=e0dff314-9eb4-4649-ac42-a4a28f8cf77e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Ottimo sistema per la virtualizzazione dei servizi in ottica SOA. Lo si può trovare
all'indirizzo:
</p>
        <p>
          <a href="http://www.codeplex.com/servicesengine">http://www.codeplex.com/servicesengine</a>
        </p>
        <p>
Permette di importare servizi già esistenti e di ripubblicarne le operazioni,
opportunamente aggregate secondo l'opportunità, facilita il coordinamento delle risorse,
ne massimizza il riuso e consente di ridurre i tempi di messa in opera dei nuovi
servizi. 
</p>
        <p>
Di seguito alcune delle caratteristiche:
</p>
        <ol>
          <li>
Versioning Servizi; 
</li>
          <li>
Aggiornamento Servizi Legacy; 
</li>
          <li>
Service Policy Enforcement;</li>
        </ol>
        <p>
Veramente interessante.
</p>
        <p>
Luc.
</p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=e0dff314-9eb4-4649-ac42-a4a28f8cf77e" />
      </body>
      <title>MSE (Managed Service Engine)</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,e0dff314-9eb4-4649-ac42-a4a28f8cf77e.aspx</guid>
      <link>http://www.biader.it/2008/05/18/MSEManagedServiceEngine.aspx</link>
      <pubDate>Sun, 18 May 2008 08:54:52 GMT</pubDate>
      <description>&lt;p&gt;
Ottimo sistema per la virtualizzazione dei servizi in ottica SOA. Lo si può trovare
all'indirizzo:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/servicesengine"&gt;http://www.codeplex.com/servicesengine&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Permette di&amp;nbsp;importare servizi già esistenti&amp;nbsp;e di ripubblicarne le operazioni,
opportunamente aggregate secondo l'opportunità, facilita il coordinamento delle risorse,
ne massimizza il riuso e consente&amp;nbsp;di ridurre i tempi di messa in opera dei nuovi
servizi. 
&lt;/p&gt;
&lt;p&gt;
Di seguito alcune delle caratteristiche:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Versioning Servizi; 
&lt;li&gt;
Aggiornamento Servizi Legacy; 
&lt;li&gt;
Service Policy Enforcement;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Veramente interessante.
&lt;/p&gt;
&lt;p&gt;
Luc.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=e0dff314-9eb4-4649-ac42-a4a28f8cf77e" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,e0dff314-9eb4-4649-ac42-a4a28f8cf77e.aspx</comments>
      <category>.net</category>
      <category>SOA</category>
      <category>tools</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=7e93ba4d-47fc-4371-bc9f-34de4a55d715</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,7e93ba4d-47fc-4371-bc9f-34de4a55d715.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,7e93ba4d-47fc-4371-bc9f-34de4a55d715.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=7e93ba4d-47fc-4371-bc9f-34de4a55d715</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Programma molto utile per la scrittura di query WMI (Windows Management Instrumentation).
Si può scaricare da:
</p>
        <p>
          <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&amp;displaylang=en">WMI
Code Creator</a>
        </p>
        <p>
Una volta selezionata una classe di interesse, è possibile generare codice per invocarne
i metodi, le proprietà o gestirne gli eventi.
</p>
        <p>
Molto utile per lo sviluppo o per la creazione di script di amministrazione, eventualmente
in accoppiata con:
</p>
        <p>
          <a href="http://www.microsoft.com/downloads/details.aspx?familyid=09DFC342-648B-4119-B7EB-783B0F7D1178&amp;displaylang=en">Scriptomatic
2.0</a>
        </p>
        <p>
e con gli strumenti nella suite:
</p>
        <p>
          <a href="http://www.microsoft.com/downloads/details.aspx?familyid=6430F853-1120-48DB-8CC5-F2ABDC3ED314&amp;displaylang=en">WMI
Administrative Tools</a>
        </p>
        <p>
tra cui CIM Studio e WMI Object Browser.
</p>
        <p>
Preinstallati nel sistema si trovano inoltre, normalmente, i tools <em>WBemTest.exe</em>,
per effettuare delle interrogazioni di prova e <em>Wmic.exe</em>, per eseguire delle
query da riga di comando.
</p>
        <p>
Luc.
</p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=7e93ba4d-47fc-4371-bc9f-34de4a55d715" />
      </body>
      <title>WMI Code Creator</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,7e93ba4d-47fc-4371-bc9f-34de4a55d715.aspx</guid>
      <link>http://www.biader.it/2008/05/16/WMICodeCreator.aspx</link>
      <pubDate>Fri, 16 May 2008 18:03:57 GMT</pubDate>
      <description>&lt;p&gt;
Programma molto utile per la scrittura di query WMI (Windows Management Instrumentation).
Si può scaricare da:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&amp;amp;displaylang=en"&gt;WMI
Code Creator&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Una volta selezionata una classe di interesse, è possibile generare codice per&amp;nbsp;invocarne
i metodi, le proprietà o gestirne gli eventi.
&lt;/p&gt;
&lt;p&gt;
Molto utile per lo sviluppo o per la creazione di script di amministrazione, eventualmente
in accoppiata con:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=09DFC342-648B-4119-B7EB-783B0F7D1178&amp;amp;displaylang=en"&gt;Scriptomatic
2.0&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
e con gli strumenti nella suite:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=6430F853-1120-48DB-8CC5-F2ABDC3ED314&amp;amp;displaylang=en"&gt;WMI
Administrative Tools&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
tra cui CIM Studio e WMI Object Browser.
&lt;/p&gt;
&lt;p&gt;
Preinstallati nel sistema si trovano inoltre, normalmente, i tools &lt;em&gt;WBemTest.exe&lt;/em&gt;,
per effettuare delle interrogazioni di prova e &lt;em&gt;Wmic.exe&lt;/em&gt;, per eseguire delle
query da riga di comando.
&lt;/p&gt;
&lt;p&gt;
Luc.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=7e93ba4d-47fc-4371-bc9f-34de4a55d715" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,7e93ba4d-47fc-4371-bc9f-34de4a55d715.aspx</comments>
      <category>.net</category>
      <category>C#</category>
      <category>scripts</category>
      <category>tools</category>
      <category>VB</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=6458bf00-9acc-4420-85b4-ab4a2b03ebf8</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,6458bf00-9acc-4420-85b4-ab4a2b03ebf8.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,6458bf00-9acc-4420-85b4-ab4a2b03ebf8.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=6458bf00-9acc-4420-85b4-ab4a2b03ebf8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Ecco il sito da cui si può scaricare la versione definitiva:
</p>
        <p>
          <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=90de37e0-7b42-4044-99be-f8ecfbbc5b65&amp;DisplayLang=en">EntLib
4.0</a>
        </p>
        <p>
che include il supporto per Visual Studio 2008, l'integrazione con lo
Unity application Block, il supporto per WMI2, et cetera.
</p>
        <p>
Luc.<br /></p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=6458bf00-9acc-4420-85b4-ab4a2b03ebf8" />
      </body>
      <title>Enterprise Library 4.0</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,6458bf00-9acc-4420-85b4-ab4a2b03ebf8.aspx</guid>
      <link>http://www.biader.it/2008/05/16/EnterpriseLibrary40.aspx</link>
      <pubDate>Fri, 16 May 2008 17:38:46 GMT</pubDate>
      <description>&lt;p&gt;
Ecco il sito da cui si può scaricare la versione definitiva:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=90de37e0-7b42-4044-99be-f8ecfbbc5b65&amp;amp;DisplayLang=en"&gt;EntLib
4.0&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
che include il supporto&amp;nbsp;per Visual Studio 2008, l'integrazione&amp;nbsp;con&amp;nbsp;lo
Unity application Block, il supporto per WMI2, et cetera.
&lt;/p&gt;
&lt;p&gt;
Luc.&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=6458bf00-9acc-4420-85b4-ab4a2b03ebf8" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,6458bf00-9acc-4420-85b4-ab4a2b03ebf8.aspx</comments>
      <category>.net</category>
      <category>ASP.net</category>
      <category>C#</category>
      <category>VB</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=1bf76f62-39ab-4c10-a72a-1a35a11a990f</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,1bf76f62-39ab-4c10-a72a-1a35a11a990f.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,1bf76f62-39ab-4c10-a72a-1a35a11a990f.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=1bf76f62-39ab-4c10-a72a-1a35a11a990f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Come noto ai più è possibile utilizzare come <em>DataSource</em> di una <em>DataGrid </em>una
collezione qualsiasi, per esempio una <em>ArrayList:</em></p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"> ArrayList
list <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> ArrayList();
list.Add(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Customer(2, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"anome_0"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"bcognome_0"</span>, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> DateTime(1973,
11, 03))); list.Add(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Customer(1, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"bnome_0"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"ccognome_0"</span>, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> DateTime(1974,
11, 03))); list.Add(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Customer(3, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"cnome_0"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"acognome_0"</span>, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> DateTime(1975,
11, 03))); dg.DataSource <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> list;</span>
        </pre>
        <p>
In questo caso le colonne vengono riempite con le proprietà pubbliche degli oggetti
aggiunti alla collezione, nel caso dell'esempio:
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> Customer
{ <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span> Customer(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> id, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> nome, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> cognome,
DateTime nascita) { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>.id <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> id; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>.nome <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> nome; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>.cognome <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> cognome; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>.nascita <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> nascita;
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> id; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> nome; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> cognome; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span> DateTime
nascita; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> Id
{ get { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> id;
} set { id <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> value;
} } <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> Nome
{ get { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> nome;
} set { nome <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> value;
} } <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> Cognome
{ get { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> cognome;
} set { cognome <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> value;
} } <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span> DateTime
Nascita { get { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> nascita;
} set { nascita <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> value;
} } }</span>
        </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          </span> </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font color="#003300" size="2">Il
problema, in questo caso, è che non è possibile scegliere il criterio di ordinamento
degli oggetti direttamente dalla griglia, </font>
          </span>
        </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font color="#003300" size="2">come
invece avviene nel caso in cui la <em>DataSource</em> sia, per esempio, una <em>DataTable.</em></font>
          </span>
        </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font color="#003300" size="2">Una
soluzione possibile è quella di estendere la collezione, implementando l'interfaccia <em>IBindingList:</em></font>
          </span>
        </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <em>
              <font color="#003300" size="2">
              </font>
            </em>
          </span> </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">       <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> SortableList
: ArrayList, IBindingList, IComparer         {}</span>
            </pre>
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              </span> </pre>
            <pre> </pre>
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font color="#003300" size="2">Il
metodo interessante per i nostri scopi è:</font>
                </span>
              </span>
            </pre>
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font color="#003300" size="2">
                  </font>
                </span>
              </span> </pre>
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font color="#003300" size="2">
                  </font>
                </span>
              </span> </pre>
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <pre>
                    <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                      <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
                      <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> ApplySort(PropertyDescriptor
property, ListSortDirection direction) { listSortDirection <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> direction;
sortProperty <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> property; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>.Sort(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span>);
}</span>
                  </pre>
                  <pre>
                    <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                    </span> </pre>
                </span>
              </span>
            </pre>
          </span>
        </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font color="#003300" size="2">
            </font>
          </span>Che
alla fine chiama:</pre>
        <pre> </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> Compare(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> x, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">object</span> y)
{ Type t <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> x.GetType(); <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">int</span> sign <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> 1; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (listSortDirection
== ListSortDirection.Descending) sign <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> -1;
PropertyInfo prp <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> t.GetProperty(sortProperty.Name); <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (prp.PropertyType.GetInterface(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"IComparable"</span>, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>)
!<span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>)
{ IComparable valx <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> (IComparable)prp.GetValue(x, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>);
IComparable valy <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> (IComparable)prp.GetValue(y, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>); <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> valx.CompareTo(valy) <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">*</span> sign;
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">else</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> 0;
}</span>
        </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          </span> </pre>
        <p>
          <font face="Courier New">Che effettua l'ordinamento vero e proprio.</font>
        </p>
        <pre>Luc.</pre>
        <a href="http://www.biader.it/public/contenuti/binari/SortableList.zip">SortableList.zip
(,85 KB)</a>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=1bf76f62-39ab-4c10-a72a-1a35a11a990f" />
      </body>
      <title>DataGrid e SortableList</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,1bf76f62-39ab-4c10-a72a-1a35a11a990f.aspx</guid>
      <link>http://www.biader.it/2008/05/14/DataGridESortableList.aspx</link>
      <pubDate>Wed, 14 May 2008 07:58:10 GMT</pubDate>
      <description>&lt;p&gt;
Come noto ai più è possibile utilizzare come &lt;em&gt;DataSource&lt;/em&gt; di una &lt;em&gt;DataGrid &lt;/em&gt;una
collezione qualsiasi, per esempio una &lt;em&gt;ArrayList:&lt;/em&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; ArrayList
list &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; ArrayList();
list.Add(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Customer(2, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"anome_0"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"bcognome_0"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; DateTime(1973,
11, 03))); list.Add(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Customer(1, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"bnome_0"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"ccognome_0"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; DateTime(1974,
11, 03))); list.Add(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Customer(3, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"cnome_0"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"acognome_0"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; DateTime(1975,
11, 03))); dg.DataSource &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; list;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
In questo caso le colonne vengono riempite con le proprietà pubbliche degli oggetti
aggiunti alla collezione, nel caso dell'esempio:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; Customer
{ &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; Customer(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; id, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; nome, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; cognome,
DateTime nascita) { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;.id &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; id; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;.nome &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; nome; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;.cognome &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; cognome; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;.nascita &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; nascita;
} &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; id; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; nome; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; cognome; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; DateTime
nascita; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; Id
{ get { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; id;
} set { id &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; value;
} } &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; Nome
{ get { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; nome;
} set { nome &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; value;
} } &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; Cognome
{ get { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; cognome;
} set { cognome &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; value;
} } &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; DateTime
Nascita { get { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; nascita;
} set { nascita &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; value;
} } }&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#003300 size=2&gt;Il
problema, in questo caso, è che non è possibile scegliere il criterio di ordinamento
degli oggetti direttamente dalla griglia, &lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#003300 size=2&gt;come
invece avviene nel caso in cui la &lt;em&gt;DataSource&lt;/em&gt; sia, per esempio, una &lt;em&gt;DataTable.&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#003300 size=2&gt;Una
soluzione possibile è quella di estendere la collezione, implementando l'interfaccia &lt;em&gt;IBindingList:&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;em&gt;&lt;font color=#003300 size=2&gt;&lt;/font&gt;&lt;/em&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; SortableList
: ArrayList, IBindingList, IComparer &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{}&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#003300 size=2&gt;Il
metodo interessante per i nostri scopi è:&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#003300 size=2&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#003300 size=2&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; ApplySort(PropertyDescriptor
property, ListSortDirection direction) { listSortDirection &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; direction;
sortProperty &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; property; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;.Sort(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;this&lt;/span&gt;);
}&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#003300 size=2&gt;&lt;/font&gt;&lt;/span&gt;Che
alla fine chiama:&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; Compare(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; x, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object&lt;/span&gt; y)
{ Type t &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; x.GetType(); &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;int&lt;/span&gt; sign &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; 1; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (listSortDirection
== ListSortDirection.Descending) sign &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; -1;
PropertyInfo prp &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; t.GetProperty(sortProperty.Name); &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (prp.PropertyType.GetInterface(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"IComparable"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;)
!&lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;)
{ IComparable valx &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; (IComparable)prp.GetValue(x, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;);
IComparable valy &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; (IComparable)prp.GetValue(y, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;); &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; valx.CompareTo(valy) &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;*&lt;/span&gt; sign;
} &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;else&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; 0;
}&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;Che effettua l'ordinamento vero e proprio.&lt;/font&gt;
&lt;/p&gt;
&lt;pre&gt;Luc.&lt;/pre&gt;
&lt;a href="http://www.biader.it/public/contenuti/binari/SortableList.zip"&gt;SortableList.zip
(,85 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=1bf76f62-39ab-4c10-a72a-1a35a11a990f" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,1bf76f62-39ab-4c10-a72a-1a35a11a990f.aspx</comments>
      <category>.net</category>
      <category>C#</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=7904696f-1774-46a7-ba1f-6b52854d8089</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,7904696f-1774-46a7-ba1f-6b52854d8089.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,7904696f-1774-46a7-ba1f-6b52854d8089.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=7904696f-1774-46a7-ba1f-6b52854d8089</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
L'icona (da mettere nella root del sito) che viene visualizzata nella barra di explorer.
</p>
        <p>
Si può editare con l'interessante tool:
</p>
        <p>
          <a href="http://www.favicon.cc/">http://www.favicon.cc/</a>
        </p>
        <p>
Che permette di crearne anche di animate...
</p>
        <p>
;)
</p>
        <p>
Luc.
</p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=7904696f-1774-46a7-ba1f-6b52854d8089" />
      </body>
      <title>favicon.ico</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,7904696f-1774-46a7-ba1f-6b52854d8089.aspx</guid>
      <link>http://www.biader.it/2008/05/12/faviconico.aspx</link>
      <pubDate>Mon, 12 May 2008 10:30:52 GMT</pubDate>
      <description>&lt;p&gt;
L'icona (da mettere nella root del sito) che viene visualizzata nella barra di explorer.
&lt;/p&gt;
&lt;p&gt;
Si può editare con l'interessante tool:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.favicon.cc/"&gt;http://www.favicon.cc/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Che permette di crearne anche di animate...
&lt;/p&gt;
&lt;p&gt;
;)
&lt;/p&gt;
&lt;p&gt;
Luc.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=7904696f-1774-46a7-ba1f-6b52854d8089" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,7904696f-1774-46a7-ba1f-6b52854d8089.aspx</comments>
      <category>.net</category>
      <category>ASP.net</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=62359fc0-597e-47db-a86c-85a04412458e</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,62359fc0-597e-47db-a86c-85a04412458e.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,62359fc0-597e-47db-a86c-85a04412458e.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=62359fc0-597e-47db-a86c-85a04412458e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Applicazione web per convertire il codice VB in codice C#:
</p>
        <p>
          <a href="http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx">http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx</a>
        </p>
        <p>
per chi non fosse ancora convinto, fa anche la conversione da C# a VB.
</p>
        <p>
 ;)
</p>
        <p>
Luc.
</p>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=62359fc0-597e-47db-a86c-85a04412458e" />
      </body>
      <title>Converti il VB in C#</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,62359fc0-597e-47db-a86c-85a04412458e.aspx</guid>
      <link>http://www.biader.it/2008/05/12/ConvertiIlVBInC.aspx</link>
      <pubDate>Mon, 12 May 2008 09:37:17 GMT</pubDate>
      <description>&lt;p&gt;
Applicazione web per convertire il codice VB in codice C#:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx"&gt;http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
per chi non fosse ancora convinto, fa anche&amp;nbsp;la conversione da C# a VB.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;;)
&lt;/p&gt;
&lt;p&gt;
Luc.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=62359fc0-597e-47db-a86c-85a04412458e" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,62359fc0-597e-47db-a86c-85a04412458e.aspx</comments>
      <category>.net</category>
      <category>C#</category>
      <category>VB</category>
    </item>
    <item>
      <trackback:ping>http://www.biader.it/Trackback.aspx?guid=e4332691-7bc2-46cf-8035-0d2579d0dc12</trackback:ping>
      <pingback:server>http://www.biader.it/pingback.aspx</pingback:server>
      <pingback:target>http://www.biader.it/PermaLink,guid,e4332691-7bc2-46cf-8035-0d2579d0dc12.aspx</pingback:target>
      <dc:creator>Luca</dc:creator>
      <wfw:comment>http://www.biader.it/CommentView,guid,e4332691-7bc2-46cf-8035-0d2579d0dc12.aspx</wfw:comment>
      <wfw:commentRss>http://www.biader.it/SyndicationService.asmx/GetEntryCommentsRss?guid=e4332691-7bc2-46cf-8035-0d2579d0dc12</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Libreria C# per effettuare queries su LogParser.
</p>
        <p>
Come si usa:
</p>
        <p>
      <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">       
IComplexQueryGateway gateway <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> LogParserGatewayFactory.CreateGateway(LogType.IISLog);</span></p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">            //
seleziono il o i files su cui effettuare la query</span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"> SelectQuery
query <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> SelectQuery("&lt;percorso&gt;\ex*.log"); </span>
        </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">            //
imposto colonne, condizioni di where, groupby, orderby query.AddFields(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"cs-uri-stem
as Url; sc-status as Status; COUNT(*) as Errors"</span>); query.AddWheres(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"sc-status
&gt;= 400; date &gt;= TIMESTAMP ( '2008-04-01', 'yyyy-MM-dd' )"</span>); query.AddGroupBys(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Url;
Status"</span>); query.AddOrderBys(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Errors
DESC"</span>); </span>
        </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">            //
ritorno il dataset risultante <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> gateway.Data(query);</span> </pre>
        <p>
Le queries possono essere anche testuali, utilizzando l'interfaccia <em>ISimpleQueryGateway. </em>La
libreria si può utilizzare anche per effettuare queries sull'eventLog.
</p>
        <p>
Luc.
</p>
        <a href="http://www.biader.it/public/contenuti/binari/IISLogWrapper.zip">IISLogWrapper.zip
(8,31 KB)</a>
        <img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=e4332691-7bc2-46cf-8035-0d2579d0dc12" />
      </body>
      <title>Libreria LogParser</title>
      <guid isPermaLink="false">http://www.biader.it/PermaLink,guid,e4332691-7bc2-46cf-8035-0d2579d0dc12.aspx</guid>
      <link>http://www.biader.it/2008/05/12/LibreriaLogParser.aspx</link>
      <pubDate>Mon, 12 May 2008 09:28:10 GMT</pubDate>
      <description>&lt;p&gt;
Libreria C# per effettuare queries su LogParser.
&lt;/p&gt;
&lt;p&gt;
Come si usa:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
IComplexQueryGateway gateway &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; LogParserGatewayFactory.CreateGateway(LogType.IISLog);&lt;/span&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
seleziono il o i files su cui effettuare la query&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; SelectQuery
query &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; SelectQuery("&amp;lt;percorso&amp;gt;\ex*.log"); &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
imposto colonne, condizioni di where, groupby, orderby query.AddFields(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"cs-uri-stem
as Url; sc-status as Status; COUNT(*) as Errors"&lt;/span&gt;); query.AddWheres(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"sc-status
&amp;gt;= 400; date &amp;gt;= TIMESTAMP ( '2008-04-01', 'yyyy-MM-dd' )"&lt;/span&gt;); query.AddGroupBys(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Url;
Status"&lt;/span&gt;); query.AddOrderBys(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Errors
DESC"&lt;/span&gt;); &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//
ritorno il dataset risultante &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; gateway.Data(query);&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;
Le queries possono essere anche testuali, utilizzando l'interfaccia &lt;em&gt;ISimpleQueryGateway.&amp;nbsp;&lt;/em&gt;La
libreria si può utilizzare anche&amp;nbsp;per effettuare queries sull'eventLog.
&lt;/p&gt;
&lt;p&gt;
Luc.
&lt;/p&gt;
&lt;a href="http://www.biader.it/public/contenuti/binari/IISLogWrapper.zip"&gt;IISLogWrapper.zip
(8,31 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://www.biader.it/aggbug.ashx?id=e4332691-7bc2-46cf-8035-0d2579d0dc12" /&gt;</description>
      <comments>http://www.biader.it/CommentView,guid,e4332691-7bc2-46cf-8035-0d2579d0dc12.aspx</comments>
      <category>.net</category>
      <category>C#</category>
    </item>
  </channel>
</rss>