<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3057731074981017942</id><updated>2024-11-08T16:25:09.428+01:00</updated><category term=".NET"/><category term="C#"/><category term="Java"/><category term="C++"/><category term="ASP.NET"/><category term="EAI"/><category term="Integrazione"/><category term="PHP"/><category term="SOA"/><category term="Silverlight"/><category term="ASP"/><category term="Ajax"/><category term="ApacheLoggingServices"/><category term="Attached Properties"/><category term="C"/><category term="C++/CLI"/><category term="CORBA"/><category term="Codemotion"/><category term="Copia bit a bit"/><category term="Costruttore di copia"/><category term="DCOM"/><category term="Deep copy"/><category term="Dictionary"/><category term="Flash"/><category term="IIS"/><category term="JavaFX"/><category term="LDAP"/><category term="Liferay"/><category term="Lookup"/><category term="MarkupExtensions"/><category term="Memory leak"/><category term="Message Broker"/><category term="OOA"/><category term="Oasis"/><category term="Open CV"/><category term="OpenLaszlo"/><category term="Processo di business"/><category term="RIA"/><category term="SOAP"/><category term="Shallow copy"/><category term="SortedDictionary"/><category term="ToLookup"/><category term="UDDI"/><category term="VB.NET"/><category term="Videosorveglianza"/><category term="WPF"/><category term="WSDL"/><category term="Web Engineering"/><category term="WfMS"/><category term="Workflow"/><category term="XAML"/><category term="boxing"/><category term="composite applications"/><category term="log"/><category term="log4cxx"/><category term="log4j"/><category term="log4net"/><category term="log4php"/><category term="portlet"/><category term="wrapping"/><title type='text'>Programmazione e dintorni...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-3643149876577304364</id><published>2011-04-13T13:17:00.002+02:00</published><updated>2011-04-13T13:23:23.189+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>C++ e C# a confronto</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-6_7X6rgufPU/TaV_68YmPeI/AAAAAAAAAGs/Mn13bbZJRy0/s1600/csharpOrigins_3.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;http://1.bp.blogspot.com/-6_7X6rgufPU/TaV_68YmPeI/AAAAAAAAAGs/Mn13bbZJRy0/s200/csharpOrigins_3.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Molto spesso si è portati a pensare che C#, il linguaggio &quot;di punta&quot; del framework .NET, sia un C++ &quot;migliore&quot;, un &quot;C++++&quot; come suggerisce l&#39;immagine, in realtà le differenze sono profonde, più che da un punto di vista sintattico, da un punto di vista concettuale.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Vediamo di seguito una tabella sulle maggiori differenze riguardo i due linguaggi. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;C++&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;C#&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;I riferimenti ad un’altra classe in un altro file del progetto   richiedono un #include&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Nessun #include è richiesto&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 2;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;I riferimenti ad una classe in una libreria dinamica (dll) richiedono   di includere un file e il link ad una libreria statica (lib)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Non ci sono più le librerie statiche. Si possono aggiungere i   riferimenti alle dll (assemblies) direttamente da progetto &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 3;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;I simboli esportati da una libreria devono essere dichiarati come declspec   o in un .DEF file&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Basta dichiarare i simboli come pubblici nella libreria. I simboli   privati non vengono esportati.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 4;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Se ci si riferisce ad una classe/struttura prima che venga   dichiarata, bisogna fare una forward declaration&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Non esistono le forward declarations e l’ordine di dichiarazione non   è importante&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 5;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm; margin-top: 7.5pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Passando tra stringhe Unicode/16-bit si richiede:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;entry point differenti (main/wmain)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Prefissi        non standard “L” or “_T”, oppure gestione STL con string/wstring&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Le        stringhe vengono manipolate da differenti funzioni&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm; margin-top: 7.5pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Unicode è il formato nativo&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 6;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;NULL&amp;nbsp;è un concetto,&amp;nbsp;non fa parte&amp;nbsp;del&amp;nbsp;linguaggio.&amp;nbsp;È&amp;nbsp;tipicamente&amp;nbsp;definito   come&amp;nbsp;0&amp;nbsp;e quindi è&amp;nbsp;l&#39;equivalente&amp;nbsp;di&amp;nbsp;0.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;null&amp;nbsp;è una&amp;nbsp;parola chiave.&amp;nbsp;Non&amp;nbsp;è&amp;nbsp;equivalente&amp;nbsp;a&amp;nbsp;0.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 7;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;I tipi di dato base&amp;nbsp;(int,&amp;nbsp;float, char,&amp;nbsp;ecc) non&amp;nbsp;possono&amp;nbsp;accettare   un valore&amp;nbsp;&quot;NULL&quot;.&amp;nbsp;Solo i puntatori possono avere&amp;nbsp;un   valore&amp;nbsp;&quot;NULL&quot;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Tutti&amp;nbsp;i tipi C&amp;nbsp;#&amp;nbsp;possono&amp;nbsp;accettare&amp;nbsp;null&amp;nbsp;come&amp;nbsp;   valore&lt;br /&gt;
&lt;span title=&quot;Fai clic per visualizzare le traduzioni alternative&quot;&gt;• T,&amp;nbsp;con   il&amp;nbsp;supporto&amp;nbsp;null è “T?”, ad es.&amp;nbsp;int&amp;nbsp;con il&amp;nbsp;supporto&amp;nbsp;null&amp;nbsp;è&amp;nbsp;“int?”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 8;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Nessun supporto per “foreach”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Supporto di &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ttw7t8t6(VS.80).aspx&quot;&gt;&lt;span style=&quot;color: windowtext; text-decoration: none;&quot;&gt;foreach&lt;/span&gt;&lt;/a&gt;&amp;nbsp;per   iterare su una collezione&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 9;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Supporto per try e catch.&lt;br /&gt;
Nessun supporto per &quot;finally”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Supporto per &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dszsf989(VS.71).aspx&quot;&gt;&lt;span style=&quot;color: windowtext; text-decoration: none;&quot;&gt;try-catch-finally&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 10;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Nessuna notifica su operazioni di overflow.&lt;br /&gt;
Per esempio:&lt;br /&gt;
unsigned x = UINT_MAX;&lt;br /&gt;
x++;&lt;br /&gt;
// x == 0 nessuna exception lanciata&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Usando&amp;nbsp;le parole chiave &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/74b4xzyw(VS.71).aspx&quot;&gt;&lt;span style=&quot;color: windowtext; text-decoration: none;&quot;&gt;checked&lt;/span&gt;&lt;/a&gt;/&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/a569z7k8(VS.71).aspx&quot;&gt;&lt;span style=&quot;color: windowtext; text-decoration: none;&quot;&gt;unchecked&lt;/span&gt;&lt;/a&gt;&amp;nbsp;puoi   ottenere comportamenti differenti (exception/overflow)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 11;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Nessun supporto nativo per sezioni critiche o multithreading&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Parola chiave &lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/c5kehkcz(VS.71).aspx&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: windowtext; text-decoration: none;&quot;&gt;lock&lt;/span&gt;&lt;/a&gt;   &lt;span lang=&quot;EN-US&quot;&gt;per le critical sections, oggetti Thread built-in&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 12;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;All’interno di uno switch, il break è opzionale&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Il break dentro lo switch è obbligatorio &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 13;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Nessuna documentazione built-in. Esite la possibilità di usare tools   esterni come doxygen&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Documentazione XML con “///”. Riconosciuto da IntelliSense in Visual   Studio&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 14;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Non si può suddividere la definizione di una classe su più file&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Le classi parziali permettono di suddividere la definizione di una   classe su più source files.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 15;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Nessun supporto per mix di librerie di versioni differenti&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Si può fare un mix di librerie di versioni differenti&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 16;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Lo sviluppatore deve gestire la memoria direttamente (new/delete)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm; margin-top: 7.5pt;&quot;&gt;Supporto di Garbage collection&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 17;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Si ha maggiore controllo sulla distruzione degli oggetti, possibilità   di memory leaks se non ben gestita&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 7.5pt; margin-left: 0cm; margin-right: 0cm; margin-top: 7.5pt;&quot;&gt;Minore controllo sulla distruzione   degli oggetti, ma più sicurezza a causa della gestione automatica del GC&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 18;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Gli oggetti “reference” possono essere allocati sia nell’heap che   nello stack della memoria dichiarandoli come locali o con una new&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Gli oggetti “reference” vengono sempre allocati nell’heap&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 19;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Supporto per classi o metodi “friend”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Non esiste il concetto di friend, ma questo è stato in qualche modo   sostituito dalle Proprietà di una classe&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 20; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 239.7pt;&quot; valign=&quot;top&quot; width=&quot;320&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;I tipi non condividono un tipo root comune&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 253.0pt;&quot; valign=&quot;top&quot; width=&quot;337&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Tutti i tipi derivano dalla classe “Object”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Pensandoci bene e leggendo vari articoli sull’argomento, ci si rende conto che in realtà la differenza tra un linguaggio come C++ e uno come C# (o Java), è ben più profonda e parte dalla base stessa di come è stato creato il linguaggio. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Il C++ si potrebbe definire come un linguaggio a due livelli di astrazione:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Livello 1 (low level)&lt;/b&gt;: gestione diretta della memoria e dell’allocazione delle risorse attraverso i puntatori . A questo livello viene definita la classe come detentrice delle risorse che verranno rilasciate nel suo distruttore. L’acquisizione-inizializzazione-distruzione delle risorse usate dalla classe è completamente a carico del programmatore che deve essere quindi sufficientemente esperto per progetti di medie-grosse dimensioni.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Livello 2 (high level)&lt;/b&gt;: a questo livello si vedono solo gli “oggetti” e si possono usare le risorse solo attraverso i metodi esposti dagli “oggetti”. Non esistono puntatori e nemmeno “&lt;i&gt;delete&lt;/i&gt;” o “&lt;i&gt;free&lt;/i&gt;”: al limite esistono puntatori “intelligenti” detti &lt;i&gt;smart_pointer&lt;/i&gt; che si auto gestiscono e distruggono. &amp;nbsp;Si richiede un grado di esperienza del programmatore anche inferiore perché la gestione “delicata” delle risorse è fatta al livello sottostante. Questo livello è molto simile a quello offerto da C#/Java.&lt;/li&gt;
&lt;/ul&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Le origini del &lt;a href=&quot;http://en.wikipedia.org/wiki/C%2B%2B&quot;&gt;C++&lt;/a&gt; non partono esclusivamente dal C, di cui comunque si è scelto di mantenere la compatibilità, ma soprattutto da un’idea di &lt;a href=&quot;http://en.wikipedia.org/wiki/Bjarne_Stroustrup&quot;&gt;Stroustrup&lt;/a&gt; che il linguaggio stesso potesse essere esteso, partendo da un nucleo decisamente ridotto all&#39;osso. Il programmatore può decidere di costruire sul linguaggio nativo estensioni difficilmente distinguibili dal linguaggio stesso. Un chiaro esempio di ciò è la libreria &lt;a href=&quot;http://en.wikipedia.org/wiki/Standard_Template_Library&quot;&gt;STL&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Il C#, come il Java, lasciano meno possibilità e libertà al programmatore, che probabilmente però ne guadagna in “sicurezza”e velocità di apprendimento. C# come Java partono da un livello di astrazione superiore al C++ e però se da un lato ciò comporta l’evitare tutte quelle problematiche che possono insorgere quando si programma a basso livello, dall’altro ne perde in flessibilità e potenza espressiva. C’è da dire che probabilmente la scelta di Java/C# è oculata perchè il target dei linguaggi è molto differente: nel caso di Java/C# si hanno linguaggi destinati ad applicazioni che devono interagire pesantemente col mondo della rete, del web, dei database, delle applicazioni distribuite ecc., per cui si è scelto di semplificare la vita del programmatore dando un livello di astrazione maggiore: in questo modo è stato possibile costruire e far apprendere in tempi relativamente rapidi ambienti quali .NET o Java (inteso come ambiente). Il C++ è stato pensato invece per andare a coprire target quali applicazioni time critical o sistemi embedded: target per cui è conveniente poter agire a differenti livelli di astrazione. Dire che C# è un C++ &quot;migliorato&quot; non è corretto, è più corretto dire che C# è stato pensato per scopi differenti, usare l&#39;uno o l&#39;altro dipende da ciò che dobbiamo costruire.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/3643149876577304364/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/04/molto-spesso-si-e-portati-pensare-che-c.html#comment-form' title='3 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/3643149876577304364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/3643149876577304364'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/04/molto-spesso-si-e-portati-pensare-che-c.html' title='C++ e C# a confronto'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-6_7X6rgufPU/TaV_68YmPeI/AAAAAAAAAGs/Mn13bbZJRy0/s72-c/csharpOrigins_3.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-7283520302754050763</id><published>2011-04-08T21:16:00.007+02:00</published><updated>2011-04-08T21:16:00.942+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Open CV"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="Videosorveglianza"/><title type='text'>Videosorveglianza fai-da-te!</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-NSzgj81dMrI/TZ815loiPjI/AAAAAAAAAGc/OtkrhsnMrys/s1600/vs.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://2.bp.blogspot.com/-NSzgj81dMrI/TZ815loiPjI/AAAAAAAAAGc/OtkrhsnMrys/s200/vs.jpg&quot; width=&quot;198&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Vediamo oggi come sia possibile creare una semplice applicazione per fare videosorveglianza “fai-da-te” completamente gratuita! Ciò che otterremo alla fine sarà una semplice applicazione che manda immagini &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;prese da una webcam ad un web server a cui possiamo collegarci per visualizzare cosa sta succedendo magari a casa nostra, in nostra assenza. Và detto che questa semplice applicazione è a solo scopo “didattico” e può essere arricchita a vostro piacimento.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Il nostro progetto è così architettato:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-yptbVGKVG-c/TZ81IRaJ2DI/AAAAAAAAAGU/nTyONn7naUk/s1600/videos.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;177&quot; src=&quot;http://1.bp.blogspot.com/-yptbVGKVG-c/TZ81IRaJ2DI/AAAAAAAAAGU/nTyONn7naUk/s320/videos.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;In pratica un “Frame Grabber” prende le immagini da un webcam e le salva su di un file, un “Image Sender” manda tali immagini ad un Web Server remoto che le pubblicherà. A questo punto le immagini della webcam saranno disponibili ad un qualsiasi browser remoto che si collega al web server permettendoci di fare videosorveglianza. Per divertirmi ho scelto di utilizzare linguaggi diversi per ciascun modulo:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;Frame Grabber&lt;/b&gt;: grabbing di immagini da webcam tramite librerie Open CV (C++)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Image Sender&lt;/b&gt;: classe Java che effettua una POST dell’immagine tramite una Http connection&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Image Receiver&lt;/b&gt;: script PHP che salva sul web server l’immagine ricevuta&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Web Page&lt;/b&gt;: pagina HTML che visualizza l’immagine&lt;/li&gt;
&lt;/ul&gt;&lt;!--[if !supportLists]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Come si nota, l’applicazione viene sviluppata parte in C/C++ , parte in PHP e parte in Java: in pratica una webcam riprende una scena, le immagini vengono grabbate e salvate ad intervalli regolari su un file del pc di casa tramite le librerie Open CV (librerie largamente utilizzate nel campo della computer vision). Una semplice applicazione Java, prende tale immagine e la spedisce (POST) ad un web server. Il web server a questo punto pubblicherà l’immagine tramite un semplice script PHP e sarà visibile tramite per esempio un semplice browser.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Per sviluppare l’applicazione ho usato ambienti di sviluppo per C/C++ e Java quali Visual Studio 2010 ed Eclipse, ma ciò non è vincolante poichè &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;tutto&lt;/i&gt; il codice è completamente portabile su qualsiasi SO. Si noti che sul pc di casa (quello su cui gira l’Image Sender), è necessario avere installato una Java Virtual Machine scaricabile da &lt;a href=&quot;http://www.java.com/it/download/index.jsp&quot;&gt;qui&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Image Receiver (PHP)&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Prima di tutto bisogna scegliere un web server (free!) che supporti Scripting PHP. &lt;a href=&quot;http://www.free-webhosts.com/free-php-webhosting.php&quot;&gt;Qui&lt;/a&gt; potete trovare una lista di esempio. Sceglietene uno, registratevi e createvi un sito. A questo punto mettete sul server (p.es. via FTP) il seguente file PHP:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;recv.php&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;/**&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;* Save the submitted file to disk&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;if (is_uploaded_file($_FILES[&#39;img&#39;][&#39;tmp_name&#39;])) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;move_uploaded_file($_FILES[&#39;img&#39;][&#39;tmp_name&#39;], &quot;img.jpg&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Questo script non fa altro che salvare su disco l’immagine che proviene da un client tramite HTTP POST su un file “img.jpg”. In questo modo potete pubblicare un’immagine su web. Sostituite la pagina di default del sito con la seguente:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;index.html&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;html&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;head&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;title&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;Remote Surveillance System&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;head&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;body&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;img&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;frame&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;border&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;script&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; showFrame() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;document.images.frame.src = &lt;span style=&quot;color: maroon;&quot;&gt;&quot;img.jpg?&quot;&lt;/span&gt; + Math.random();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;setTimeout(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;showFrame()&quot;&lt;/span&gt;, 3000);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;showFrame();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt;&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;In pratica la pagina effettua il refresh automatico dell’immagine “img.jpg” ogni 3 secondi escludendo la cache. Il file &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;index.html&lt;/i&gt; dovrebbe essere la pagina di default del nostro sito e deve risiedere sulla stessa cartella del file &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;recv.php&lt;/i&gt;. La parte da caricare sul web server è terminata. Passiamo ora ad implementare le 2 applicazioni che gireranno sul pc di casa.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Image Grabber (C/C++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;A questo punto siamo pronti per scrivere il codice che grabba le immagini da una semplice webcam e le salva su disco su un file “img.jpg”. Utilizzeremo le Open CV, librerie che vengono utilizzate per la computer vision. In pratica è un pò riduttivo usare le Open CV solo per grabbare delle immagini da una web cam, ma ciò potrebbe rivelarsi utile nel caso si voglia arricchire l’applicazione con funzionalità quali &lt;a href=&quot;http://en.wikipedia.org/wiki/Motion_detection&quot;&gt;motion detection&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Video_tracking&quot;&gt;object tracking&lt;/a&gt; ecc. Scarichiamo e compiliamo le &lt;a href=&quot;http://opencv.willowgarage.com/wiki/Welcome?action=AttachFile&amp;amp;do=get&amp;amp;target=opencv_cheatsheet.pdf&quot;&gt;Open CV&lt;/a&gt; dal sito. Per la compilazione delle librerie &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;lib&lt;/i&gt; e &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;dll&lt;/i&gt; possiamo utilizzare &lt;a href=&quot;http://www.cmake.org/&quot;&gt;CMake&lt;/a&gt; o direttamente Visual Studio secondo &lt;a href=&quot;http://opencv.willowgarage.com/wiki/InstallGuide&quot;&gt;queste&lt;/a&gt; istruzioni. Una volta che ci siamo installati le Open CV, creaiamo un nuovo progetto con Visual Studio, una semplice Console Application, chiamiamolo “VideoSorveglianza”. Includiamo le directory di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;include&lt;/i&gt; opportune di Open CV nella sezione “C/C++ -&amp;gt; Additional Include Directories” (p.es. “..\OpenCV2.2\include\opencv”) e tutte le librerie statiche nella sezione “Linker -&amp;gt; Input-&amp;gt;Addicional Dependencies” (p.es. ..\lib\cv220.lib ecc.). Copiamo le librerie dinamiche delle Open CV (p.es. cv220.dll ecc.) nella cartella Debug e/o Release del nostro progetto. &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;Creiamo un nuovo file all’interno del progetto:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;VideoSorveglianza.cpp&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;#include&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;#include&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;cv.h&quot; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;/* file include Open CV */&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;#include&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;highgui.h&quot; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;/* file include Open CV */&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; main(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; argc, &lt;span style=&quot;color: blue;&quot;&gt;char&lt;/span&gt;** argv)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;CvCapture *capture;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;IplImage&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;*frame;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;t, ms = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8.0pt;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;key;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;/* inizializza la webcam */&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;capture = cvCaptureFromCAM(0); &lt;span style=&quot;color: green;&quot;&gt;/* cattura il flusso video dal primo device del pc*/&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;cvNamedWindow(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;video&quot;&lt;/span&gt;, 1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;while&lt;/span&gt; (key != &lt;span style=&quot;color: #a31515;&quot;&gt;&#39;q&#39;&lt;/span&gt;) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;t = (&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)cvGetTickCount();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;/* display a video */&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;frame = cvQueryFrame(capture); &lt;span style=&quot;color: green;&quot;&gt;/* grabba l’immagine */&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;cvShowImage(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;video&quot;&lt;/span&gt;, frame);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;key = cvWaitKey(1); &lt;span style=&quot;color: green;&quot;&gt;/* aspetta input da tastiera 1 sec */&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;/* calcola il tempo trascorso */&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;t = (&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)cvGetTickCount() - t;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ms += t/((&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)cvGetTickFrequency() * 1000.0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;/* autosave dell’immagine ogni 3 secondi */&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (ceil(ms) &amp;gt;= 3000) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&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;cvSaveImage(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;img.jpg&quot;&lt;/span&gt;, frame);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&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;ms = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;/* free memory */&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;cvReleaseCapture(&amp;amp;capture);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;cvDestroyWindow(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;video&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8.0pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;A questo punto, dopo aver compilato il progetto e collegato la webcam, possiamo lanciare l’eseguibile da console tramite il comando: “VideoSorveglianza.exe”. Il risultato è il seguente:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br clear=&quot;all&quot; style=&quot;mso-special-character: line-break;&quot; /&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-Iwd9JWonT4g/TZ81WDOkztI/AAAAAAAAAGY/3fUAasK3CXY/s1600/grab.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;166&quot; src=&quot;http://3.bp.blogspot.com/-Iwd9JWonT4g/TZ81WDOkztI/AAAAAAAAAGY/3fUAasK3CXY/s200/grab.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Tale immagine verrà salvata sul file locale “img.jpg” ad intervalli regolari di 3 secondi.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Image Sender (Java)&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Il prossimo passo consiste nel creare il sender che spedirà le immagini ad un web server. Si noti che la spedizione deve avvenire come se fosse un HTTP POST. La classe Java (che girerà anch’essa sul nostro pc di casa), semplicemente legge l’immagine dal file “img.jpg”, apre una connessione URL col web server e la spedisce in formato binario. Apriamo Eclipse e creiamo un nuovo progetto, chiamiamolo p.es. “VideoSorveglianzaSender”. Creiamo una classe Sender con questo codice:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;i&gt;Sender.java&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt; java.net.*;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; java.awt.Graphics;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; java.awt.Image;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; java.awt.image.BufferedImage;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; java.io.*;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; javax.imageio.ImageIO;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;class&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; Sender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;{&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;static&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; URL &lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;u&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;private&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;final&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; String &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;CrLf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; = &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;\r\n&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; updateImage(){&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;URLConnection conn = &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;null&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;OutputStream os = &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;null&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;InputStream is = &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;null&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;try&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;color: #3f7f5f; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;//Qui va sostituito l’indirizzo del web server: attenzione recv.php va lasciato&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;URL url = &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; URL(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;http://&amp;lt;webserverURL&amp;gt;/recv.php&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;url:&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; + url); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;conn = url.openConnection(); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;conn.setDoOutput(&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;true&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;color: #3f7f5f; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;// legge l’immagine da file e la mette su un array di byte &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;File file = &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; File(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;img.jpg&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;);&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;Image image = ImageIO.&lt;i&gt;read&lt;/i&gt;(file);&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;BufferedImage bu = &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 106.2pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;BufferedImage(image.getWidth(&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;null&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;),image.getHeight(&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;null&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;),BufferedImage.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;TYPE_INT_RGB&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;);&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;Graphics g = bu.getGraphics();&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;g.drawImage(image,0,0,&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;null&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;);&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;g.dispose();&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;ByteArrayOutputStream baos = &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; ByteArrayOutputStream();&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;ImageIO.&lt;i&gt;write&lt;/i&gt;(bu, &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;jpg&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;, baos);&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;byte&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; []imgData = baos.toByteArray();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;color: #3f7f5f; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;// crea la request http &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;String message1 = &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;message1 += &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;-----------------------------4664151417711&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; + &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;CrLf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;message1 += &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;Content-Disposition: form-data; name=\&quot;img\&quot;; filename=\&quot;img.jpg\&quot;&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; + &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;CrLf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;message1 += &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;Content-Type: image/jpeg&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; + &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;CrLf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;message1 += &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;CrLf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;span style=&quot;color: #3f7f5f; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;// l’immagine viene spedita come &lt;u&gt;multipart&lt;/u&gt; message. &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;String message2 = &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;message2 += &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;CrLf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; + &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;-----------------------------4664151417711--&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; + &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;CrLf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;conn.setRequestProperty(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;, &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;multipart/form-data; boundary=---------------------------4664151417711&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;conn.setRequestProperty(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;Content-Length&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;, String.&lt;i&gt;valueOf&lt;/i&gt;((message1.length() + message2.length() + imgData.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;length&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;)));&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;open os&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;os = conn.getOutputStream(); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(message1); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;os.write(message1.getBytes()); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #3f7f5f; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;// SEND THE IMAGE &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; index = 0; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; size = 1024; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;do&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;{ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;write:&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; + index); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;if&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;((index+size)&amp;gt;imgData.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;length&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;){ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;size = imgData.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;length&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; - index; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;} &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;os.write(imgData, index, size); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;index+=size; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;while&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;(index&amp;lt;imgData.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;length&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;written:&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; + index); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(message2); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;os.write(message2.getBytes()); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;os.flush(); &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3f7f5f; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;// legge la risposta del web server&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;open is&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;is = conn.getInputStream(); &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;char&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; buff = 512; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; len; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;byte&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; []data = &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;byte&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;[buff]; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;do&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;{ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;READ&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;len = is.read(data); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;if&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;(len &amp;gt; 0){ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 4;&quot;&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;&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; &lt;/span&gt;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; String(data, 0, len)); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;} &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;while&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;(len&amp;gt;0); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;DONE&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;catch&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;(Exception e){ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;e.printStackTrace(); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;finally&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;{ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;System.&lt;/span&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;.println(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&quot;Close connection&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;try&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;{ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;os.close(); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;catch&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;(Exception e){} &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;try&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;{ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;is.close(); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;catch&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;(Exception e){} &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;} &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;static&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; main(String args[]) &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;throws&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; IOException&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;while&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; (&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;true&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;)&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Sender send = &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; Sender(); &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;send.updateImage(); &lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt;try&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; mso-ansi-language: EN-US;&quot;&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;color: #3f7f5f; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;// manda un immagine ogni 2 secondi&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Thread.&lt;i&gt;sleep&lt;/i&gt;(2000);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;catch&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt; (InterruptedException e) {&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;e.printStackTrace();&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&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;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt; line-height: 115%;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-size: 8.0pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Sostituire nel punto segnato&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2a00ff; font-family: &#39;Courier New&#39;; font-size: 11px;&quot;&gt;&amp;lt;webserverURL&amp;gt;&lt;/span&gt;,&amp;nbsp;l’indirizzo URL del web server che abbiamo scelto all’inizio, avendo cura di chiamare lo script &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;recv.php&lt;/i&gt;. La classe non fa altro che leggere il file img.jpg e metterlo dentro un byte array. A questo punto viene aperta una HTTP connection verso il web server e viene spedita l&#39;immagine come &quot;&lt;i&gt;multipart message&lt;/i&gt;&quot;. L&#39;image sender scriverà a video la risposta ottenuta dal web server.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2a00ff; font-family: &#39;Courier New&#39;; font-size: 11px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;A questo punto compiliamo la classe e copiamo il file “Sender.class” nella stessa directory Debug/Release di dove girerà il grabber “VideoSorveglianza.exe”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Test finale&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Proviamo il tutto: lanciamo l’eseguibile del grabber (dentro la cartella Debug/Release della solution di Visual Studio): “VideoSorveglianza.exe”. A questo punto lanciamo il sender tramite il comando “java Sender” lanciato dalla stessa cartella del progetto VideoSorveglianza. Aprendo un browser all’indirizzo del nostro sito vedremo le immagini provenienti dalla webcam che si aggiorneranno automaticamente. In questo modo potremmo controllare casa nostra magari direttamente dall’ufficio aprendo semplicemente un browser.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/7283520302754050763/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/04/videosorveglianza-fai-da-te.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/7283520302754050763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/7283520302754050763'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/04/videosorveglianza-fai-da-te.html' title='Videosorveglianza fai-da-te!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-NSzgj81dMrI/TZ815loiPjI/AAAAAAAAAGc/OtkrhsnMrys/s72-c/vs.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-159466944989704883</id><published>2011-03-31T21:12:00.000+02:00</published><updated>2011-04-01T12:52:08.568+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Copia bit a bit"/><category scheme="http://www.blogger.com/atom/ns#" term="Costruttore di copia"/><category scheme="http://www.blogger.com/atom/ns#" term="Deep copy"/><category scheme="http://www.blogger.com/atom/ns#" term="Memory leak"/><category scheme="http://www.blogger.com/atom/ns#" term="Shallow copy"/><title type='text'>Shallow Copy e Deep Copy in C++</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-VuNailX89t8/TZSdZdax1kI/AAAAAAAAAGQ/pAKQYF8nh4M/s1600/400px-Deep_copy_in_progress.svg.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;http://3.bp.blogspot.com/-VuNailX89t8/TZSdZdax1kI/AAAAAAAAAGQ/pAKQYF8nh4M/s200/400px-Deep_copy_in_progress.svg.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;In questo articolo cercheremo di capire cosa si intende per shallow copy e deep copy di un oggetto: tali concetti saranno validi per tutti i linguaggi di programmazione ad oggetti, ma nel linguaggio C++, che fa uso di puntatori e della copia implicita di oggetti, &amp;nbsp;rivestono un’importanza maggiore. Iniziamo a definire cosa è un &lt;i&gt;costruttore di copia&lt;/i&gt; in C++: un costruttore di copia è un costruttore speciale, utilizzato per creare un nuovo oggetto-copia di un oggetto esistente. Ma perchè ne abbiamo bisogno? Se noi non definiamo un costruttore di copia sarà il compilatore a crearne uno per noi, ossia creerà un costruttore di copia di default. Con tale costruttore di copia, la copia avverrà &lt;i&gt;“bit a bit”&lt;/i&gt;, brutto modo per dire che che si avrà una copia superficiale dell’ oggetto (&lt;i&gt;shallow copy&lt;/i&gt;). Se noi vogliamo ottenere una copia dell’oggetto differente e in profondità (&lt;i&gt;deep copy&lt;/i&gt;), dobbiamo crearcene uno.&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;Supponiamo inizialmente di avere la seguente classe C++:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;File A.h&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; A&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; i) { a = i; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ~A(&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;) { }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; get_a() { &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; a; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;private&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; a;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Supponiamo che adesso si effettui una copia di un oggetto in un altro oggetto in un programma che usa tale classe:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;#include&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;A.h&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;#include&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; std;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;…&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A x(10);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A y(20);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;x = y;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: green; font-family: Consolas; font-size: 13px;&quot;&gt;//shallow copy&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;cout &amp;lt;&amp;lt; x.get_a()&amp;lt;&amp;lt;&quot; &quot;&amp;lt;&amp;lt; y.get_a() &amp;lt;&amp;lt; endl;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Tutto è corretto: l’oggetto “&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;y”&lt;/i&gt; viene copiato in “&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;x”&lt;/i&gt; bit a bit, ossia il valore dell&#39; attributo intero di &lt;i&gt;y&lt;/i&gt; di valore 20 viene copiato in quello di &lt;i&gt;x&lt;/i&gt;, cosicchè il programma stamperà 20 20.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Ma cosa succederebbe se al posto di un intero avessimo un puntatore? Si consideri ora la stessa classe A, dove abbiamo sostituito l&#39;attributo intero con un puntatore ad un intero:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; A&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; i) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 70.8pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;*a = i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ~A(&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;) { &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;delete&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; a;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; get_a() { &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; *a; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;private&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;* a;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Se provo a lanciare il programma esso stampa ancora 20 20, quindi sembra che tutto sia andato bene, ma non è così! Ciò che succede quando eseguo &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;x = y&lt;/i&gt;, è che viene copiato il puntatore di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;y&lt;/i&gt; in quello di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;x&lt;/i&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;position: relative; z-index: 251659264;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-xZnWUmxrvqw/TZR-0Ro7gpI/AAAAAAAAAGE/wLswtayTJjE/s1600/shallow_deep1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;135&quot; src=&quot;http://4.bp.blogspot.com/-xZnWUmxrvqw/TZR-0Ro7gpI/AAAAAAAAAGE/wLswtayTJjE/s400/shallow_deep1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;height: 166px; left: -5px; position: absolute; top: -21px; width: 553px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;left&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td height=&quot;5&quot;&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;1&quot;&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;Questo, oltre ad essere sbagliato concettualmente (non si effettua una reale copia dell’oggetto), dà vita anche ad un bel &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;a href=&quot;http://it.wikipedia.org/wiki/Memory_leak&quot;&gt;memory leak&lt;/a&gt;&lt;/i&gt;!&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Si noti che nell’esempio con l’istruzione &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;x = y&lt;/i&gt;, abbiamo chiamato l’operatore “=” effettuando una shallow copy, ma se per esempio avessimo usato una funzione &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;f&lt;/i&gt;, che accetta in ingresso un oggetto A passato per valore, il discorso non cambierebbe perché in quel caso verrebbe creato automaticamente un oggetto A locale su cui verrà copiato l’oggetto passato:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A x(10);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;f(x);&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: green; font-family: Consolas; font-size: 13px; line-height: 14px;&quot;&gt;//questa funzione &quot;distrugge&quot; l&#39;intero puntato dal membro di x&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;cout &amp;lt;&amp;lt; x.get_a()&amp;lt;&amp;lt; endl;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; f(A&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;y) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span style=&quot;color: green; font-family: Consolas; font-size: 9.5pt;&quot;&gt;//qui y è una shallow copy di x&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;In questo caso verrà chiamato automaticamente il costruttore di copia di default della classe A (definito dal compilatore), che effettua anch’esso una copia bit a bit. Se proviamo a stampare il valore dell&#39;intero puntato dal membro di x dopo la chiamata a &lt;i&gt;f(x)&lt;/i&gt;, vedremo che tale valore è stato &quot;cancellato&quot; dalla &lt;i&gt;delete &lt;/i&gt;dentro il distruttore chiamato sull&#39;oggetto locale &lt;i&gt;y&lt;/i&gt; all&#39;uscita dalla funzione.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Il problema si risolve dichiarando esplicitamente il costruttore di copia e l’operatore di uguaglianza e copiando “manualmente” i valori puntati dai membri puntatore. Nel nostro caso ci servirà definire dentro la classe A i due metodi:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A(&lt;span style=&quot;color: blue;&quot;&gt;const&lt;/span&gt; A&amp;amp; val);&lt;span style=&quot;color: green;&quot;&gt; //costruttore di copia&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A&amp;amp; &lt;span style=&quot;color: blue;&quot;&gt;operator&lt;/span&gt;=(&lt;span style=&quot;color: blue;&quot;&gt;const&lt;/span&gt; A&amp;amp; val);&lt;span style=&quot;color: green;&quot;&gt; //sovraccaricamento operatore =&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;La classe A diventerà:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; A&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; i) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 70.8pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;*a = i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ~A(&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;) { &lt;span style=&quot;color: blue;&quot;&gt;delete&lt;/span&gt; a;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; get_a() { &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; *a;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 70.8pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A(&lt;span style=&quot;color: blue;&quot;&gt;const&lt;/span&gt; A&amp;amp; val)&lt;span style=&quot;color: green;&quot;&gt; //costruttore di copia&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 70.8pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;a = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *a = *(val.a);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 70.8pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 70.8pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A&amp;amp; &lt;span style=&quot;color: blue;&quot;&gt;operator&lt;/span&gt;=(&lt;span style=&quot;color: blue;&quot;&gt;const&lt;/span&gt; A&amp;amp; val) &lt;span style=&quot;color: green;&quot;&gt;//sovraccaricamento operatore =&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 70.8pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;*a = *(val.a);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; *&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 70.8pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 35.4pt; margin-right: 0cm; margin-top: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;* a;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Come si nota, sia il costruttore di copia che l’operatore “=” accettano entrambi una reference ad un altro oggetto A e copiano manualmente il valore intero, in modo da avere una copia effettiva:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;position: relative; z-index: 251682816;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-QJuvW_KFnHE/TZR_LLXZGNI/AAAAAAAAAGI/LVD2NBoF8_Y/s1600/shallow_deep2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;http://2.bp.blogspot.com/-QJuvW_KFnHE/TZR_LLXZGNI/AAAAAAAAAGI/LVD2NBoF8_Y/s400/shallow_deep2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;table align=&quot;left&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td height=&quot;0&quot; width=&quot;0&quot;&gt;&lt;/td&gt;   &lt;td width=&quot;82&quot;&gt;&lt;/td&gt;   &lt;td width=&quot;45&quot;&gt;&lt;/td&gt;   &lt;td width=&quot;81&quot;&gt;&lt;/td&gt;   &lt;td width=&quot;27&quot;&gt;&lt;/td&gt;   &lt;td width=&quot;94&quot;&gt;&lt;/td&gt;   &lt;td width=&quot;16&quot;&gt;&lt;/td&gt;   &lt;td width=&quot;81&quot;&gt;&lt;/td&gt;   &lt;td width=&quot;45&quot;&gt;&lt;/td&gt;   &lt;td width=&quot;82&quot;&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td height=&quot;1&quot;&gt;&lt;/td&gt;   &lt;td colspan=&quot;8&quot;&gt;&lt;/td&gt;   &lt;td align=&quot;left&quot; rowspan=&quot;6&quot; valign=&quot;top&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;div style=&quot;text-align: -webkit-left;&quot;&gt;Bisogna fare molta attenzione al distruttore della classe A: esso giustamente distrugge il puntatore “&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;a”&lt;/i&gt; quando l’oggetto A viene distrutto: se si omette la&amp;nbsp;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;delete &lt;/i&gt;dentro il distruttore&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;,&lt;/i&gt; potremmo avere “piacevoli” sorprese: a volte si sa che in informatica c’è la regola “bug + bug = funziona tutto”! Facciamo un esempio, supponendo che nella classe A senza costruttore di copia e operatore =, manchi pure la &lt;i&gt;delete&lt;/i&gt; e che vogliamo effettuare lo swap di due oggetti (ossia del contenuto dell’intero puntato da “&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;a”&lt;/i&gt;):&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A x(10);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A y(20);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;x=&quot;&lt;/span&gt; &amp;lt;&amp;lt; x.get_a()&amp;lt;&amp;lt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot; y=&quot;&lt;/span&gt;&amp;lt;&amp;lt;y.get_a() &amp;lt;&amp;lt; endl;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A::swap(x,y);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;x=&quot;&lt;/span&gt; &amp;lt;&amp;lt; x.get_a()&amp;lt;&amp;lt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot; y=&quot;&lt;/span&gt;&amp;lt;&amp;lt;y.get_a() &amp;lt;&amp;lt; endl;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;dove abbiamo definito in A il metodo statico:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; swap(A&amp;amp; x, A&amp;amp; y)&lt;/span&gt;&lt;/span&gt;//passaggio per reference, nessuna copia!&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A tmp = x;&lt;span style=&quot;color: green;&quot;&gt; //questo chiama il costruttore di copia bit a bit&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = y; &lt;span style=&quot;color: green;&quot;&gt;//questo chiama l’operatore = bit a bit&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = tmp; &lt;span style=&quot;color: green;&quot;&gt;/questo chiama l’operatore = bit a bit&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Con somma meraviglia notiamo che effettivamente la funzione &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;swap&lt;/i&gt; effettua lo scambio delle variabili intere nonostante la shallow copy e il programma sopra stampa:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;x=10 y=20&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;x=20 y=10&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Ma vediamo graficamente cosa avviene. Dopo l’istruzione &lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;A tmp = x &lt;/span&gt;si avrà:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-UWD1hOhI22s/TZR_Smhd10I/AAAAAAAAAGM/uiAG0YGoHyc/s1600/shallow_deep3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;228&quot; src=&quot;http://3.bp.blogspot.com/-UWD1hOhI22s/TZR_Smhd10I/AAAAAAAAAGM/uiAG0YGoHyc/s400/shallow_deep3.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Naturalmente il fatto che &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;swap&lt;/i&gt; funzioni è solo un caso e resta il fatto che le variabili intere puntate, in questo modo non verrebbero mai eliminate. Provando ad aggiungere nuovamente la &lt;i&gt;delete&lt;/i&gt; al distruttore di A (ma senza aggiungere anche il costruttore di copia e l’operatore =), otterremmo dal programma precedente:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;x=10 y=20&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;x=20 y= -17891602&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Questo perchè all’uscita della funzione &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;swap&lt;/i&gt;, l’intero puntato da &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;tmp &lt;/i&gt;(oggetto locale alla funzione), viene cancellato dalla &lt;i&gt;delete &lt;/i&gt;(in rosso in figura), lasciando “flottante” anche il puntatore contenuto dentro &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;y, &lt;/i&gt;tale comportamento può considersi della categoria&amp;nbsp;&quot;&lt;i&gt;effetti collaterali&lt;/i&gt;&quot;. Questo esempio è stato fatto solo per far capire che con i puntatori a volte anche se le cose sembrano “funzionare”, in realtà non è affatto così.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;La regola che si deve tenere dovrebbe essere: &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;“se una classe non alloca nei propri membri memoria in maniera dinamica (new, malloc ecc.), allora possiamo affidarci alla shallow copy, altrimenti è necessaria la deep copy”&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;In C++ la deep copy consiste in:&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Creazione di un costruttore di copia che allochi la memoria e copi i valori delle variabili dell’oggetto da copiare.&lt;/li&gt;
&lt;li&gt;Sovraccaricamento dell’operatore = che copi i valori delle variabili da un oggetto all’altro&lt;/li&gt;
&lt;li&gt;Creazione di un distruttore che deallochi tutte le variabili allocate dinamicamente&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Per approfondimenti sulla Shallow Copy e Deep Copy, anche in altri linguaggi, si legga &lt;a href=&quot;http://en.wikipedia.org/wiki/Object_copy&quot;&gt;qui&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/159466944989704883/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/03/shallow-copy-e-deep-copy-in-c_31.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/159466944989704883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/159466944989704883'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/03/shallow-copy-e-deep-copy-in-c_31.html' title='Shallow Copy e Deep Copy in C++'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-VuNailX89t8/TZSdZdax1kI/AAAAAAAAAGQ/pAKQYF8nh4M/s72-c/400px-Deep_copy_in_progress.svg.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-8976221025333713896</id><published>2011-03-08T22:58:00.000+01:00</published><updated>2011-03-09T16:24:44.956+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="composite applications"/><category scheme="http://www.blogger.com/atom/ns#" term="CORBA"/><category scheme="http://www.blogger.com/atom/ns#" term="DCOM"/><category scheme="http://www.blogger.com/atom/ns#" term="EAI"/><category scheme="http://www.blogger.com/atom/ns#" term="Integrazione"/><category scheme="http://www.blogger.com/atom/ns#" term="Oasis"/><category scheme="http://www.blogger.com/atom/ns#" term="OOA"/><category scheme="http://www.blogger.com/atom/ns#" term="Processo di business"/><category scheme="http://www.blogger.com/atom/ns#" term="SOA"/><category scheme="http://www.blogger.com/atom/ns#" term="SOAP"/><category scheme="http://www.blogger.com/atom/ns#" term="UDDI"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Engineering"/><category scheme="http://www.blogger.com/atom/ns#" term="WSDL"/><title type='text'>Parliamo un pò di SOA (Service Oriented Architecture)</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://lh4.googleusercontent.com/-baqAgGKYHLQ/TXZdyRCMpSI/AAAAAAAAAFw/U2jZpbM1yRs/s1600/soa-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://lh4.googleusercontent.com/-baqAgGKYHLQ/TXZdyRCMpSI/AAAAAAAAAFw/U2jZpbM1yRs/s200/soa-1.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Dopo aver visto un’introduzione alle &lt;a href=&quot;http://programmazioneedintorni.blogspot.com/2011/02/unintroduzione-alle-eai-enterprise.html&quot;&gt;EAI&lt;/a&gt;, veniamo al passo successivo che si è avuto nel panorama dell’integrazione dei sistemi informativi: le soluzioni &lt;a href=&quot;http://it.wikipedia.org/wiki/Service-oriented_architecture&quot;&gt;SOA&lt;/a&gt; (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;Service Oriented Architecture&lt;/i&gt;). La grande diffusione del Web ha portato le architetture legate ad esso a grandi trasformazioni passando dalla costruzione di semplici siti web, ai portali aziendali fino alle soluzioni che integrassero le infrastrutture IT.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Agli inizi degli studi dei problemi di integrazione di applicazioni si avevano le cosiddette applicazioni distribuite (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;Object Oriented Architecture&lt;/i&gt;, OOA): componenti realizzati con tecnologie differenti potevano cooperare tra di loro dando vita ad un’applicazione unica secondo protocolli standard (es. &lt;a href=&quot;http://it.wikipedia.org/wiki/CORBA&quot;&gt;CORBA&lt;/a&gt;, &lt;a href=&quot;http://it.wikipedia.org/wiki/Distributed_Component_Object_Model&quot;&gt;DCOM&lt;/a&gt;). &amp;nbsp;A questo livello agivano le EAI: far interagire tra loro applicazioni/componenti del tutto eterogenee.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Ci si è resi conto però dei vantaggi di un approccio differente, a servizi distribuiti (web services): si poteva accedere a tali servizi usufruendo dell’interfaccia che tali web services fornivano secondo un contratto (WSDL) e un protocollo (SOAP) standard. Eventualmente tali servizi potevano essere ricercati e scoperti (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;discovered&lt;/i&gt;) in una lista di servizi disponibili (UDDI). Il vantaggio di questo approccio (SOA) rispetto a quello precedente (OOA) consisteva nel fatto che veniva posto il focus sulle funzionalità e non sulle tecnologie.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;In altre parole l’approccio SOA mette in evidenza un’entità nota maggiormente al management aziendale di quanto lo fossero le implementazioni tecnologiche, ossia metteva al centro dell’attenzione il &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;a href=&quot;http://it.wikipedia.org/wiki/Processo_aziendale&quot;&gt;processo di business&lt;/a&gt;&lt;/i&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Un’architettura SOA è qualcosa di più complesso di un’architettura a WS, nonostante possiamo affermare che essa si possa anche fondare sui concetti tecnologici dei WS. In realtà un’architettura SOA sta ad un livello di astrazione superiore di una struttura a WS: possiamo affermare che un’architettura SOA è&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;“&lt;span class=&quot;apple-style-span&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;&quot;&gt;Un paradigma per l&#39;organizzazione e l&#39;utilizzazione delle risorse distribuite che possono essere sotto il controllo di domini di proprietà differenti. Fornisce un mezzo uniforme per offrire, scoprire, interagire ed usare le capacità di produrre gli effetti voluti consistentemente con presupposti e aspettative misurabili” - Reference Model for Serviced Oriented Architecture 1.0.”, OASIS,12 ottobre 2006 (&lt;a href=&quot;http://www.oasis-open.org/home/index.php&quot;&gt;Oasis&lt;/a&gt; è un consorzio mondiale fondato nel 1993&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%;&quot;&gt;che regolamenta le convergenze degli sviluppi e l’adozione di standard di e-business).&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;SOA è pertanto un paradigma che si traduce in un’architettura dinamica con la quale il progetto e lo sviluppo delle soluzioni sono portate a livelli di ragionamento più elevati. Tali ragionamenti permettono di&amp;nbsp; valutare in modo più completo i processi aziendali, considerandoli nel loro insieme e non solo singolarmente, e, quindi, a ricercare lo sviluppo della migliore soluzione possibile che realizzi le operazioni di business richieste .&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Quindi SOA non è una tecnologia, ma un approccio architetturale costruito attorno alle tecnologie esistenti. Promuove un insieme di pratiche, discipline, modalità di disegno e linee-guida che possono essere applicate usando una o più tecnologie. SOA propone lo sviluppo di nuovi servizi basati su funzionalità già offerte da un’applicazione. Altre applicazioni che desiderano comunicare con questa applicazione, faranno uso di uno o più servizi per realizzare il compito desiderato.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Il paradigma SOA si basa su tre concetti basilari:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Visibilità: &lt;/b&gt;&amp;nbsp;capacità di trovare il servizio più idoneo alle proprie necessità&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Interazione: &lt;/b&gt;capacità di richiesta di un servizio e conseguentemente di esaudizione della richiesta mediante scambio di messaggi.&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Effetti reali: &lt;/b&gt;capacità di dare i&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt; &lt;/b&gt;risultati dell’interazione.&lt;/li&gt;
&lt;/ul&gt;Si nota come tali concetti non definiscano altro che le proprietà di un &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;servizio&lt;/i&gt;: un servizio viene erogato quando si svolgono attività per conto di un richiedente (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;service consumer&lt;/i&gt;). Il servente (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;service provider&lt;/i&gt;) garantisce la propria offerta di servizio, la propria capacità di svolgerlo e la descrizione delle specifiche con le quali si può invocare correttamente il servizio offerto. La descrizione del servente viene resa pubblica mediante una &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;discovery agency&lt;/i&gt; (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;service broker&lt;/i&gt;), un &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;repository&lt;/i&gt; o una &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;directory&lt;/i&gt;.&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;SOA è uno degli ultimi paradigmi della &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_engineering&quot;&gt;Web Engineering&lt;/a&gt;: generazione di servizi e creazione delle condizioni per la meccanizzazione dei processi all’interno degli &lt;a href=&quot;http://en.wikipedia.org/wiki/Asset&quot;&gt;asset&lt;/a&gt; informativi aziendali attraverso delle &lt;a href=&quot;http://en.wikipedia.org/wiki/Composite_application&quot;&gt;composite applications&lt;/a&gt;. Scegliere una soluzione SOA rispetto ad una OOA significa assumere per l’architettura queste proprietà:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Effettivo riuso e migliore “granularità” del servizi&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;Interoperabilità dei servizi e loro componentizzazione in servizi più semplici (composite application)&lt;/li&gt;
&lt;li&gt;Assunzione di standard generici e/o specifici di certi domini&lt;/li&gt;
&lt;li&gt;Identificazione e accessibilità ai servizi standardizzata&lt;/li&gt;
&lt;li&gt;Monitoraggio della soluzione (IT &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;governance&lt;/i&gt;)&lt;/li&gt;
&lt;li&gt;Incapsulamento dei servizi&lt;/li&gt;
&lt;li&gt;Accoppiamento debole tra i servizi (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;loose coupling&lt;/i&gt;) mediante messaggi XML standard&lt;/li&gt;
&lt;li&gt;Regole di interazione tra i servizi mediante contratti definiti&lt;/li&gt;
&lt;li&gt;Maggiore astrazione dalle logiche di implementazione&lt;/li&gt;
&lt;li&gt;Possibilità di suddivisone dei servizi per macro-funzionalità&lt;/li&gt;
&lt;li&gt;Autonomia di ciascun servizio nel definire la propria logica implementativa&lt;/li&gt;
&lt;li&gt;Rintracciabilità dei servizi mediante costrutti noti e standard&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;Semplificando possiamo dire che SOA ricontestualizza il paradigma nato con le OOA alla rete e ad Internet. I nuovi livelli di astrazione introdotti permettono di ridurre notevolmente il gap presente tra le logiche dei processi di business e i sistemi IT.&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://lh3.googleusercontent.com/-4K5UqkvHTjw/TXZdMQ_bHuI/AAAAAAAAAFs/InPzpNGDVRE/s1600/soa.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;142&quot; src=&quot;https://lh3.googleusercontent.com/-4K5UqkvHTjw/TXZdMQ_bHuI/AAAAAAAAAFs/InPzpNGDVRE/s400/soa.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Schema modulare di un&#39;architettura SOA&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: 0cm; mso-add-space: auto;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/8976221025333713896/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/03/parliamo-un-po-di-soa-service-oriented.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/8976221025333713896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/8976221025333713896'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/03/parliamo-un-po-di-soa-service-oriented.html' title='Parliamo un pò di SOA (Service Oriented Architecture)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh4.googleusercontent.com/-baqAgGKYHLQ/TXZdyRCMpSI/AAAAAAAAAFw/U2jZpbM1yRs/s72-c/soa-1.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Roma, Italia</georss:featurename><georss:point>41.8954656 12.4823243</georss:point><georss:box>41.3843416 11.5484863 42.406589600000004 13.4161623</georss:box></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-3786661745148396808</id><published>2011-03-07T23:05:00.000+01:00</published><updated>2011-03-08T14:16:12.423+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Codemotion"/><title type='text'>Ready. Run Codemotion.</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://lh3.googleusercontent.com/-SyCcrphmpUE/TXTJb3vXeOI/AAAAAAAAAEs/gfLvtxQMMFM/s1600/codemotion.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://lh3.googleusercontent.com/-SyCcrphmpUE/TXTJb3vXeOI/AAAAAAAAAEs/gfLvtxQMMFM/s1600/codemotion.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Sabato 5 Marzo si è tenuto a Roma, presso l’Università di Ingegneria Informatica Roma 3, &amp;nbsp;il Codemotion, che “rimpiazza” il classico Javaday. La manifestazione prevedeva una serie di talk che riguardano le ultime novità nel mondo della programmazione, dell’informatica e della tecnologia. Dai talk presenti mi è smbrato che il focus fosse incentrato maggiormente su due argomenti hot: l’HTML 5 e i Database NoSQL. La manifestazione ha avuto un gran successo e afflusso di persone. Oltre ai talk erano presenti anche i classici stand con le aziende ICT sponsor dell’evento tra i quali nomi grossi come Oracle, IBM, Sony, Samsung, Almaviva, Adobe. Ho notato con piacere che l’afflusso agli stand maggiore si è avuto in quello della &lt;a href=&quot;http://oreilly.com/&quot;&gt;O’Really&lt;/a&gt; , che per l’occasione dava uno sconto del 40% sui titoli presenti sul banco (in realtà i titoli non erano numerosissimi, ma qualcosa di interessante si poteva trovare): impazzita la povera signora di lingua inglese che vendeva i libri e che non riusciva a tenere a bada orde di nerd che volevano comprare libri di informatica a prezzo stracciato (tra i quali c’ero anche io). Mio giudizio personale sull’evento: in generale ottimi gli argomenti trattati, mi è piaciuta molto l’idea di generalizzare l’evento a tutti i linguaggi e tecnologie, molto buona l’organizzazione globale della manifestazione, buona anche l’idea di far incontrare addetti ai lavoratori/appassionati di tecnologia con il mondo del lavoro. Per quanto riguarda i talk direi buon alcuni, ma un pò troppo bassa la qualità di alcuni altri che ho seguito (c’è da dire a parziale giustificazione che il tempo a disposizione degli oratori era poco). Nel complesso è stata una bella giornata, esperienza sicuramente da ripetere. A questo &lt;a href=&quot;https://picasaweb.google.com/valerio.casale/Codemotion2011?feat=flashalbum#5580686693979227170&quot;&gt;link&lt;/a&gt; le foto dell’evento: &amp;nbsp;in una foto, guardando attentamente, potete pure verificare che “io c’ero” &lt;span style=&quot;font-family: Wingdings;&quot;&gt;J&lt;/span&gt;... mentre se aguzzate la vista noterete che il mio nome compare tra gli autori dei “codicilli” stampati sulle colonne: che onore! &lt;span style=&quot;font-family: Wingdings;&quot;&gt;J&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/3786661745148396808/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/03/ready-run-codemotion.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/3786661745148396808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/3786661745148396808'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/03/ready-run-codemotion.html' title='Ready. Run Codemotion.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh3.googleusercontent.com/-SyCcrphmpUE/TXTJb3vXeOI/AAAAAAAAAEs/gfLvtxQMMFM/s72-c/codemotion.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-978116143851959783</id><published>2011-03-04T15:23:00.019+01:00</published><updated>2011-03-04T15:42:06.121+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="ApacheLoggingServices"/><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="C++/CLI"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="log"/><category scheme="http://www.blogger.com/atom/ns#" term="log4cxx"/><category scheme="http://www.blogger.com/atom/ns#" term="log4j"/><category scheme="http://www.blogger.com/atom/ns#" term="log4net"/><category scheme="http://www.blogger.com/atom/ns#" term="log4php"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.NET"/><title type='text'>Apache Logging Services:  A Log 4 All Languages</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://lh6.googleusercontent.com/-xrFFdFphhFk/TXD3zr_b3hI/AAAAAAAAAEk/0__1YqCCA60/s1600/ls-logo.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://lh6.googleusercontent.com/-xrFFdFphhFk/TXD3zr_b3hI/AAAAAAAAAEk/0__1YqCCA60/s1600/ls-logo.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Molto spesso, durante lo sviluppo dei nostri progetti, ci viene richiesto di fornire dei file di log. &lt;a href=&quot;http://en.wikipedia.org/wiki/Apache_Software_Foundation&quot;&gt;Apache Software Foundation&lt;/a&gt;&lt;span class=&quot;MsoHyperlink&quot;&gt;&amp;nbsp; &lt;/span&gt;fornisce quattro librerie dedicate al logging per Java, .NET,C++,PHP. Tali librerie hanno tutte in comune gli stessi concetti. L’obiettivo di tali librerie è gestire il log in tutti i suoi aspetti in modo facile, efficiente e flessibile . Inoltre il formato prodotto dei messaggi è visualizzabile tramite dei tool già esistenti. Tali librerie sono inoltre state ottimizzate per ridurre al minimo l’overhead sulle prestazioni delle nostre applicazioni.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Una delle caratteristiche distintive di tali librerie è il concetto di ereditarietà : per ciascuna classe del nostro progetto è possibile definire un “logger” con una sua granularità e uscita che può essere&amp;nbsp; un file, un OutputStream, un Writer, un server remoto ecc. E’possibile avere numerosi livelli di tracing: la seguente tabella definisce i livelli di log dei messaggi, in ordine decrescente di gravità.&amp;nbsp;La colonna di sinistra è la denominazione del livello, la colonna di destra fornisce una breve descrizione di ogni livello di log.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;background: #F9F9F9; border-collapse: collapse; border: none; mso-border-alt: solid #AAAAAA .75pt; mso-yfti-tbllook: 1184;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;background: #F2F2F2; border: solid #AAAAAA 1.0pt; mso-border-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt;&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;Livello&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;background: #F2F2F2; border-left: none; border: solid #AAAAAA 1.0pt; mso-border-alt: solid #AAAAAA .75pt; mso-border-left-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt; width: 283.1pt;&quot; width=&quot;377&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;Descrizione&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid #AAAAAA 1.0pt; mso-border-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;OFF&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid #AAAAAA 1.0pt; border-left: none; border-right: solid #AAAAAA 1.0pt; border-top: none; mso-border-alt: solid #AAAAAA .75pt; mso-border-left-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt; width: 283.1pt;&quot; width=&quot;377&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;Il   grado più alto possibile. Disattiva l’output.&lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 2;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid #AAAAAA 1.0pt; mso-border-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;FATAL&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid #AAAAAA 1.0pt; border-left: none; border-right: solid #AAAAAA 1.0pt; border-top: none; mso-border-alt: solid #AAAAAA .75pt; mso-border-left-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt; width: 283.1pt;&quot; width=&quot;377&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;errori   gravi che causano cessazione anticipata.&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 3;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid #AAAAAA 1.0pt; mso-border-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;ERRORE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid #AAAAAA 1.0pt; border-left: none; border-right: solid #AAAAAA 1.0pt; border-top: none; mso-border-alt: solid #AAAAAA .75pt; mso-border-left-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt; width: 283.1pt;&quot; width=&quot;377&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;Altri   errori di runtime o condizioni inaspettate.&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 4;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid #AAAAAA 1.0pt; mso-border-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;WARN&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid #AAAAAA 1.0pt; border-left: none; border-right: solid #AAAAAA 1.0pt; border-top: none; mso-border-alt: solid #AAAAAA .75pt; mso-border-left-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt; width: 283.1pt;&quot; width=&quot;377&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;Messaggi   a cui prestare particolare attenzione&lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 5;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid #AAAAAA 1.0pt; mso-border-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;INFO&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid #AAAAAA 1.0pt; border-left: none; border-right: solid #AAAAAA 1.0pt; border-top: none; mso-border-alt: solid #AAAAAA .75pt; mso-border-left-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt; width: 283.1pt;&quot; width=&quot;377&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;Interessanti   eventi di runtime (avvio / arresto).&lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 6;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid #AAAAAA 1.0pt; mso-border-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;DEBUG&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid #AAAAAA 1.0pt; border-left: none; border-right: solid #AAAAAA 1.0pt; border-top: none; mso-border-alt: solid #AAAAAA .75pt; mso-border-left-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt; width: 283.1pt;&quot; width=&quot;377&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;Informazioni   dettagliate &lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 7; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;border-top: none; border: solid #AAAAAA 1.0pt; mso-border-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;TRACE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border-bottom: solid #AAAAAA 1.0pt; border-left: none; border-right: solid #AAAAAA 1.0pt; border-top: none; mso-border-alt: solid #AAAAAA .75pt; mso-border-left-alt: solid #AAAAAA .75pt; mso-border-top-alt: solid #AAAAAA .75pt; padding: 2.4pt 2.4pt 2.4pt 2.4pt; width: 283.1pt;&quot; width=&quot;377&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10pt; line-height: 115%; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;&quot;&gt;Informazioni   più dettagliate possibile&lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-line-height-alt: 1.15pt;&quot;&gt;Ci sono due modi per configurare la libreria:&amp;nbsp;uno è con un file di proprietà (chiave=valore) e l&#39;altro è con un file&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/XML&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6fa8dc;&quot;&gt;XML&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&amp;nbsp;.&amp;nbsp;All&#39;interno di entrambi è possibile definire tre componenti principali: &amp;nbsp;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;Loggers&lt;/i&gt;, &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;Appenders&lt;/i&gt; e &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;Layouts&lt;/i&gt;.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-line-height-alt: 1.15pt;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Loggers&lt;/b&gt;: possiamo definire una gerarchia di nomi di logger secondo un principio di ereditarietà: un logger &lt;i&gt;child &lt;/i&gt;eredita le proprietà dal logger &lt;i&gt;parent&lt;/i&gt;.&amp;nbsp;Ogni logger è configurabile in modo indipendente.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Appenders: &lt;/b&gt;configurano gli output.&amp;nbsp;Ci sono numerosi appenders supportati, con nomi descrittivi, come ad esempio &lt;i&gt;FileAppender, ConsoleAppender, SocketAppender, SyslogAppender&lt;/i&gt;, &lt;i&gt;NTEventLogAppender&lt;/i&gt; e &lt;i&gt;&amp;nbsp;SMTPAppender&lt;/i&gt;.&amp;nbsp;Appenders multipli possono essere collegati a qualsiasi Logger, quindi è possibile registrare le stesse informazioni su più uscite, per esempio su un file locale e su un&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Internet_socket&quot; title=&quot;Internet socket&quot;&gt;&lt;span style=&quot;background-color: white; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6fa8dc;&quot;&gt;socket&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #6fa8dc;&quot;&gt;&amp;nbsp;&lt;/span&gt;listener su un altro computer.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Layouts:&lt;/b&gt;&amp;nbsp;sono usati per definire il formato dei messaggi.&amp;nbsp;Un layout noto (one-line-at-a-time) è il &lt;i&gt;PatternLayout&lt;/i&gt;. Per definire un layout si utilizza una “stringa modello”, molto simile alla funzione&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6fa8dc;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Printf&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;printf&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;/span&gt; del &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #9fc5e8;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/C_(programming_language)&quot; title=&quot;C (programming language)&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;C&lt;/span&gt;&lt;/a&gt;&amp;nbsp;/&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/C%2B%2B&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;C + +&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&amp;nbsp;.&amp;nbsp;Ci sono anche gli XMLLayout per formattare i messaggi in XML/HTML.&lt;/li&gt;
&lt;/ul&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-line-height-alt: 1.15pt;&quot;&gt;Facciamo adesso degli esempi concreti di utilizzo delle librerie con i linguaggi relativi.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Java e log4j&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;La libreria che si occupa di produrre log in Java (usabile su qualsiasi tipologia di progetto) è log4j. Vediamo un esempio semplice di utilizzo all’interno di un progetto Java creato con eclipse.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l9 level1 lfo6; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Dopo aver scaricato lo zip/tar.gz dal sito, estrarre il contenuto e copiare il log4j*.jar che si trova nella radice della cartella unzippata, nella directory del nostro progetto (p.es. log4j-1.2.16.jar). Fare un &lt;i&gt;Refresh &lt;/i&gt;sul &lt;i&gt;Package Explorer&lt;/i&gt; di eclipse in modo che la libreria venga rilevata. Potremmo mettere il jar anche in un’altra cartella (es. &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;lib&lt;/i&gt;) , ma ciò richiederà di aggiungere tale cartella al build path.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l9 level1 lfo6; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Dalle proprietà del progetto (tx destro) scegliere &lt;i&gt;Java Build Path -&amp;gt;Libraries -&amp;gt; Add JARs&lt;/i&gt;, aggiungere log4j-1.2.16.jar&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l9 level1 lfo6; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;A questo punto il gioco è fatto, si possono usare liberamente le log4j. Ad esempio:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; org.apache.log4j.BasicConfigurator;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;import&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; org.apache.log4j.Logger;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;class&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; EsempioLog4j {&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;static&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;final&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; Logger &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;logger&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; = Logger.&lt;i&gt;getLogger&lt;/i&gt;(EsempioLog4j.&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;class&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;static&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #7f0055; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; main(String[] args) {&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&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;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BasicConfigurator.&lt;i&gt;configure&lt;/i&gt;();&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&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;i&gt;&lt;span style=&quot;color: #0000c0; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;logger&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;.debug(&lt;/span&gt;&lt;span style=&quot;color: #2a00ff; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&quot;Hello World!&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Mandando in esecuzione avremo il seguente output su consolle:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:30:00,709 [main] DEBUG EsempioLog4j - debug&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;0 [main] DEBUG EsempioLog4j&amp;nbsp; - debug&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:30:00,711 [main] INFO&amp;nbsp; EsempioLog4j - info&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2 [main] INFO EsempioLog4j&amp;nbsp; - info&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:30:00,711 [main] WARN&amp;nbsp; EsempioLog4j - warning&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2 [main] WARN EsempioLog4j&amp;nbsp; - warning&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:30:00,711 [main] ERROR EsempioLog4j - error&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2 [main] ERROR EsempioLog4j&amp;nbsp; - error&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:30:00,711 [main] FATAL EsempioLog4j - fatal&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2 [main] FATAL EsempioLog4j&amp;nbsp; - fatal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Il caso mostrato utilizza una configurazione di base. Tale configurazione può essere anche personalizzata mediante un file di configurazione XML o un file equivalente di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;Properties&lt;/i&gt;. Per esempio possiamo creare in eclipse un file xml &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;log4j.xml&lt;/i&gt; nella cartella &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;src&lt;/i&gt; del progetto e copiare ed incollare questa configurazione:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;xml&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;version&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;1.0&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;UTF-8&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; ?&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;DOCTYPE&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;log4j:configuration&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; SYSTEM &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4j.dtd&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;log4j:configuration&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;xmlns:log4j&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;http://jakarta.apache.org/log4j/&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;A1&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;org.apache.log4j.ConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;org.apache.log4j.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 8pt;&quot;&gt; Print the date in ISO 8601 format &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;param&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ConversionPattern&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%d [%t] %-5p %c - %m%n&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;logger&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;com.foo&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 8pt;&quot;&gt; Print only messages of level warn or above in the package com.foo &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;level&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;warn&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;logger&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;root&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;priority&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; =&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;debug&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;appender-ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;A1&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;root&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;log4j:configuration&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: 0cm; mso-add-space: auto;&quot;&gt;Nella classe precedente al posto della riga:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 0cm; mso-add-space: auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 0cm; mso-add-space: auto;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;BasicConfigurator.&lt;i&gt;configure&lt;/i&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 0cm; mso-add-space: auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 0cm; mso-add-space: auto;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;mettere:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: 0cm; mso-add-space: auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;URL url = Loader.&lt;i&gt;getResource&lt;/i&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2a00ff; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&quot;log4j.xml&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;);&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;DOMConfigurator.&lt;i&gt;configure&lt;/i&gt;(url);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;importando le classi necessarie. L’output sarà il seguente:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:20:25,891 [main] DEBUG EsempioLog4j - debug&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:20:25,892 [main] INFO&amp;nbsp; EsempioLog4j - info&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:20:25,892 [main] WARN&amp;nbsp; EsempioLog4j - warning&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:20:25,892 [main] ERROR EsempioLog4j - error&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;2011-03-03 23:20:25,892 [main] FATAL EsempioLog4j – fatal&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Naturalmente è possibile customizzare il file di configurazione a piacere, mandando per esempio l’output su file anzichè su consolle, in questo caso dovremmo definire un apposito appender.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;C/C++ e log4cxx&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Una volta scaricata/compilata la libreria log4cxx, dobbiamo includerla all’interno del nostro progetto. Va detto che compilare la log4cxx non è così banale, soprattutto sotto windows (cygWin/Visual Studio), mentre su linux è tutto molto più semplice col gcc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Sotto linux, installare le librerie apr e apr-util tramite p.es. apt-get, successivamente:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$ tar xzf apache-log4cxx-0.10.0.tar.gz&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$ cd apache-log4cxx-0.10.0/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$ ./configure --prefix=/usr &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;$ make &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;$ make install&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Questo dovrebbe generare le opportune librerie da includere nel nostro Makefile.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Vediamo il caso Windows con VS 2008/2010:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;1.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Andare nel repository di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;APR&lt;/i&gt; di Apache (p.es. &lt;u&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;a href=&quot;http://download.nextag.com/apache/apr/&quot;&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;http://download.nextag.com/apache/apr/&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;2.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Fare il download della libreria&amp;nbsp;&lt;i&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6fa8dc;&quot;&gt;APR&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&amp;nbsp;ed estrarla. Rinominare la cartella&amp;nbsp;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;apr&lt;/i&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;3.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Fare il download libreria &lt;i&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6fa8dc;&quot;&gt;APR-Util&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&amp;nbsp;ed estrarla. Rinominare la cartella&amp;nbsp;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;apr-util.&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;4.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/i&gt;Fare il download dal sito “Apache Logging Services”, di &lt;i&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6fa8dc;&quot;&gt;Log4CXX&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&amp;nbsp;ed estrarla. Al termine di queste operazioni dobbiamo avere una cartella &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;apache-log4cxx-0.10.0&lt;/i&gt; con le sottocartelle &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;log4cxx, apr &lt;/i&gt;e &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;apr-util&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;5.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Download di&amp;nbsp;&lt;i&gt;&lt;a href=&quot;http://gnuwin32.sourceforge.net/packages/sed.htm&quot;&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6fa8dc;&quot;&gt;GNU Sed&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;&amp;nbsp;(setup.exe per Win) e installarlo (mettere la cartella di sed.exe nella variabile di ambiente “Path” di Windows)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;6.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/i&gt;Andare nella directory&amp;nbsp;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;apache-log4cxx-0.10.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;7.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Esegui &amp;nbsp;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;configure.bat&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;8.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Esegui&amp;nbsp;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;configure-aprutil.bat&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;9.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Apri la solution&amp;nbsp;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;log4cxx.dsw&lt;/i&gt;&amp;nbsp;e convertirla ad una sln VS 2008/2010&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 7.35pt; margin-right: 0cm; margin-top: 0cm; mso-list: l5 level1 lfo8; tab-stops: list 18.0pt; text-indent: -17.85pt;&quot;&gt;10.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Selezionare i progetti &lt;i&gt;apr, apr-util &lt;/i&gt;e il progetto &lt;i&gt;log4cxx&lt;/i&gt; e compilarli in ordine.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: -10.5pt; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: -10.5pt; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;Al termine della procedura dovremmo ottenere la libreria statica &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;log4cxx.lib&lt;/i&gt; e quella dinamica &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;log4cxx.dll.&lt;/i&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: -10.5pt; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;A questo punto il gioco è fatto. Basta includere nel nostro progetto la libreria &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;log4cxx.lib &lt;/i&gt;e la cartella&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt; include &lt;/i&gt;di&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt; \apache-log4cxx-0.10.0\src\main\log4cxx &lt;/i&gt;nelle opzioni del &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;Linker&lt;/i&gt; e&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt; &lt;/i&gt;in quelle di inclusione dalle Proprietà del progetto. Inoltre aggiungiamo anche &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;log4cxx.dll &lt;/i&gt;nella cartella del nostro progetto. Facciamo un esempio di codice C++:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: -10.5pt; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&amp;lt;log4cxx/logger.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&amp;lt;log4cxx/xml/domconfigurator.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;#include&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&amp;lt;iostream&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; log4cxx;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; log4cxx::xml;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; log4cxx::helpers;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; std;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;// Define static logger variable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;LoggerPtr loggerMyMain(Logger::getLogger( &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;main&quot;&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;LoggerPtr loggerFunctionA(Logger::getLogger( &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;functionA&quot;&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;void&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; functionA()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOG4CXX_INFO(loggerFunctionA, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Executing functionA.&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; main(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; argc, const char* argv[] )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// Load configuration file&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DOMConfigurator::configure(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Log4cxxConfig.xml&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOG4CXX_TRACE(loggerMyMain, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;debug message (detailed)&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOG4CXX_DEBUG(loggerMyMain, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;debug message&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOG4CXX_INFO (loggerMyMain, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;info message&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOG4CXX_WARN (loggerMyMain, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;warn message&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOG4CXX_ERROR(loggerMyMain, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;error message&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOG4CXX_FATAL(loggerMyMain, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;fatal message!!!&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;functionA();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: -10.5pt; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: 6.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 5.25pt;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;Il file &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;log4cxxConfig.xml&lt;/i&gt; deve essere creato nella cartella principale del nostro progetto e rappresenta la configurazione del log. Per esempio:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: 6.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 5.25pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;xml&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;1.0&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;UTF-8&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; ?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;log4j:configuration&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;xmlns:log4j&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;http://jakarta.apache.org/log4j/&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; Output the log message to system console.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;appxConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;org.apache.log4j.ConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;param&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Target&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;System.out&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;org.apache.log4j.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;param&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ConversionPattern&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%-5p %c{1} - %m%n&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;!--&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; Output the log message to log file&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;appxNormalAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;org.apache.log4j.FileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;param&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;file&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;appxLogFile.log&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;param&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;append&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;org.apache.log4j.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;param&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ConversionPattern&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%d %-5p [%t:%x] %C{2} (%F:%L) - %m%n&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;root&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;priority&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;all&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;appender-ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;appxNormalAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;appender-ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;appxConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;root&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;!--&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; Specify the level for some specific categories &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;category&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;functionA&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;priority&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; =&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;info&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;appender-ref&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;ref&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;appxNormalAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;appender-ref&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;ref&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;appxConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;category&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: 6.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 5.25pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;log4j:configuration&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: 6.0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 5.25pt;&quot;&gt;L’output del programma sarà il seguente:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt; line-height: 115%;&quot;&gt;TRACE main - this is a debug message for detailed code discovery.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt; line-height: 115%;&quot;&gt;DEBUG main - this is a debug message.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt; line-height: 115%;&quot;&gt;INFO&amp;nbsp; main - this is a info message, ignore.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt; line-height: 115%;&quot;&gt;WARN&amp;nbsp; main - this is a warn message, not too bad.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt; line-height: 115%;&quot;&gt;ERROR main - this is a error message, something serious is happening.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt; line-height: 115%;&quot;&gt;FATAL main - this is a fatal message!!!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt; line-height: 115%;&quot;&gt;INFO&amp;nbsp; functionA - Executing functionA.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Il logger oltrechè su consolle scriverà anche su file (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;appxLogFile.log&lt;/i&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;.NET (C#/VB.NET/ASP.NET) e log4net&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Vediamo un esempio di utilizzo di log4net dentro un normale progetto .NET (Console Application), usando Visual Studio 2010.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Per inserire log4net dentro un progetto .NET (C#,VB.NET,ASP.NET) è sufficiente effettuare i seguenti passi:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l1 level1 lfo3; text-indent: -18.0pt;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Una volta scaricata/compilata log4net.dll, copiarla nella directory di progetto.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;In Visual Studio cliccare col tasto destro e aggiungere un nuovo riferimento (aggiungi Riferimento/Reference dal menù contestuale) a log4net.dll: scegliere sfoglia e selezionare log4net.dll.&lt;/li&gt;
&lt;li&gt;Aggiungere un file &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;App.config&lt;/i&gt; al progetto (tasto destro sul progetto in VS -&amp;gt; Aggiungi Nuovo Elemento-&amp;gt;General-&amp;gt;Application Configuration File)&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;Copiare ed incollare in &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;App.config&lt;/i&gt;&amp;nbsp; il seguente contenuto xml che rappresenta la configurazione di log4net:&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l1 level1 lfo3; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;File App.config&lt;/i&gt;&amp;nbsp; &lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;xml&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;version&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;1.0&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;utf-8&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; ?&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;configuration&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;configSections&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;section&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net&lt;/span&gt;&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;type&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Config.Log4NetConfigurationSectionHandler,&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log4net&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;configSections&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;log4net&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;root&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;level&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ALL&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;appender-ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;LogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;appender-ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;ref&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ColoredConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;root&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;LogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.FileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;param&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;File&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;MyLog.txt&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;param&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;AppendToFile&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;type&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;param&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ConversionPattern&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%d [%t] %-5p %c %m%n&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;name&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ColoredConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.ColoredConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;mapping&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;level&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ERROR&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;foreColor&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Red&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: green; font-family: Consolas; font-size: 8pt;&quot;&gt; &amp;lt;backColor value=&quot;Red, HighIntensity&quot; /&amp;gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;mapping&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;mapping&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;level&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;DEBUG&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;backColor&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Blue&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;foreColor&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Green&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;mapping&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;mapping&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;level&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;WARN&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;foreColor&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Yellow&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;mapping&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;mapping&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;level&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;INFO&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;foreColor&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;White&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;mapping&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;type&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;conversionPattern&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%date [%thread] %-5level %logger&amp;nbsp; - %message%newline&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;log4net&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 8pt;&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Come si vede in questo file decidiamo il formato dei messaggi, i loro colori ecc. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto; mso-list: l4 level1 lfo4; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Fare attenzione al profilo scelto per il progetto. Non usare un &lt;i&gt;Client Profile&lt;/i&gt; che di solito è quello di default nel caso di Console Application in VS 2010. Ciò non è possiblie a causa della dipendenza di log4net dall’assembly &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;System.Web&lt;/i&gt;. Scegliere come Target Profile per esempio .NET Framework 4 (dalle proprietà del progetto). Usando il&lt;i&gt; Client Profile&lt;/i&gt; si possono avere problemi di riconoscimento della libreria log4net col seguente errore : “The type or namespace name &#39;log4net&#39; could not be found (are you missing a using directive or an assembly reference?)”&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; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto; mso-list: l4 level1 lfo4; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Utilizzare ora liberamente log4net, &amp;nbsp;ad esempio:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; log4net;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; log4net.Config;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;namespace&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; EsempiodiUsoLog4Net&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Program&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;readonly&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ILog&lt;/span&gt; logger = &lt;span style=&quot;color: #2b91af;&quot;&gt;LogManager&lt;/span&gt;.GetLogger(&lt;span style=&quot;color: blue;&quot;&gt;typeof&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;Program&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Main(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;ILog&lt;/span&gt; log = &lt;span style=&quot;color: #2b91af;&quot;&gt;LogManager&lt;/span&gt;.GetLogger(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;MyLogger&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;XmlConfigurator&lt;/span&gt;.Configure();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.Error(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Error&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.Warn(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Warning&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;log.Info(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Info.&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.Debug(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;debug..&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.ReadLine();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;L’output sarà:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://lh3.googleusercontent.com/-JCwdJUkzWFc/TXDuzgZwmCI/AAAAAAAAAEg/jp2ggqVrp2E/s1600/log4net_out.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;161&quot; src=&quot;https://lh3.googleusercontent.com/-JCwdJUkzWFc/TXDuzgZwmCI/AAAAAAAAAEg/jp2ggqVrp2E/s320/log4net_out.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;v:shapetype coordsize=&quot;21600,21600&quot; filled=&quot;f&quot; id=&quot;_x0000_t75&quot; o:preferrelative=&quot;t&quot; o:spt=&quot;75&quot; path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; stroked=&quot;f&quot;&gt;  &lt;v:stroke joinstyle=&quot;miter&quot;&gt;  &lt;v:formulas&gt;   &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;&gt;   &lt;v:f eqn=&quot;sum @0 1 0&quot;&gt;   &lt;v:f eqn=&quot;sum 0 0 @1&quot;&gt;   &lt;v:f eqn=&quot;prod @2 1 2&quot;&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;&gt;   &lt;v:f eqn=&quot;sum @0 0 1&quot;&gt;   &lt;v:f eqn=&quot;prod @6 1 2&quot;&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;&gt;   &lt;v:f eqn=&quot;sum @8 21600 0&quot;&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;&gt;   &lt;v:f eqn=&quot;sum @10 21600 0&quot;&gt;  &lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;  &lt;v:path gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot; o:extrusionok=&quot;f&quot;&gt;  &lt;o:lock aspectratio=&quot;t&quot; v:ext=&quot;edit&quot;&gt; &lt;/o:lock&gt;&lt;/v:path&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;v:shape id=&quot;Picture_x0020_2&quot; o:spid=&quot;_x0000_i1025&quot; style=&quot;height: 160.5pt; mso-wrap-style: square; visibility: visible; width: 317.25pt;&quot; type=&quot;#_x0000_t75&quot;&gt;  &lt;v:imagedata o:title=&quot;&quot; src=&quot;file:///C:\Users\ANDREA~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png&quot;&gt; &lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;.NET&amp;nbsp; (C++/CLI) e log4net&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Utilizzare log4net all’interno di un progetto C++/CLI è leggermente più oneroso rispetto al caso C#/VB.NET/ASP.NET.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto; mso-list: l4 level1 lfo4; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Una volta scaricata/compilata log4net.dll, copiarla nella directory di progetto.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto; mso-list: l4 level1 lfo4; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;In Visual Studio cliccare col tasto destro e aggiungere un nuovo riferimento (aggiungi Riferimento/Reference dal menù contestuale) a log4net.dll: scegliere sfoglia e selezionare log4net.dll.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto; mso-list: l4 level1 lfo4; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Aggiungere un file &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;app.config&lt;/i&gt; al progetto (tasto destro sul progetto in VS -&amp;gt; Aggiungi Nuovo Elemento -&amp;gt; Utilità-&amp;gt;File di configurazione in VS 2008/ Application Configuration File in VS 2010). Copiare ed incollare il contenuto del file &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;App.config&lt;/i&gt; visto nel caso C#/VB.NET/ASP.NET .&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto; mso-list: l4 level1 lfo4; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Copiare l’&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;app.config &lt;/i&gt;nella directory di output aggiungendo la riga di comando “&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;copy app.config &quot;$(TargetPath).config&lt;/i&gt;” come evento di post-compilazione del progetto. Ciò creerà un file &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&amp;lt;nome_mia_app&amp;gt;.config&lt;/i&gt; nella directory di output del progetto.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto; mso-list: l4 level1 lfo4; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Aggiungere /SUBSYSTEM:CONSOLE tra le opzioni del Linker (Linker-&amp;gt;Sistema-&amp;gt;Sottosistema) nel caso si voglia l’output a consolle. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto; mso-list: l4 level1 lfo4; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Leggere le considerazioni sul Target Profile fatte nel caso C#/VB.NET/ASP.NET.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: 38.25pt; mso-add-space: auto; mso-list: l4 level1 lfo4; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Ora possiamo usare log4net all’interno del progetto C++/CLI.&amp;nbsp; Facciamo un esempio:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;File Log.cpp&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;#include&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;StdAfx.h&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;#include&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Log.h&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; log4net;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;using&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; log4net::Config;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;Log::Log(&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log4net::ILog^ log = LogManager::GetLogger(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;MyLogger&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlConfigurator::Configure();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log-&amp;gt;Error(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Error&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log-&amp;gt;Warn(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Warning&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;log-&amp;gt;Info(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Info.&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log-&amp;gt;Debug(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;debug..&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;L’output sarà lo stesso visto nel caso C#.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;PHP e log4php&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;Log4php è la libreria di log dedicata agli sviluppatori PHP. In pratica ha le stesse proprietà comuni alle altre librerie e la stessa struttura. Supporta i seguenti appenders:&amp;nbsp; &lt;i&gt;File, RollingFile, DailyFile, Echo, Console, Mail, PDO, PHP error, Syslog or NT events e Socket&lt;/i&gt;; nonchè i seguenti layouts: &lt;i&gt;Simple, TTCC, Pattern, Html e Xml&lt;/i&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;L’installazione consiste nei seguenti semplici punti:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l7 level1 lfo10; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;Scaricare      la libreria e unzipparla&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l7 level1 lfo10; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;Copiare      la cartella&lt;i&gt; src/main/php&lt;/i&gt; in quella dell’applicazione, p.es.      &lt;i&gt;$YOURAPP/log4php&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l7 level1 lfo10; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;Includere      (require) la classe &lt;i&gt;log4php/Logger.php&lt;/i&gt; nell’applicazione&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;L’esempio d’uso è quasi banale:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;require_once dirname(__FILE__).&#39;/../../main/php/Logger.php&#39;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;Logger::configure(dirname(__FILE__).&#39;/../resources/layout_simple.xml&#39;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;$logger = Logger::getRootLogger();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;$logger-&amp;gt;info(&quot;Hello World!&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Proprietà dinamiche&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;Qualcuno si chiederà come sia possibile dare proprietà dinamiche agli appenders: per esempio dare un nome a un log file dinamico. Le librerie supportano le proprietà dinamiche settabili via codice. Per esempio se volessimo un nome di file dinamico possiamo mettere nel file di configurazione (nella sezione appender):&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;file type=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #006080; font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;log4net.Util.PatternString&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #006080; font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;C:\logs\%property{LogName}&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;Tale proprietà potrà essere settata via codice. Per esempio in C#:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;log4net.GlobalContext.Properties[&lt;/span&gt;&lt;span style=&quot;color: #006080; font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;LogName&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;] = &lt;/span&gt;&lt;span style=&quot;color: #006080; font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;file1.log&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;Ricordarsi di settare le proprietà del &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;GlobalContext&lt;/i&gt; prima di richiamare il logger, ossia prima della riga &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: 9.5pt;&quot;&gt;ILog&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; log = &lt;span style=&quot;color: #2b91af;&quot;&gt;LogManager&lt;/span&gt;.GetLogger(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;MyLogger&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;Insieme alle proprietà dinamiche possiamo definire anche dei &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;PropertyFilter&lt;/i&gt;. Per esempio definendo nel file di configurazione:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;filter type=&lt;/span&gt;&lt;span style=&quot;color: #006080; font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;log4net.Filter.PropertyFilter&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #606060; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;Key &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #006080; font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;Version&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #606060; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;StringToMatch &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 8pt;&quot;&gt;value&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #006080; font-family: Consolas; font-size: 8pt;&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 8pt;&quot;&gt;&amp;lt;/filter&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;Possiamo scegliere via codice la versione del file di log sul quale mandare i messaggi:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;log4net.ThreadContext.Properties[&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #006080; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&quot;Version&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;] &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 9.5pt;&quot;&gt;= &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #006080; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Consolas; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;log.Warn(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Warning on the version 1 of the log file&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #F4F4F4; line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;ci sono ancora molte proprietà che contraddistinguono le librerie di log di Apache, ma elencarle tutte sarebbe troppo lungo in questo articolo. Si rimanda quindi alla relativa documentazione sul sito.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Tools di visualizzazione&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Uno dei vantaggi di utilizzare una libreria di Apache Logging Services è che esistono una serie di tool di visualizzazione dei log prodotti da tali librerie. Uno è per esempio fornito da Apache stesso:&amp;nbsp; &lt;a href=&quot;http://logging.apache.org/chainsaw/index.html&quot;&gt;Chainsaw&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;Chainsaw è stato pensato per log4j ma è possibile interfacciarlo anche con le altre librerie della famiglia per mezzo dell’&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;UdpAppender&lt;/i&gt;. Si rimanda alla relativa documentazione per il suo utilizzo e configurazione.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://lh3.googleusercontent.com/-ito0RHO3v_8/TXD5coKMAZI/AAAAAAAAAEo/qGbnM5HIClA/s1600/chainsaw-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;230&quot; src=&quot;https://lh3.googleusercontent.com/-ito0RHO3v_8/TXD5coKMAZI/AAAAAAAAAEo/qGbnM5HIClA/s400/chainsaw-1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/978116143851959783/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/03/apache-logging-services-log-4-all.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/978116143851959783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/978116143851959783'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/03/apache-logging-services-log-4-all.html' title='Apache Logging Services:  A Log 4 All Languages'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh6.googleusercontent.com/-xrFFdFphhFk/TXD3zr_b3hI/AAAAAAAAAEk/0__1YqCCA60/s72-c/ls-logo.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-9091502540550822411</id><published>2011-02-28T23:55:00.000+01:00</published><updated>2011-03-02T12:54:26.244+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="boxing"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="wrapping"/><title type='text'>Passaggio di parametri ai metodi in Java e C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://lh5.googleusercontent.com/-1JXlVwvpJaM/TWutM4uiqGI/AAAAAAAAAEQ/KOZA7ISpUQc/s1600/dotnet-vs-java+%25281%2529.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://lh5.googleusercontent.com/-1JXlVwvpJaM/TWutM4uiqGI/AAAAAAAAAEQ/KOZA7ISpUQc/s1600/dotnet-vs-java+%25281%2529.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 13.5pt; margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt;&quot;&gt;Diamo oggi un’occhiata ad un argomento che ho notato solleva dubbi ai programmatori principianti: come vengono trattati gli oggetti e le variabili passati come argomenti ai metodi, per riferimento o per valore e quali sono le differenze tra i due linguaggi C# e Java. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;Iniziamo col dire cosa significa passaggio “per valore” e passaggio “per riferimento” (indipendentemente dal linguaggio utilizzato):&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Valore&lt;/b&gt;: viene creata una copia di una variabile al momento della chiamata, per cui il metodo non agisce direttamente sulla variabile originale ma solo sulla sua copia, quindi all’uscita di tale metodo la variabile originale rimarrà immutata&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Riferimento&lt;/b&gt;: viene passato un riferimento (indirizzo) alla variabile per cui il metodo chiamato agirà direttamente sulla variabile originale tramite il suo riferimento.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;text-align: left; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;Anche le variabili si suddividono principalmente in due tipologie:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;ValueTypes: &amp;nbsp;&lt;/b&gt;sono i cosiddetti tipi primitivi. Vengono usualmente allocati nello &lt;a href=&quot;http://it.wikipedia.org/wiki/Allocazione_dinamica_della_memoria&quot;&gt;stack&lt;/a&gt;. Esempi di tipi primitivi sono int, double, float e le strutture (p. es. la struttura Int32 per .NET)&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;ReferenceTypes: &lt;/b&gt;sono i cosiddetti tipi complessi.&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt; &amp;nbsp;&lt;/b&gt;Sono tutti gli oggetti definiti tramite una “class”. Usualmente tali tipi vengono allocati nel &lt;a href=&quot;http://it.wikipedia.org/wiki/Allocazione_dinamica_della_memoria&quot;&gt;Managed Heap&lt;/a&gt; tramite una &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;new.&amp;nbsp;&lt;/i&gt;Esempi sono le classi che noi creiamo, oppure quelle preesistenti nel framework (p.es. la classe Integer in Java è un Reference Type)&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://lh3.googleusercontent.com/-YyT_nYO2m2I/TWur6lGF-8I/AAAAAAAAAEM/6AThn_ounBg/s1600/cts.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;https://lh3.googleusercontent.com/-YyT_nYO2m2I/TWur6lGF-8I/AAAAAAAAAEM/6AThn_ounBg/s320/cts.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;text-align: left; text-indent: -18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;text-align: left; text-indent: -18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 13.5pt; margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt;&quot;&gt;&lt;b&gt;In Java e C# tutte le variabili (&lt;i&gt;ValueTypes&lt;/i&gt; o &lt;i&gt;ReferenceTypes&lt;/i&gt;) vengono passate ai metodi, di default, per valore.&lt;/b&gt; Sfatiamo il mito che dice che in Java le variabili primitive sono passate per valore e gli oggetti per riferimento: è corretto invece dire che in Java (come in C#), vengono passati i riferimenti agli oggetti per valore, &amp;nbsp;così come confermato dallo stesso James Gosling, uno degli inventori di Java:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 13.5pt; margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 13.5pt; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: Georgia, serif; font-size: 11.5pt;&quot;&gt;“Some people will say incorrectly that objects are passed “by reference.” In programming language design, the term pass by reference properly means that when an argument is passed to a function, the invoked function gets a reference to the original value, not a copy of its value. If the function modifies its parameter, the value in the calling code will be changed because the argument and parameter use the same slot in memory…. The Java programming language does not pass objects by reference; it passes object references by value. Because two copies of the same reference refer to the same actual object, changes made through one reference variable are visible through the other. There is exactly one parameter passing mode — pass by value — and that helps keep things simple.”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 13.5pt; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: Georgia, serif; font-size: 11.5pt;&quot;&gt;James Gosling – The Java Programming Language, 4th Edition&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;i&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: Georgia, serif; font-size: 11.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;Java e C# hanno quindi lo stesso comportamento. Vediamo un esempio in Java sui tipi primitivi:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; ...&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; A_method(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; k){&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt; i=10*k; &lt;span style=&quot;color: green;&quot;&gt;//questa i è locale al metodo e non ha niente a che fare con quella esterna&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k=5;&lt;span style=&quot;color: green;&quot;&gt; //qui si modifica il valore di una variabile locale al metodo (k)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;...&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; i=2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;A a;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;a.A_method(i);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt; j=i;&lt;span style=&quot;color: green;&quot;&gt;//qui si avrà j=i=2 e non 5!&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;line-height: 13.5pt; margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt;&quot;&gt;La chiamata al metodo passando per valore la variabile&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt; i&lt;/i&gt;, non sortisce su questa alcun effetto anche se &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;A_method&lt;/i&gt; copia il valore di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;i &lt;/i&gt;su un’altra variabile &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;k&lt;/i&gt;. In C# il discorso è analogo.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 13.5pt; margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt;&quot;&gt;Il discorso per i &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ReferenceTypes&lt;/i&gt; è invece differente e merita un pò di attenzione.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 13.5pt; margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt;&quot;&gt;Soprattutto in C#, il passaggio per valore di un oggetto (che è quello di default), può creare qualche confusione iniziale e qualche sorpresa. &amp;nbsp;Abbiamo visto che passare un oggetto per valore significa che verrà creata una copia non dell’oggetto stesso, ma del suo riferimento. Ciò significa che se io chiamo un metodo e gli passo un oggetto, verrà creata una copia del riferimento e cioè tale copia del riferimento punterà all’oggetto stesso: il risultato è che le modifiche apportate ad un oggetto dentro al metodo in C# saranno persistenti.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;Si considerino le seguenti classi C#:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas;&quot;&gt;class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; val {&lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;;&lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas;&quot;&gt;class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Class1&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; {&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; A_byVal1(&lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt; k)&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k.val = 10; &lt;span style=&quot;color: green;&quot;&gt;//qui i riferimenti di k e ag sono gli stessi e l’istruzione agisce su ag&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt; b = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt;(); &lt;span style=&quot;color: green;&quot;&gt;//questo new crea un nuovo riferimento &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.val = 100; &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k = b; &lt;span style=&quot;color: green;&quot;&gt;//questo copia il riferimento di b in k&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k.val = 200; &lt;span style=&quot;color: green;&quot;&gt;//qui k.val e b.val valgono entrambi 200, ma ag.val vale sempre 10!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; }&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; margin-left: 70.8pt; margin-right: 0cm; margin-top: 0cm; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;con le seguenti istruzioni:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;Class1&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; c1 = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Class1&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;A&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; ag1 = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;ag1.val = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;c1.A_byVal1(ag1); &lt;span style=&quot;color: green;&quot;&gt;//all’uscita ag1.val vale 10: non 1, non 100 e nemmeno 200!&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;All’uscita del metodo &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;A_byVal1&lt;/i&gt;, &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag1.val&lt;/i&gt; &amp;nbsp;vale 10 perchè al momento della chiamata di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;A_byVal1&lt;/i&gt; viene creata una copia della reference di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag1&lt;/i&gt; (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ref_ag1&lt;/i&gt;), chiamiamola &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag1_ref_copy&lt;/i&gt;: ma allora &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ref_ag1&lt;/i&gt; e &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag1_ref_copy&lt;/i&gt; puntano entrambe ad &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag1&lt;/i&gt; e da ciò si capisce come &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;k.val = 10&lt;/i&gt;; vada a modificare il reale valore dell’oggetto &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag1&lt;/i&gt; originale. La &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;new&lt;/i&gt; dentro il metodo crea un altro oggetto &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;b&lt;/i&gt; nel Managed Heap, ne inizializza il valore a 100 e copia il riferimento dell’oggetto &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;b&lt;/i&gt; in &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;k&lt;/i&gt;: ciò significa che l’oggetto originale &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag&lt;/i&gt; non viene più modificato poichè il riferimento di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;k&lt;/i&gt; punta ad una variabile locale &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;b&lt;/i&gt;, che verrà segnata per l’eliminazione all’uscita del metodo dal GC. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;Il meccanismo per passare variabili (primitive e non) ad un metodo per riferimento in C# prevede l’utilizzo della parola chiave &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ref &lt;/i&gt;(tale metodologia ha origini probabilmente dal C++ in cui si usava il carattere &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&amp;amp;&lt;/i&gt; per indicare il passaggio per riferimento di una variabile):&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; A_byRef2(&lt;span style=&quot;color: blue;&quot;&gt;ref&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt; k)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //qui k e ag puntano alla stessa locazione (ag.val = 0)&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt; b = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt;(); &lt;span style=&quot;color: green;&quot;&gt;//questo new crea un nuovo riferimento&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.val = 10;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; k = b;&lt;span style=&quot;color: green;&quot;&gt; //questo copia il riferimento di b in k, ma quindi anche ag punta a b&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;Class1&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; c1 = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Class1&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;A&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; ag1 = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;ag1.val = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;c1.A_byRef2(&lt;span style=&quot;color: blue;&quot;&gt;ref&lt;/span&gt; ag); &lt;span style=&quot;color: green;&quot;&gt;//all’uscita ag1.val vale 10, non 0!&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;Come si nota, pur creando un riferimento locale, all’uscita del metodo&amp;nbsp; &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag.val&lt;/i&gt;&amp;nbsp; varrà 10: ciò avviene perchè al momento della chiamata non viene fatta una copia del riferimento di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag&lt;/i&gt;, ma viene usata proprio quella locazione: per cui quando copio &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;b&lt;/i&gt; in &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;k&lt;/i&gt;, sto copiando proprio sulla locazione di memoria puntata da &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag&lt;/i&gt;. A differenza del caso del passaggio per valore (metodo &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;A_byVal1&lt;/i&gt;), all’uscita del metodo la locazione creata nello heap con la &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;new&lt;/i&gt; (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;b&lt;/i&gt;), non verrà segnata per la distruzione dal GC perchè puntata ancora da &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag&lt;/i&gt;. Qualcuno potrebbe chiedersi come mai l’operatore di assegnamento delle variabili &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ReferenceType&lt;/i&gt; agisce sui riferimenti e non sui valori: il motivo è che quando usiamo gli operatori noi passiamo le variabili per valore e se usiamo i &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ReferenceTypes&lt;/i&gt; passeremo per valore i riferimenti alle variabili contenenti i valori. In .NET e Java i vari operatori (=,+=,-= ecc.), come tutti i metodi che ricevono &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ReferenceTypes&lt;/i&gt;, agiscono sull&#39;indirizzo di memoria dell&#39;oggetto, ovvero l&#39;indirizzo che fa riferimento all&#39;oggetto. Come noto invece, i &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ValueTypes&lt;/i&gt; contengono invece direttamente il valore e non sono sotto il controllo del GC. La differenza tra &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ValueTypes&lt;/i&gt; e &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ReferenceTypes&lt;/i&gt; spesso viene mascherata dal meccanismo di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;boxing&lt;/i&gt; -&amp;nbsp; &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;unboxing (wrapping – unwrapping &lt;/i&gt;in Java&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;) &lt;/i&gt;che consiste nell’incapsulare il &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ValueType&lt;/i&gt; dentro un &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ReferenceType&lt;/i&gt;. Proviamo a sottoporre alle stesse operazioni due variabili, una &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ValueType&lt;/i&gt; e una &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ReferenceType&lt;/i&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;Data la classe &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;A&lt;/i&gt; vista prima, si consideri il seguente esempio in C#:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;A&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt; d_ref1 = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt;();&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// Allocato nell&#39;heap&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;double&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt; d_val1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// Allocato nello stack&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;d_ref1.val = 10;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// Cambia il riferimento a cui punta&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;d_val1 = 10;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// Cambiato il valore nello stack&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;A&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt; d_ref2 = d_ref1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// Copia il solo riferimento (puntatore)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;double&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt; d_val2 = d_val1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// Alloca nello stack e copia il valore&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;d_ref1.val = 20;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;d_val1 = 20;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;Console&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;d_ref1.val = {0}, d_ref2 = {1}&quot;&lt;/span&gt;, d_ref1.val, d_ref2.val);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;Console&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;d_val1 = {0}, d_val2 = {1}&quot;&lt;/span&gt;, d_val1, d_val2);&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;Eseguendo questo codice si otterrà il seguente output:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;d_ref1.val = 20, d_ref2.val = 20&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;d_val1 = 20, d_val2 = 10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;Ossia quando si applica l’operatore di assegnamento (cfr. metodo) ai &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ValueTypes&lt;/i&gt; e ai &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ReferenceTypes&lt;/i&gt; si ha un comportamento differente perchè l’operatore di assegnamento agisce direttamente sui valori dei primi e sugli indirizzi dei secondi (&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;d_val1 = 20&lt;/i&gt; non interferisce con &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;d_val2&lt;/i&gt;, mentre &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;d_ref1.val = 20&lt;/i&gt;; fa in modo che pure &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;d_ref2.val&lt;/i&gt; punti alla locazione contenente 20. Nota: in questo esempio C# non potevamo usare Double al posto di A perchè essa, pur effettuando il boxing di double, è una structure che comunque viene allocata nello stack di default.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;Anche in Java gli oggetti Reference sono passati ai metodi per valore dei riferimenti, perciò l&#39;oggetto referenziato può essere modificato dal metodo. Il comportamento è del tutto simile al C#. Per verificarlo facciamo un esempio.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt;&quot;&gt;Supponiamo di avere le seguenti &amp;nbsp;classi Java:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; val=0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Class1&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; A_byRef(A k) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;k.val=20; &lt;span style=&quot;color: green;&quot;&gt;//qui i riferimenti di k e ag sono gli stessi e l’istruzione agisce su ag&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k= &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; A(); &lt;span style=&quot;color: green;&quot;&gt;//qui viene creato un nuovo riferimento per k&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k.val=100; &lt;span style=&quot;color: green;&quot;&gt;//questa istruzione agisce solo su k locale&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;} &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Effettuiamo una chiamata al metodo&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; A_byRef: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: xx-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;Class1&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; c1 = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Class1&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt; ag = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;A&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;ag.val = 5;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; c1.A_byRef(ag);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; int i = ag.val; &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;//i vale 20 non 5 e nemmeno 100 &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;Il caso di Java è del tutto simile a quello di C#: il riferimento di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag&lt;/i&gt; viene passato per valore cosicchè alla chiamata viene fatta una copia di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ref_ag, ref_ag_copy&lt;/i&gt;. A questo punto l’istruzione (e solo quella) &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;k.val=20;&lt;/i&gt; agirà sull’istanza di &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag&lt;/i&gt; originale, mentre la copia creata successivamente con la &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;new&lt;/i&gt; crea un nuovo riferimento ad un’altra istanza di oggetto nello heap di tipo &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;A&lt;/i&gt;, per cui &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;k.val=100&lt;/i&gt; non ha ripercussioni su &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ag&lt;/i&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;A questo punto nasce una domanda spontanea: si possono passare variabili in Java per riferimento come in C#? La risposta è no! Non esiste in Java l’equivalente della parola chiave &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ref&lt;/i&gt; e ciò spiega come mai non potremmo mai scambiare due variabili &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;int&lt;/i&gt; dentro un metodo Java senza l’utilizzo della tecnica del boxing!&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; badSwapInJava(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; var1, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; var2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; temp = var1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp; var1 = var2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;var2 = temp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Il metodo&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; badSwapInJava()&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt; non altera le variabili passate. Facendo il boxing (alias &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;wrapping&lt;/i&gt;) otteniamo il risultato voluto:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas;&quot;&gt;public void&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt; boxingSwapInJava(MyInteger rWrap, MyInteger sWrap) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt; t = rWrap.getValue();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas;&quot;&gt;rWrap.setValue(sWrap.getValue());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sWrap.setValue(t);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/9091502540550822411/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/passaggio-di-parametri-ai-metodi-in.html#comment-form' title='1 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/9091502540550822411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/9091502540550822411'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/passaggio-di-parametri-ai-metodi-in.html' title='Passaggio di parametri ai metodi in Java e C#'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh5.googleusercontent.com/-1JXlVwvpJaM/TWutM4uiqGI/AAAAAAAAAEQ/KOZA7ISpUQc/s72-c/dotnet-vs-java+%25281%2529.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-7480734398447851926</id><published>2011-02-24T23:35:00.000+01:00</published><updated>2011-03-02T13:11:37.161+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Attached Properties"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="MarkupExtensions"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><category scheme="http://www.blogger.com/atom/ns#" term="WPF"/><category scheme="http://www.blogger.com/atom/ns#" term="XAML"/><title type='text'>Interfacce grafiche in .NET con il linguaggio XAML</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0cm;&quot;&gt;&lt;div style=&quot;line-height: normal;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-OC-5WDwI9EE/TWTl6NZ6CaI/AAAAAAAAAEE/-stCkA4d9cI/s1600/Xaml.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-OC-5WDwI9EE/TWTl6NZ6CaI/AAAAAAAAAEE/-stCkA4d9cI/s1600/Xaml.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Quando si vogliono realizzare delle applicazioni in .NET con &lt;i&gt;Silverlight&lt;/i&gt;, oppure delle presentazioni WPF (&lt;i&gt;Windows Presentation Forms&lt;/i&gt;) si ha bisogno di conoscere il linguaggio XAML (&lt;i&gt;eXtensible&amp;nbsp;Application Markup Language&lt;/i&gt;). XAML è un linguaggio sviluppato all&#39;interno del .NET Framework, che ci permette di descrivere delle interfacce utente per mezzo di un documento XML in modo schematico.&lt;/div&gt;&lt;div style=&quot;line-height: normal;&quot;&gt;Quali sono le proprietà e perchè è stato scelto di usare XAML?&lt;/div&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Come per gli altri linguaggi .NET, XAML viene compilato in codice intermedio (IL).&lt;/li&gt;
&lt;li&gt;Utilizza &lt;a href=&quot;http://it.wikipedia.org/wiki/Grafica_vettoriale&quot;&gt;grafica vettoriale&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Le proprietà di presentazione sono parte del linguaggio (a differenza di &lt;a href=&quot;http://it.wikipedia.org/wiki/XML_User_Interface_Language&quot;&gt;XUL&lt;/a&gt;&amp;nbsp;che utilizza i CSS). Ciò lo rende più facile da scrivere, ma più difficile da modificare.&lt;/li&gt;
&lt;li&gt;XAML utilizza le librerie e le classi .NET come un vero e proprio linguaggio del Framework&lt;/li&gt;
&lt;li&gt;XAML dà possibilità di includere codice C# associato (XUL usa Javascript)&lt;/li&gt;
&lt;li&gt;Gli eventi sono proprietà dei tag e i tag sono widget.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: normal;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Le regole di XAML sono semplici:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Ciascun elemento di un documento XAML viene mappato ad una classe in .NET (es. &lt;i&gt;Button&lt;/i&gt;)&lt;/li&gt;
&lt;li&gt;Gli elementi hanno una struttura gerarchica in modo tale che gli elementi contengono o sono contenuti da altri elementi (es. &lt;i&gt;Button &lt;/i&gt;dentro una &lt;i&gt;Window&lt;/i&gt;)&lt;/li&gt;
&lt;li&gt;Si può accedere alle proprietà “semplici” di una classe per mezzo degli attributi di un elemento (es. &lt;i&gt;Button &lt;/i&gt;“&lt;i&gt;Content&lt;/i&gt;”), oppure, se la proprietà è a sua volta un oggetto, tramite un mappaggio proprietà-elemento (es. &lt;i&gt;Button&lt;/i&gt;.&lt;i&gt;Background&lt;/i&gt;)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Supponiamo di voler creare un bottone contenuto in una finestra che abbia un certo titolo. In C# scriveremo:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;namespace&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; PED.Demo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Consolas; font-size: 13px;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Program&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style=&quot;color: #2b91af;&quot;&gt;STAThread&lt;/span&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Main()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; b = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Button&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Content = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Click Me!&quot;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; w = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Window&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;XAML Demo&quot;&lt;/span&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Content = b&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; app = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Application&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&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;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;app.Run(w);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;Tale finestra può essere espressa anche in linguaggio XAML:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;i&gt;File&amp;nbsp;MainWindow.xaml&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Window&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; x&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;:&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;WpfApplication1.MainWindow&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Consolas; font-size: 13px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;Title&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;XAML Demo&quot;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt; Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;350&quot;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt; Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;525&quot;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Grid&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&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;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Button&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Content&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;Click Me!&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; /&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none; text-indent: 35.4pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Grid&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Window&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Si noti come sia necessario includere i namespaces di XAML.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;La finestra dovrà essere poi inclusa all’interno di un’applicazione:&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Consolas; font-size: x-small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;i&gt;File App.xaml:&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Application&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; x&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;:&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;WpfApplication1.App&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Consolas; font-size: 13px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;StartupUri&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;MainWindow.xaml&quot;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Application.Resources&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Application.Resources&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Application&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Questo semplice esempio ci fa capire come le classi in .NET possano essere mappate in XAML e viceversa. E’ possibile anche usare classi custom all’interno di XAML.&amp;nbsp; Per esempio:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Window&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;x:Class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;WpfApplication1.MainWindow&lt;/span&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;xmlns&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;”&lt;span style=&quot;color: blue;&quot;&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/span&gt;”&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;xmlns:x&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;”&lt;span style=&quot;color: blue;&quot;&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Title&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;”&lt;span style=&quot;color: blue;&quot;&gt;XAML Demo&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt;350&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt;525&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;StackPanel&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Button&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Content&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;”&lt;span style=&quot;color: blue;&quot;&gt;Click Me!&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;ListBox&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;local:Person&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;”&lt;span style=&quot;color: blue;&quot;&gt;Mario&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt;Rossi&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;local:Person&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;”&lt;span style=&quot;color: blue;&quot;&gt;Gino&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt;Bianchi&lt;/span&gt;”&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;ListBox&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Consolas; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Window&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;In questo esempio abbiamo inizializzato una classe &lt;i&gt;Person &lt;/i&gt;definita localmente e che possiede due proprietà “&lt;i&gt;FirstName&lt;/i&gt;” e “&lt;i&gt;LastName&lt;/i&gt;”. Implementando il metodo &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;ToString()&lt;/i&gt; della classe &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;Person&lt;/i&gt; potremo riempire la &lt;i&gt;ListBox &lt;/i&gt;con nomi e cognomi. In poche righe di codice C# la classe &lt;i&gt;Person &lt;/i&gt;è così definita:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Person&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Consolas; font-size: 13px;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; FirstName { &lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; LastName { &lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; ToString()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;.Format(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;{0} {1}&quot;&lt;/span&gt;, FirstName, LastName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Per utilizzare XAML dobbiamo creare un progetto in Visual Studio che utilizzi tale linguaggio (per esempio un&#39;applicazione WPF o Silverlight). Una volta creato un nuovo progetto in Visual Studio, tale IDE ci creerà automaticamente lo scheletro dell&#39;applicazione con i file &lt;i&gt;App.xaml &lt;/i&gt;&amp;nbsp;e &lt;i&gt;MainWindow.xaml &lt;/i&gt;visti in precedenza, nonchè i file C# (.cs) ad essi collegati (code behind). Realizzare una GUI con XAML/WPF in Visual Studio è del tutto simile a crearne una in Windows Forms o ASP.NET, dato che vi è il &quot;solito&quot; sistema &lt;a href=&quot;http://it.wikipedia.org/wiki/WYSIWYG&quot;&gt;WYSIWYG &lt;/a&gt;col drag &amp;amp; drop, affiancato però dal codice XAML.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Si voglia ora per esempio creare un bottone colorato con un certo gradiente: dalla toolbox di VS poniamo un bottone nella &lt;i&gt;MainWindow&lt;/i&gt;, analizzando il codice XAML possiamo accedere alle proprietà del bottone come se fossero elementi del documento (VS ci permette di accedere a tali proprietà anche in una finestra separata):&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Window&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; x&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;:&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;WpfApplication1.MainWindow&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Consolas; font-size: 13px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;Title&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;MainWindow&quot;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt; Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;350&quot;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt; Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;525&quot;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Grid&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Button&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Content&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;Click Me!&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Height&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;23&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Left&quot;&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;Margin&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;129,36,0,0&quot;&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;button1&quot;&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Top&quot;&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;75&quot;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt; Click&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;button1_Click&quot;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&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;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Button.Background&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; StartPoint&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;0.5,0.0&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; EndPoint&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;0.5, 1.0&quot;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;LinearGradientBrush.GradientStops&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&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;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;GradientStopCollection&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&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; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;GradientStop&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Offset&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Color&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;Yellow&quot;/&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&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; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;GradientStop&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Offset&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;0.3&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Color&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;Orange&quot;/&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&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; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;GradientStop&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Offset&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;0.7&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Color&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;Red&quot;/&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&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; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;GradientStop&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Offset&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Color&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;DarkRed&quot;/&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&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;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;GradientStopCollection&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;LinearGradientBrush.GradientStops&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&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;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Button.Background&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Button&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Window&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Si noti come si definiscono le proprietà del bottone dentro dei tag annidati i cui nomi sono quelli definiti all’interno della classe &lt;i&gt;Button&lt;/i&gt;. &amp;nbsp;Il risultato è un bottone del genere: &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-fIHxmT2V0Zo/TWPlvtN3LsI/AAAAAAAAAD8/BaqqAy3450U/s1600/buttonxaml.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-fIHxmT2V0Zo/TWPlvtN3LsI/AAAAAAAAAD8/BaqqAy3450U/s1600/buttonxaml.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Come visto, in XAML gli oggetti possono contenere altri oggetti per cui potremmo pensare di dichiarare allo stesso modo array o collezioni di oggetti:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;x:Array&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Type&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;local:Person&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;local:Person&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Mario&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Rossi&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;local:Person&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Gino&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Bianchi&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: WileyCode-Regular; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;x:Array&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;Definisce un array di oggetti &lt;i&gt;Person &lt;/i&gt;(&lt;i&gt;x:array&lt;/i&gt; è un&#39;estensione di Markup per il supporto alle matrici).&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Supponiamo ora di voler collegare l’evento “click” del bottone a del codice C# che visualizzi un messaggio a video. &amp;nbsp;Cliccando due volte sul bottone dell&#39;anteprima in Visual Studio, verrà&amp;nbsp;creato l&#39;evento&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Consolas; font-size: 13px;&quot;&gt;button1_Click nel&amp;nbsp;&lt;/span&gt;Code Behind associato:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;public&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;MainWindow&lt;/span&gt; : &lt;span style=&quot;color: #2b91af;&quot;&gt;Window&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; MainWindow()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; button1_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;RoutedEventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;MessageBox&lt;/span&gt;.Show(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Click!&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;In questo semplice esempio abbiamo visto un modo per utilizzare XAML. In realtà XAML ha diversi “dialetti”: WPF XAML (XAML per WPF), XPS XAML (XAML per descrivere documenti elettronici), Silverlight XAML (subset di XAML per Silverlight), WF XAML (XAML per &lt;i&gt;Windows Workflow Foundation&lt;/i&gt;). &amp;nbsp;XAML ha dei meccanismi quali:&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;- Markup Extensions&lt;/b&gt;: estensioni utilizzate per settare dinamicamente i valori delle proprietà degli oggetti grafici in funzione di altri oggetti esistenti. &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;&lt;/div&gt;Vediamo &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;un esempi&lt;/span&gt;o con una &lt;i&gt;StaticResourceExtension&lt;/i&gt;:&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Window&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; x&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;:&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Class&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;WpfApplication1.MainWindow&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;xmlns&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;xmlns&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;:&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;x&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Title&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;XAML Demo&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Height&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;350&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Width&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;525&quot;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;StackPanel&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;StackPanel.Resources&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&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;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;SolidColorBrush&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;x&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;TextBackBrush&quot;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;Color&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;LightBlue&quot;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;StackPanel.Resources&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;TextBlock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Background&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;=&quot;{&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;StaticResource&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; TextBackBrush&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;}&quot;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Hello!&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;TextBlock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Window&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-size: 9.5pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Questo codice disegnerà la scritta&lt;i&gt; &quot;Hello!&quot;&lt;/i&gt; su uno sfondo azzurro chiaro: per cambiare il colore dello sfondo basterà modificare la proprietà &lt;i&gt;Color &lt;/i&gt;di &lt;i&gt;SolidColorBrush. &lt;/i&gt;Ci sono altri modi per creare delle &lt;i&gt;MarkupExtension&lt;/i&gt;, ma tralascerò per ora questo argomento.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-size: 9.5pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;- Attached Properties&lt;/b&gt;: sono delle proprietà che si possono applicare a più controlli differenti, ma la cui definizione è data a livello di classe. Inoltre permettono di creare proprietà “virtuali” che di fatto estendono quelle già presenti in una certa classe. La sintassi da usare è&amp;nbsp;&lt;i&gt;&lt;span class=&quot;parameter&quot;&gt;AttachedPropertyProvider&lt;/span&gt;.&lt;span class=&quot;parameter&quot;&gt;PropertyName.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;Per esempio:&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;DockPanel&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;CheckBox&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;DockPanel.Dock&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;Top&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Hello&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;CheckBox&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;DockPanel&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;/ul&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;DockPanel.Dock &lt;/i&gt;è una proprietà valida per tutti gli oggetti &lt;i&gt;DockPanel&lt;/i&gt;. Si noti come il concetto è simile alle proprietà statiche delle classi: in C# questo può essere descritto per&lt;/span&gt; esempio con:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2b91af; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #2b91af; font-family: Consolas; font-size: 9.5pt;&quot;&gt;DockPanel&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.SetDock(myCheckBox, &lt;span style=&quot;color: #2b91af;&quot;&gt;Dock&lt;/span&gt;.Top);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l1 level1 lfo2; text-autospace: none; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
Qui si possono trovare alcune utili risorse che parlano di XAML:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms752059.aspx&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;XAML Overview&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.wpftutorial.net/XAML.html&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;WPF Tutorial&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-gb/library/ms747254.aspx&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Markup Extensions and XAML&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 16px;&quot;&gt;&lt;a href=&quot;http://blogs.msdn.com/b/wpfsdk/archive/2007/03/22/blogpost-text-creatingasimplecustommarkupextension.aspx&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Creating a Simple MarkupExtension&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms749011.aspx&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 16px;&quot;&gt;&lt;/span&gt;Attached Properties Overview&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/7480734398447851926/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/interfacce-grafiche-in-net-con-il.html#comment-form' title='3 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/7480734398447851926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/7480734398447851926'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/interfacce-grafiche-in-net-con-il.html' title='Interfacce grafiche in .NET con il linguaggio XAML'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-OC-5WDwI9EE/TWTl6NZ6CaI/AAAAAAAAAEE/-stCkA4d9cI/s72-c/Xaml.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-5203913768110934892</id><published>2011-02-18T23:46:00.000+01:00</published><updated>2011-03-02T13:11:13.014+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="Flash"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaFX"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenLaszlo"/><category scheme="http://www.blogger.com/atom/ns#" term="RIA"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><title type='text'>Sviluppare RIA con Flash, Silverlight o Java: tecnologie a confronto</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-RLOOY_QHvfw/TWN-pYHHrII/AAAAAAAAAD4/NMYsN4DBodQ/s1600/ria.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;217&quot; src=&quot;http://1.bp.blogspot.com/-RLOOY_QHvfw/TWN-pYHHrII/AAAAAAAAAD4/NMYsN4DBodQ/s320/ria.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Mi sono domandato quale fosse la tecnologia migliore da adottare attualmente per realizzare una piccola presentazione grafica su un sito.&lt;br /&gt;
Quando navighiamo in internet ormai ci troviamo di fronte a delle vere e proprie applicazioni interattive graficamente accativanti: sono le cosiddette &lt;i&gt;Rich Internet Applications&lt;/i&gt; (RIA).&lt;br /&gt;
Ho fatto delle ricerche in internet e mi si sono presentate cinque opzioni accettabili:&lt;br /&gt;
&lt;blockquote class=&quot;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Adobe Flash&lt;/b&gt;: è la tecnologia che c&#39;è da più tempo per fare applicazioni grafiche leggere di proprietà di Adobe-Macromedia. Fondamentalmente i sorgenti si basano su un linguaggio di script detto &lt;i&gt;ActionScript. &lt;/i&gt;Gli ambienti di sviluppo più usati sono&lt;i&gt; Adobe Flash Builder&lt;/i&gt; (versione trial gratuita oppure la &quot;&lt;i&gt;Premium&lt;/i&gt;&quot; a pagamento), &lt;i&gt;Adobe Air&lt;/i&gt; o &lt;i&gt;Flash Develop &lt;/i&gt;(open source, gratuito).&amp;nbsp;Richiede l&#39;installazione di un plugin sul browser dell&#39;utente finale.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Microsoft Silverlight: &lt;/b&gt;tecnologia Microsoft secondo cui un plugin può essere sviluppato mediante linguaggi&amp;nbsp;XAML (&lt;i&gt;eXtensible Application Markup Language)&lt;/i&gt; e&lt;i&gt; &lt;/i&gt;C#: si integra perfettamente all&#39;interno del .NET Framework e Visual Studio, essendo XAML il linguaggio usato per decrivere le interfacce grafiche in WPF (&lt;i&gt;Windows Presentation Foundation&lt;/i&gt;). Richiede l&#39;installazione di un plugin sul browser dell&#39;utente finale.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;JavaFX:&lt;/b&gt;&amp;nbsp;famiglia di software applicativi, basati sulla Piattaforma Java,&amp;nbsp;creato da Sun Microsystems e divenuto un prodotto Oracle. Lo sviluppo delle applicazioni si basa su un linguaggio che ha alcuni scostamenti da Java detto &quot;&lt;i&gt;JavaFX script&lt;/i&gt;&quot;, ma pienamente supportato dalla Sun. L&#39;ambiente di sviluppo rimane quello classico di Java: Eclipse o NetBeans. L&#39;applicazione si integra al browser come fosse un&#39;applet, per cui sul client vi deve essere una JRE installata.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Javascript:&amp;nbsp;&lt;/b&gt;si raggiungono risultati ammirevoli per mezzo di tecnologie AJAX e librerie quali &lt;i&gt;JQuery, Prototype, Ext JS&lt;/i&gt; ecc. L&#39;ambiente di sviluppo è quello classico di Java (p.es. NetBeans/Eclipse) anche se il debugging è più laborioso. Il vantaggio consiste nel non dover scaricare alcun plugin o ambiente sul client, ma basta attivare Javascript. Uno svantaggio di questo approccio è che il risultato finale non è indipendente dal browser sul quale girerà la presentazione, ma bisognerà tener conto della piattaforma client.&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;b&gt;OpenLaszlo:&lt;/b&gt;&amp;nbsp;è una piattaforma&amp;nbsp;open source&amp;nbsp;per lo sviluppo di applicazioni web,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; line-height: 19px;&quot;&gt;è basato sui linguaggi Java/&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial;&quot;&gt;LZX&lt;/span&gt;&amp;nbsp;e su un&amp;nbsp;&lt;i&gt;OpenLaszlo Server&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;In pratica l&#39;applicazione web viene rilasciata come una normale servlet che gira sull&#39;OpenLaszlo Server.Il risultato è un DHTML oppure un normale file Flash SWF. Questa tecnologia, dal punto di vista di un browser, in realtà non presenta niente di nuovo rispetto alle altre tecnologie esistenti, mi pare più che altro un modo alternativo per creare file &lt;i&gt;Flash&lt;/i&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;Ci sono anche altre tecnologie adottabili, ma queste esulano dagli scopi di creare una semplice presentazione di immagini che sia leggera, economica di risorse e semplice da realizzare (vedi p.es. la piattaforma open source Flex o Java Swing).&lt;br /&gt;
Dopo una breve indagine, ho decretato che le opzioni sono abbastanza equivalenti per ciò che riguarda il risultato finale (l&#39;aspetto grafico). Ho trovato interessanti siti in cui le tecnologie vengono messe a confronto (per esempio &lt;a href=&quot;http://www.shinedraw.com/flash-vs-silverlight-gallery/&quot;&gt;questo&lt;/a&gt;&amp;nbsp;confronta &lt;i&gt;Flash &lt;/i&gt;con &lt;i&gt;Silverlight&lt;/i&gt;, mentre &lt;a href=&quot;http://bubblemark.com/&quot;&gt;questo&lt;/a&gt; esegue un benchmark tra le diverse tecnologie&lt;i&gt;)&lt;/i&gt;. Quest&#39;altro &lt;a href=&quot;http://www.indeed.com/jobtrends?q=javafx%2C+%22silverlight%22%2C+%22adobe+flash%22&amp;amp;l=&quot;&gt;link&lt;/a&gt; evidenzia la richiesta del mercato delle tre tecnologie &lt;i&gt;Flash&lt;/i&gt;, &lt;i&gt;Silverlight &lt;/i&gt;e &lt;i&gt;JavaFX&lt;/i&gt;. Un punto a favore di Flash lo si ha andando a guardare quale sia la penetrazione attuale nei browser tra &lt;i&gt;Flash&lt;/i&gt;, &lt;i&gt;Silverlight &lt;/i&gt;e &lt;i&gt;Java&lt;/i&gt;.&amp;nbsp;Due interessanti siti sono &lt;a href=&quot;http://riastats.com/&quot;&gt;RIAStats&lt;/a&gt;&amp;nbsp;e &lt;a href=&quot;http://www.statowl.com/custom_ria_market_penetration.php&quot;&gt;StatOwl&lt;/a&gt;.&amp;nbsp;Nonostante &lt;i&gt;Silverlight &lt;/i&gt;stia aumentando la sua popolarità e area di mercato, la sua penetrazione si aggira intorno al 61.11%, ancora Flash risulta il plugin più installato (96.12%), mentre Java rimane costante (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;78.54%&lt;/span&gt;).&lt;br /&gt;
Credo che ad oggi la scelta di Adobe Flash, a meno di altri fattori, sia ancora quella più azzeccata.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/5203913768110934892/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/sviluppare-ria-con-flash-silverlight-o.html#comment-form' title='1 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/5203913768110934892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/5203913768110934892'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/sviluppare-ria-con-flash-silverlight-o.html' title='Sviluppare RIA con Flash, Silverlight o Java: tecnologie a confronto'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-RLOOY_QHvfw/TWN-pYHHrII/AAAAAAAAAD4/NMYsN4DBodQ/s72-c/ria.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-2091487714606201086</id><published>2011-02-14T23:45:00.000+01:00</published><updated>2011-03-02T13:10:57.434+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EAI"/><category scheme="http://www.blogger.com/atom/ns#" term="Integrazione"/><category scheme="http://www.blogger.com/atom/ns#" term="Message Broker"/><category scheme="http://www.blogger.com/atom/ns#" term="SOA"/><category scheme="http://www.blogger.com/atom/ns#" term="WfMS"/><category scheme="http://www.blogger.com/atom/ns#" term="Workflow"/><title type='text'>Un&#39;introduzione alle EAI (Enterprise Application Integration)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-gYWtarn4EQg/TVqvG4GOcFI/AAAAAAAAACU/SUBFO5JclDY/s1600/EAI.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;192&quot; src=&quot;http://2.bp.blogspot.com/-gYWtarn4EQg/TVqvG4GOcFI/AAAAAAAAACU/SUBFO5JclDY/s200/EAI.gif&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Sempre più si sente parlare in ambito IT di integrazione di sistemi  informativi: si pensi per esempio a diversi sistemi che devono  scambiarsi informazioni tra loro, ma spesso sono  completamente eterogenei per tecnologie, funzionalità, ambienti in cui  vivono. Lo scenario è quello in cui diverse applicazioni (con scopi, tempistiche e tecnologie eterogenee), sviluppate magari in .NET piuttosto che in Java o C/C++, devono interagire tra loro su macchine differenti (p.es. 32/64 bit) e su SO differenti. &lt;br /&gt;
Per ovviare a tali problematiche si ricorre spesso a piattaforme standard di integrazione dette appunto EAI.&lt;br /&gt;
Diamo una definizione formale:&lt;br /&gt;
&lt;br /&gt;
Fonte Wikipedia: &lt;br /&gt;
&quot;&lt;b&gt;Enterprise Application Integration (EAI)&lt;/b&gt; (&lt;i&gt;integrazione d&#39;applicazioni di impresa&lt;/i&gt;) si riferisce al processo d&#39;integrazione tra diversi tipi di sistemi informatici attraverso l&#39;utilizzo di software e soluzioni architetturali&quot;.&lt;br /&gt;
&lt;br /&gt;
L&#39;integrazione può essere &lt;i&gt;semplice &lt;/i&gt;(trasferimento di dati tra due applicazioni, diverso posizionamento &quot;fisico&quot; dei sistemi), o &lt;i&gt;complessa &lt;/i&gt;(esigenze di riservatezza nel trasferimento dei dati, garanzia di consegna, sicurezza ecc.). Le piattaforme EAI si occupano di risolvere l&#39;integrazione semplice (solitamente è un integrazione interna all&#39;azienda).&lt;br /&gt;
L&#39;esigenza di avere piattaforme EAI è nata proprio dalla complessità di far interagire tra loro sistemi eterogenei: inizialmente l&#39;interazione avveniva con soluzioni punto-punto, ossia i sistemi dialogavano tra loro a due a due con soluzioni più o meno customizzate. Tutto ciò introduceva&amp;nbsp; un grosso problema architetturale detto &quot;degli spaghetti&quot;, ossia una proliferazione di collegamenti diretti tra i sistemi e la perdita di controllo del trasferimento dell&#39;informazione. Una prima risposta a tale &quot;caos&quot; si è avuta introducendo un primo livello di astrazione (&lt;i&gt;Connectors e Data Transport&lt;/i&gt;) dello strato &quot;fisico&quot; di trasporto: avere un layer di comunicazione uguale per tutti per mezzo di costrutti informatici detti &lt;i&gt;connectors &lt;/i&gt;e &lt;i&gt;adapters&lt;/i&gt;. Tali costrutti vengono realizzati mediante framework che implementano i vari connettori alle applicazioni oppure, se l&#39;integrazione avviene tra due prodotti, mediante adattatori ad hoc. La distinzione tra &lt;i&gt;connector &lt;/i&gt;e &lt;i&gt;adapter &lt;/i&gt;veniva fatta in base al loro impiego per interfacciare tra loro tecnologie diverse, diversi prodotti o diversi database. Questo livello di astrazione introdotto è in pratica uno strato che si occupa di interfacciare tra loro diverse tecnologie e diverse infrastrutture al livello più basso. Un secondo livello di astrazione deve essere introdotto per ovviare al problema dei &quot;dialetti&quot;: si pensi ad esempio a due database che girano su DBMS diversi che devono dialogare tra loro, ciascuno col proprio &quot;dialetto&quot; &lt;i&gt;SQL&lt;/i&gt;. Lo strato delle &quot;&lt;i&gt;Trasformazioni&lt;/i&gt;&quot; serve proprio per cercare di astrarre le comunicazioni tra sistemi che hanno linguaggi o parti del linguaggio differenti.&lt;br /&gt;
Le piattaforme EAI di prima generazione solitamente implementano questi due livelli di astrazione.&lt;br /&gt;
Le piattaforme di seconda generazione implementano un ulteriore livello di astrazione detto del &quot;&lt;i&gt;flusso dei processi&lt;/i&gt;&quot;: si può avere non solo un&#39;astrazione del trasferimento di informazioni tra le applicazioni, ma anche delle loro funzionalità e quindi della logica su come vengono integrate.&lt;br /&gt;
&lt;br /&gt;
Livelli di astrazione:&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Connectors &amp;amp; Data Transport (&lt;i&gt;connectors&lt;/i&gt; e&lt;i&gt; adapters&lt;/i&gt;)&lt;/li&gt;
&lt;li&gt;Transformations (conversioni tra dialetti)&lt;/li&gt;
&lt;li&gt;Process Flows (logica di integrazione)&lt;/li&gt;
&lt;/ul&gt;Ci sono principalmente due tipi di piattaforma EAI:&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Broker Engine&lt;/b&gt;: questo tipo di piattaforme si concentra sul far comunicare applicazioni eterogenee. Esse consistono in un componente detto &quot;&lt;i&gt;broker engine&lt;/i&gt;&quot; che si occupa di trasferire i dati da un&#39;applicazione all&#39;altra, ma senza entrare nei dettagli della connettività. In pratica un &lt;i&gt;broker engine&lt;/i&gt; utilizza diversi &quot;&lt;i&gt;connector&lt;/i&gt;&quot; e &quot;&lt;i&gt;adapter&lt;/i&gt;&quot; che si occupano della comunicazione tra il&lt;i&gt; broker &lt;/i&gt;e l&#39;applicazione ad un livello di astrazione più basso. In pratica il livello di astrazione (&lt;i&gt;Connectors e Data Transport) &lt;/i&gt;introdotto dai &lt;i&gt;connector &lt;/i&gt;e dagli &lt;i&gt;adapter&lt;/i&gt; permette al &lt;i&gt;broker engine &lt;/i&gt;di dedicarsi all&#39;esclusivo instradamento dei flussi di dati. &lt;/li&gt;
&lt;/ul&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Process Mapper Engine&lt;/b&gt;: sono le piattaforme EAI di ultima generazione. Tali EAI si occupano della gestione dei processi. Oltre al livello di astrazione dei &lt;i&gt;connectors &lt;/i&gt;e degli &lt;i&gt;adapters &lt;/i&gt;viene introdotto un ulteriore livello di astrazione detto &lt;i&gt;Process Flow&lt;/i&gt;: in pratica viene astratta la logica di integrazione (&lt;i&gt;composition logic&lt;/i&gt;). In tale scenario si può scegliere come integrare i diversi sistemi secondo una logica dei servizi da essi offerti. Da qui alle architetture &lt;i&gt;SOA (Service Oriented Architecture) &lt;/i&gt;il passo è breve.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Un esempio di &lt;i&gt;Broker Engine&lt;/i&gt; è il &lt;i&gt;Message Broker&lt;/i&gt; che si occupa di smistare messaggi tra diverse applicazioni: un &lt;i&gt;Message Broker&lt;/i&gt; è in grado di fornire a ciascuna applicazione un &lt;i&gt;adapter &lt;/i&gt;ad hoc, inoltre la logica di instradamento dei messaggi può essere comandata tramite una logica programmabile (&lt;i&gt;composition logic&lt;/i&gt;). Tale logica può essere implementata tramite un &lt;a href=&quot;http://it.wikipedia.org/wiki/Workflow_management&quot;&gt;&lt;i&gt;WfMS&lt;/i&gt;&lt;/a&gt; (&lt;i&gt;Workflow Management System&lt;/i&gt;).&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-Qc9YNccyf3M/TVqxV_g5IcI/AAAAAAAAACY/YtO2ymOYAbc/s1600/EAIarch.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;http://3.bp.blogspot.com/-Qc9YNccyf3M/TVqxV_g5IcI/AAAAAAAAACY/YtO2ymOYAbc/s320/EAIarch.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Il &lt;i&gt;Message Broker&lt;/i&gt; come &lt;i&gt;Broker Engine&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/2091487714606201086/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/unintroduzione-alle-eai-enterprise.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/2091487714606201086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/2091487714606201086'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/unintroduzione-alle-eai-enterprise.html' title='Un&#39;introduzione alle EAI (Enterprise Application Integration)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-gYWtarn4EQg/TVqvG4GOcFI/AAAAAAAAACU/SUBFO5JclDY/s72-c/EAI.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-5841388750281130538</id><published>2011-02-12T23:44:00.000+01:00</published><updated>2011-03-02T13:10:41.130+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="LDAP"/><category scheme="http://www.blogger.com/atom/ns#" term="Liferay"/><category scheme="http://www.blogger.com/atom/ns#" term="portlet"/><title type='text'>Interfacciare Liferay con LDAP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-yh1noCGRXns/TVzm1VmjwSI/AAAAAAAAACc/nwofOfn-kV4/s1600/liferay.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-yh1noCGRXns/TVzm1VmjwSI/AAAAAAAAACc/nwofOfn-kV4/s1600/liferay.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-4-d7zjHF0WA/TVj_uh_4P0I/AAAAAAAAAB8/IFESfccfVzs/s1600/liferay%25252520bianco.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;a href=&quot;http://www.liferay.com/&quot;&gt;&lt;span class=&quot;highlightedSearchTerm&quot;&gt;Liferay&lt;/span&gt; &lt;/a&gt;è una applicazione web open source&amp;nbsp;basata sul linguaggio Java per la gestione e la customizzazione di portali.&lt;br /&gt;
&lt;p$1&gt;&lt;span class=&quot;highlightedSearchTerm&quot;&gt;Liferay&lt;/span&gt; sfrutta la gestione delle &lt;b&gt;portlet &lt;/b&gt;(supporta lo standard portlet API JSR-168). Esso permette di creare facilmente da un normale sito web a un complesso portale di servizi. Una caratteristica interessante di Liferay è che esso può essere interfacciato con un preesistente sistema di autenticazione quale &lt;a href=&quot;http://it.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol&quot;&gt;LDAP&lt;/a&gt;, NTLM ecc.&lt;br /&gt;
&lt;p$1&gt;Liferay può essere personalizzato per ciascun utente che si logga al portale con una granularità molto fine: per esempio posso decidere per ciascun utente o gruppi di utenti quali portlet, documenti, contenuti ecc. può vedere o con quali può interagire. &lt;br /&gt;
&lt;p$1&gt;Tutti gli accessi al portale (profilazione utente con i suoi privilegi) saranno pilotati dal nostro sistema di autenticazione centralizzato.&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-uWye7DMW40I/TVkooPeSOGI/AAAAAAAAACQ/mWVMJ90HvXc/s1600/intro_dctree.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://3.bp.blogspot.com/-uWye7DMW40I/TVkooPeSOGI/AAAAAAAAACQ/mWVMJ90HvXc/s320/intro_dctree.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;Vediamo un esempio di integrazione con &lt;a href=&quot;http://it.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol&quot;&gt;LDAP&lt;/a&gt;: una volta loggati come utente administrator di Liferay (utente Administrator locale), andare nel Pannello di Controllo di Liferay nella sezione Portale -&amp;gt; Configurazione -&amp;gt; Autenticazione -&amp;gt; LDAP. Chekkare il flag &quot;Abilitato&quot;, mentre quello &quot;Richiesto&quot; abilitarlo solo nel caso che tutti gli utenti che si dovranno loggare a Liferay siano solo di LDAP. Premere il bottone &quot;Aggiungi&quot; Server LDAP. A questo punto dobbiamo configurare l&#39;autenticazione:&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;Configurazione&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;display: none; font-family: Arial, sans-serif; font-size: 12pt;&quot;&gt;Top o&lt;/span&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;span style=&quot;display: none;&quot;&gt;&lt;input name=&quot;_130_cmd&quot; type=&quot;hidden&quot; /&gt;&lt;/span&gt;Nome del server (immettere&amp;nbsp;un nome simbolico del server)&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;Valori Predefiniti &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;(selezionare il tipo server LDAP)&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;Scegliere il tipo di server tra quelli a disposizione, per esempio se  abbiamo in azienda un Active Directory con LDAP selezionare &quot;&lt;span class=&quot;aui-field aui-field-choice&quot; id=&quot;aui-3-2-0PR1-1576&quot;&gt;&lt;span class=&quot;aui-field-content&quot; id=&quot;aui-3-2-0PR1-1573&quot;&gt;&lt;i&gt;Microsoft Active Directory Server&lt;/i&gt;&quot;, introdurre l&#39;IP e la porta del servizio LDAP (ricavabile dal server), di default vale&lt;i&gt; &quot;ldap://localhost:10389&lt;b&gt;&quot;.&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span class=&quot;aui-field aui-field-choice&quot; id=&quot;aui-3-2-0PR1-1576&quot;&gt;&lt;span class=&quot;aui-field-content&quot; id=&quot;aui-3-2-0PR1-1573&quot;&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt; &lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;input name=&quot;_130_defaultLdap&quot; type=&quot;radio&quot; value=&quot;apache&quot; /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Apache Directory Server &lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;input name=&quot;_130_defaultLdap&quot; type=&quot;radio&quot; value=&quot;fedora&quot; /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Fedora Directory Server &lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;input name=&quot;_130_defaultLdap&quot; type=&quot;radio&quot; value=&quot;microsoft&quot; /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Microsoft Active Directory Server&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;… ecc.&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;Connessione&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;- Base Provider URL, Il formato dell&#39;URL del LDAP Base Provider è &lt;i&gt;ldap://host:port&lt;/i&gt;.&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;- Base DN specifica il contesto di ricerca iniziale per gli utenti ed è opzionale. Ad esempio, usare &lt;i&gt;ldap://localhost:389&lt;/i&gt; e &lt;i&gt;ou=Users,o=Example&lt;/i&gt; come valori&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Il formato dell&#39;URL del LDAP Base Provider è &lt;i&gt;ldap://host:port&lt;/i&gt;. Il Base DN specifica il contesto di ricerca iniziale per gli utenti ed è opzionale. Ad esempio, usare &lt;i&gt;ldap://localhost:389&lt;/i&gt; e &lt;i&gt;ou=Users,o=Example&lt;/i&gt; come valori.&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Immetere le credenziali di un amministratore (ad esempio admin,dc=local) &lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;Utenti&lt;/span&gt;&lt;/b&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;br /&gt;
&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;- Filtro di Ricerca Autenticazione. Inserisci il filtro di ricerca che sarà utilizzato per verificare la validità di un utente. I campi @company_id@, @email_address@ e @user_id@ sono sostituiti a runtime con i valori corretti. Ad esempio (&lt;i&gt;mail=@email_address@&lt;/i&gt;)&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;- &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Importa Filtri di Ricerca: ad esempio (&lt;i&gt;objectClass=person&lt;/i&gt;), filtro di ricerca per utente&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Mappatura dell&#39;Utente&lt;/span&gt;&lt;/b&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Immetere i valori dei campi che a runtime verranno sostituiti con quelli trovati sul server:&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Nome Utente:&amp;nbsp; &lt;i&gt;cn&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Password: &lt;i&gt;userPassword&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Indirizzo Email: &lt;i&gt;userPrincipalName&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Nome Completo:&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Nome: &lt;i&gt;givenName&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Secondo Nome: &lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Cognome: &lt;i&gt;sn&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Job Title: &lt;i&gt;title&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Gruppo:&lt;i&gt; memberOf&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;Gruppi&lt;/span&gt;&lt;/b&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Filtro per importare i gruppi:&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Importa Filtri di Ricerca: &lt;i&gt;(objectClass=groupOfUniqueNames)&lt;/i&gt; &lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Tracciato del Gruppo&lt;/span&gt;&lt;/b&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Nome del Gruppo: &lt;i&gt;cn&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Descrizione: &lt;i&gt;description&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Utente: &lt;i&gt;uniqueMember&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;Esporta&lt;/span&gt;&lt;/b&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Esporta i dati su Liferay&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;DN Utenti: &lt;i&gt;ou=users,dc= company_domain,dc=local&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Classi Oggetto Predefinite per l&#39;Utente: &lt;i&gt;top,person,organizationalPerson,inetOrgPerson&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Gruppi DN: ou=groups,dc= &lt;i&gt;company_domain,dc=local&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Codici categoria di oggetto di difetto del gruppo: &lt;i&gt;top,groupOfUniqueNames&lt;/i&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;div style=&quot;border-style: solid none none; border-width: 1pt medium medium; padding: 1pt 0cm 0cm;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt; padding: 0cm; text-align: center;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;display: none; font-family: Arial, sans-serif; font-size: 8pt;&quot;&gt;Bottom of Form&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;Questo potrebbe essere un esempio di configurazione di Liferay. In pratica Liferay si connetterà al nostro server LDAP e importerà gli utenti e i gruppi&amp;nbsp;che soddisfano i criteri di ricerca indicati nei filtri. Alla fine della procedura tali utenti compariranno come utenti di Liferay veri e propri.&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;Dopo aver testato la connessione al server LDAP e testato i vari filtri su gruppi e utenti tramite i relativi bottoni, salviamo la configurazione del server e torniamo alla schermata di LDAP.&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div&gt;&lt;p$1&gt;&lt;p$1&gt;A questo punto possiamo settare le rimanenti opzioni:&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;h3&gt;Importa / Esporta &lt;/h3&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;fieldset class=&quot;aui-fieldset  &quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;aui-fieldset-content &quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span class=&quot;aui-field aui-field-choice&quot;&gt; &lt;span class=&quot;aui-field-content&quot;&gt; &lt;span class=&quot;aui-field-element aui-field-label-right&quot;&gt; &lt;input id=&quot;_130_ldapImportEnabled&quot; name=&quot;_130_settings--ldap.import.enabled--&quot; type=&quot;hidden&quot; value=&quot;true&quot; /&gt; &lt;input checked=&quot;checked&quot; class=&quot;aui-field-input aui-field-input-choice&quot; id=&quot;_130_ldapImportEnabledCheckbox&quot; name=&quot;_130_settings--ldap.import.enabled--Checkbox&quot; type=&quot;checkbox&quot; /&gt; &lt;/span&gt; &lt;label class=&quot;aui-field-label&quot; for=&quot;_130_ldapImportEnabledCheckbox&quot;&gt; Importazione Abilitata&amp;nbsp;                   &lt;/label&gt;(importa gli utenti LDAP al primo login) &lt;/span&gt; &lt;/span&gt; &lt;br /&gt;
&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div id=&quot;_130_importEnabledSettings&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span class=&quot;aui-field aui-field-choice&quot;&gt; &lt;span class=&quot;aui-field-content&quot;&gt; &lt;span class=&quot;aui-field-element aui-field-label-right&quot;&gt; &lt;input id=&quot;_130_settings--ldap.import.on.startup--&quot; name=&quot;_130_settings--ldap.import.on.startup--&quot; type=&quot;hidden&quot; value=&quot;true&quot; /&gt; &lt;input checked=&quot;checked&quot; class=&quot;aui-field-input aui-field-input-choice&quot; id=&quot;_130_settings--ldap.import.on.startup--Checkbox&quot; name=&quot;_130_settings--ldap.import.on.startup--Checkbox&quot; type=&quot;checkbox&quot; /&gt; &lt;/span&gt; &lt;label class=&quot;aui-field-label&quot; for=&quot;_130_settings--ldap.import.on.startup--Checkbox&quot;&gt; Importazione all&#39;Avvio Abilitata&amp;nbsp;                   &lt;/label&gt;(importa tutti gli utenti LDAP all&#39;avvio) &lt;/span&gt; &lt;/span&gt; &lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;span class=&quot;aui-field aui-field-choice&quot;&gt; &lt;span class=&quot;aui-field-content&quot;&gt; &lt;span class=&quot;aui-field-element aui-field-label-right&quot;&gt; &lt;input id=&quot;_130_ldapExportEnabled&quot; name=&quot;_130_settings--ldap.export.enabled--&quot; type=&quot;hidden&quot; value=&quot;true&quot; /&gt; &lt;input checked=&quot;checked&quot; class=&quot;aui-field-input aui-field-input-choice&quot; id=&quot;_130_ldapExportEnabledCheckbox&quot; name=&quot;_130_settings--ldap.export.enabled--Checkbox&quot; type=&quot;checkbox&quot; /&gt; &lt;/span&gt; &lt;label class=&quot;aui-field-label&quot; for=&quot;_130_ldapExportEnabledCheckbox&quot;&gt; Esportazione Abilitata&amp;nbsp;                   &lt;/label&gt;(esporta gli utenti LDAP) &lt;/span&gt; &lt;/span&gt; &lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/fieldset&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;h3&gt;Politica per le Password&lt;/h3&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;fieldset class=&quot;aui-fieldset  &quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;aui-fieldset-content &quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span class=&quot;aui-field aui-field-choice&quot;&gt; &lt;span class=&quot;aui-field-content&quot;&gt; &lt;span class=&quot;aui-field-element aui-field-label-right&quot;&gt; &lt;input id=&quot;_130_settings--ldap.password.policy.enabled--&quot; name=&quot;_130_settings--ldap.password.policy.enabled--&quot; type=&quot;hidden&quot; value=&quot;true&quot; /&gt; &lt;input checked=&quot;checked&quot; class=&quot;aui-field-input aui-field-input-choice&quot; id=&quot;_130_settings--ldap.password.policy.enabled--Checkbox&quot; name=&quot;_130_settings--ldap.password.policy.enabled--Checkbox&quot; type=&quot;checkbox&quot; /&gt; &lt;/span&gt; &lt;label class=&quot;aui-field-label&quot; for=&quot;_130_settings--ldap.password.policy.enabled--Checkbox&quot;&gt; Usa la Politica per le Password di LDAP&amp;nbsp;                   &lt;/label&gt;(abilita la politica LDAP delle password come per esempio la scadenza ecc.) &lt;/span&gt; &lt;/span&gt; &lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/fieldset&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div&gt;&lt;p$1&gt;&lt;p$1&gt;Salviamo le modifiche effettuate, delogghiamo l&#39;utente corrente di Liferay e proviamo ad effettuare un login con utente LDAP: se tutto andrà bene ci verrà chiesta per questo utente la domanda segreta per il ripristino della password. L&#39;utente avrà i permessi indicati per il gruppo LDAP, se si vogliono dare permessi diversi andare in Pannello di Controllo-&amp;gt;Portale-&amp;gt;Ruoli e dopo aver selezionato un ruolo in Azioni cliccare su Assegna membri -&amp;gt; disponibili. Naturalmente nella sezione Utenti di Liferay (Pannello di Controllo -&amp;gt;Portale -&amp;gt;Utenti), dopo il login dovranno comparire tutti gli utenti LDAP importati e che soddisfano i criteri dei filtri che abbiamo immesso. A questo punto Liferay è stato interfacciato con LDAP ed è pronto all&#39;uso con un sistema di autenticazione centralizzato.&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/5841388750281130538/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/liferay-e-una-applicazione-web-open.html#comment-form' title='4 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/5841388750281130538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/5841388750281130538'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/liferay-e-una-applicazione-web-open.html' title='Interfacciare Liferay con LDAP'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-yh1noCGRXns/TVzm1VmjwSI/AAAAAAAAACc/nwofOfn-kV4/s72-c/liferay.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-5463817133065089540</id><published>2011-02-08T13:33:00.010+01:00</published><updated>2011-02-16T13:43:28.606+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Dictionary"/><category scheme="http://www.blogger.com/atom/ns#" term="Lookup"/><category scheme="http://www.blogger.com/atom/ns#" term="SortedDictionary"/><category scheme="http://www.blogger.com/atom/ns#" term="ToLookup"/><title type='text'>Dizionari, Lookup e Dizionari Ordinati di oggetti in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/_s-bbD_OuvNg/TVFD-vj7Y-I/AAAAAAAAABU/Ps0mGNRZdsc/s1600/dizionario-online.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;169&quot; src=&quot;http://1.bp.blogspot.com/_s-bbD_OuvNg/TVFD-vj7Y-I/AAAAAAAAABU/Ps0mGNRZdsc/s200/dizionario-online.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;Il linguaggio &lt;b&gt;C#&lt;/b&gt; supporta una vasta gamma di collezioni di oggetti. Alcune di queste strutture dati sono funzionano come delle mappe hash con chiave valore, ad accesso rapido:&lt;br /&gt;
&lt;br /&gt;
- &lt;b&gt;Dictionary&lt;/b&gt;: struttura del tipo&amp;lt;chiave, valore&amp;gt;, a ciascuna chiave corrisponde un singolo valore&lt;br /&gt;
- &lt;b&gt;Dictionary Lookup&lt;/b&gt;: come il Dictionary, ma a ciascuna chiave possono corrispondere più valori&lt;br /&gt;
- &lt;b&gt;Sorted Dictionary&lt;/b&gt;: come il Dictionary, ma è ordinato.&lt;br /&gt;
&lt;br /&gt;
Quando usare un Dictionary? In pratica è conveniente usarlo in tutti in quei casi che si hanno dati nella forma chiave - valore e si vuole un accesso veloce. In pratica a ciascuna chiave viene fatto corrispondere un valore&lt;br /&gt;
univoco (hash), a valori simili corrispondono valori hash molto diversi e la distribuzione dei valori hash deve essere uniforme.&lt;br /&gt;
&lt;br /&gt;
Non abbiamo particolari restrizioni sugli oggetti usabili come valori di un Dictionary, ma le si hanno invece per gli oggetti che dobbiamo usare come chiavi. Una chiave di un Dictionary deve essere comparabile, o meglio deve derivare dalla interfaccia &lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;IEquatable&lt;/span&gt; &lt;/span&gt;e implementare il metodo &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;Equals&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;.&lt;br /&gt;
&lt;br /&gt;
Questo perchè altrimenti verrebbe usato il metodo &lt;span style=&quot;color: #3d85c6;&quot;&gt;Equals &lt;/span&gt;della classe &lt;span style=&quot;background-color: white; color: #3d85c6;&quot;&gt;Object &lt;/span&gt;che restituisce true solo se l&#39;oggetto da comparare è l&#39;oggetto stesso. Un altro metodo fondamentale che si deve implementare per l&#39;oggetto da usare per la chiave è &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;GetHashCode()&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; che restituisce il codice hash che come detto deve far corrispondere valori diversi per chiavi diverse.&lt;br /&gt;
&lt;br /&gt;
Si noti che se usiamo come chiave un oggetto String, non abbiamo bisogno di reimplementare alcun metodo poichè questi sono già implementati nella classe. Anche la classe Int32 sovrascrive Equals() e &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;GetHashCode()&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; implementando &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;IEquatable&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;, ma quest&#39;ultimo non soddisfa la proprietà di distribuire uniformemente i valori di hash poichè restituisce il valore stesso (ad es. se &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;Int32&amp;nbsp;key = 10&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;, &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;key.GetHashCode()&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; restituisce 10).&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;Vediamo un esempio d&#39;uso di Dictionary:&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;var employees = new Dictionary&amp;lt;EmployeeId,Employee&amp;gt;(100); //Dictionary iniziale di 100 elementi&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
dove &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;EmployeeId&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; è definita come&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;public struct EmployeeId : IEquatable&amp;lt;EmployeeId&amp;gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp; ...&lt;/span&gt;&lt;br /&gt;
&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp; private readonly int number;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;br /&gt;
&amp;nbsp; public EmployeeId(string id)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (id == null) throw new ArgumentNullException(&quot;id&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; number = int.Parse(id);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; public bool Equals(EmployeeId other)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp; {&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //i due Employee sono uguali se il campo number è uguale&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (other == null) return false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (number == other.number);&lt;br /&gt;
&amp;nbsp; }&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp; public override int GetHashCode()&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp; {&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //questa funzione è arbitraria ma deve essere di tipo hash&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;return ((int)number ^ (int)(number &amp;gt;&amp;gt; 32));&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;...&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/span&gt;&lt;/div&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: x-small;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;Per aggiungere elementi al Dictionary si può usare il metodo &lt;span style=&quot;color: #3d85c6;&quot;&gt;Add(chiave,valore)&lt;/span&gt;, mentre per cercare un valore si può usare il metodo &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;TryGetValue(chiave, out valore))&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; che restituisce false se l&#39;elemento non&lt;br /&gt;
è presente, oppure si usa Contains(chiave) (senza farsi restuire il valore). Il metodo &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;Remove(chiave)&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; serve invece per eliminare degli elementi. &lt;br /&gt;
&lt;br /&gt;
Un Dictionary Lookup è simile al Dictionary, ma supporta più valori con la stessa chiave. A differenza del Dictionary non c&#39;è una classe &quot;contenitore ad hoc&quot; ma ne viene sfruttata una già esistente, inoltre gli elementi vengono aggiunti mediante il metodo &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;ToLookup()&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;che restituisce un oggetto &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;Lookup &amp;lt; TKey, TElement &amp;gt;.&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; Il metodo &lt;span style=&quot;color: #3d85c6;&quot;&gt;ToLookup &lt;/span&gt;accetta un delegato che serve per selezionare la chiave.&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;Per esempio:&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;var racers = new List &amp;lt;Racer &amp;gt; ();&lt;br /&gt;
racers.Add(new Racer(&quot;Jacques&quot;, &quot;Villeneuve&quot;,&quot;Canada&quot;, 11));&lt;br /&gt;
racers.Add(new Racer(&quot;Alan&quot;, &quot;Jones&quot;,&quot;Australia&quot;, 12));&lt;br /&gt;
racers.Add(new Racer(&quot;Jackie&quot;, &quot;Stewart&quot;, &quot;United Kingdom&quot;, 27));&lt;br /&gt;
racers.Add(new Racer(&quot;James&quot;, &quot;Hunt&quot;, &quot;United Kingdom&quot;, 10));&lt;br /&gt;
racers.Add(new Racer(&quot;Jack&quot;, &quot;Brabham&quot;, &quot;Australia&quot;, 14));&lt;/span&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;var lookupRacers = racers.ToLookup(r = &amp;gt; r.Country);&lt;br /&gt;
&lt;br style=&quot;color: #666666;&quot; /&gt; &lt;span style=&quot;color: #666666; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;Crea una Lookup in cui la chiave risulta il campo &lt;span style=&quot;color: #3d85c6;&quot;&gt;Country &lt;/span&gt;della classe &lt;span style=&quot;color: #3d85c6;&quot;&gt;Racer&lt;/span&gt;. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: small;&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;Si noti &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;come &lt;/span&gt;ToLookup &lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;venga chiamato come un metodo di List.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Per selezionare gli elementi usiamo l&#39; accesso alla lista per mezzo della chiave:&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;foreach (Racer r in lookupRacers[&quot;Australia&quot;])&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; Console.WriteLine(r);&lt;br /&gt;
}&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
Si noti che l&#39;accesso alla lista è di tipo hash! Il metodo ToLookup è disponibile in tutte le classi C# che implementano l&#39;interfaccia &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;IEnumerable &amp;lt; T &amp;gt;.&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Infine il &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;SortedDictionary &amp;lt; TKey, TValue&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt; &amp;gt; non è altro che un albero binario ordinato in cui ciascuna chiave deve implementare &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;IComparable &amp;lt; TKey &amp;gt;.&lt;/span&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;pre style=&quot;color: #3d85c6;&quot;&gt;SortedDictionary&amp;lt;string, string&amp;gt; dic =&amp;nbsp;&lt;/pre&gt;&lt;pre style=&quot;color: #3d85c6;&quot;&gt;new SortedDictionary&amp;lt;string, string&amp;gt;();&lt;/pre&gt;&lt;pre style=&quot;color: #3d85c6;&quot;&gt;...&lt;/pre&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4f81bd; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Per approfondimenti vedi:&lt;br /&gt;
&lt;br /&gt;
Dictionary (classe) : &lt;a href=&quot;http://msdn.microsoft.com/it-it/library/xfhwa508%28v=vs.80%29.aspx&quot;&gt;&lt;span style=&quot;color: #2288bb; text-decoration: none;&quot;&gt;http://msdn.microsoft.com/it-it/library/xfhwa508(v=vs.80).aspx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
Lookup: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb460184.aspx&quot;&gt;&lt;span style=&quot;color: #2288bb; text-decoration: none;&quot;&gt;http://msdn.microsoft.com/en-us/library/bb460184.aspx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
SortedDictionary: &lt;a href=&quot;http://msdn.microsoft.com/it-it/library/f7fta44c.aspx&quot;&gt;&lt;span style=&quot;color: #2288bb; text-decoration: none;&quot;&gt;http://msdn.microsoft.com/it-it/library/f7fta44c.aspx&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin: 0cm 0cm 10pt; text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/5463817133065089540/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/dizionari-lookup-e-dizionari-ordinati.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/5463817133065089540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/5463817133065089540'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/dizionari-lookup-e-dizionari-ordinati.html' title='Dizionari, Lookup e Dizionari Ordinati di oggetti in C#'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_s-bbD_OuvNg/TVFD-vj7Y-I/AAAAAAAAABU/Ps0mGNRZdsc/s72-c/dizionario-online.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-8928789636623980741</id><published>2011-02-01T15:51:00.000+01:00</published><updated>2011-02-08T14:31:20.253+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="ASP"/><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="IIS"/><title type='text'>IIS 7.0 su Seven: installazione di ASP.NET</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_s-bbD_OuvNg/TVFEiA2TxRI/AAAAAAAAABY/VcYAWEdVzsw/s1600/IIS7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://2.bp.blogspot.com/_s-bbD_OuvNg/TVFEiA2TxRI/AAAAAAAAABY/VcYAWEdVzsw/s200/IIS7.jpg&quot; width=&quot;170&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p$1&gt;State sviluppando la vostra applicazione web in ASP.NET e ad un certo punto volete pubblicarla con IIS 7.0, magari sotto Windows Seven o Vista. Vi renderete subito conto che la cosa non è così banale come con le versioni precedenti di IIS magari perchè ASP.NET non è automaticamente installato con IIS. Se trovate un errore del genere:&lt;/p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;i&gt;IIS 7.0&lt;br /&gt;
Riepilogo errori&lt;br /&gt;
Errore HTTP 404.3 - Not Found&lt;br /&gt;
La pagina richiesta non può essere servita a causa della configurazione&lt;br /&gt;
estensioni. Se la pagina è uno script, aggiungere un gestore. Se il file&lt;br /&gt;
deve essere scaricato, aggiungere una mappa MIME (Multipurpose Internet&lt;br /&gt;
Mail Extensions).&lt;br /&gt;
Informazioni dettagliate sull&#39;erroreModulo StaticFileModule&lt;br /&gt;
Notifica ExecuteRequestHandler&lt;br /&gt;
Gestore StaticFile&lt;br /&gt;
Codice errore 0x80070032&lt;br /&gt;
URL richiesto &lt;a href=&quot;http://localhost/hello_word.asp&quot; target=&quot;_blank&quot;&gt;http://localhost:80/hello_word.asp&lt;/a&gt;&lt;br /&gt;
Percorso fisico C:\inetpub\wwwroot\hello_word.asp&lt;br /&gt;
Metodo di accesso Anonima&lt;br /&gt;
Utente accesso Anonima&lt;br /&gt;
&lt;br /&gt;
Cause più probabili:&lt;br /&gt;
È possibile che manchi un mapping del gestore. Per impostazione&lt;br /&gt;
predefinita, il gestore di file statici elabora tutti i contenuti.&lt;br /&gt;
La funzionalità che si sta tentando di utilizzare potrebbe non essere&lt;br /&gt;
installata.&lt;br /&gt;
Il mapping MIME appropriato non è abilitato per il sito Web o&lt;br /&gt;
l&#39;applicazione. Avviso: non creare un mapping MIME per contenuti che gli&lt;br /&gt;
utenti non devono scaricare, ad esempio pagine .ASPX o file .config.&lt;br /&gt;
Se ASP.NET non è installato.&lt;/i&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;p$1&gt;&lt;p$1&gt;&amp;nbsp;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&amp;nbsp;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;Molto probabilmente si tratta proprio del fatto che ASP.NET non è installato. Lo si può anche vedere tra le opzioni che offre IIS Manager: aprite IIS Manager da Pannello di Controllo -&amp;gt; Strumenti di Amministrazione -&amp;gt; Gestione Internet Information Services (IIS): alla voce IIS (in visualizzazione funzionalità) deve comparire ASP Se così non è allora installare ASP in questo modo:&lt;br /&gt;
&lt;p$1&gt;&lt;p$1&gt;- Pannello di controllo-&amp;gt;Programmi e funzionalità&lt;br /&gt;
&lt;p$1&gt;- clicchiamo su Attivazione o disattivazione delle funzionalità di Windows&lt;br /&gt;
&lt;p$1&gt;- Scorriamo fino a trovare Internet Information Services &lt;br /&gt;
&lt;p$1&gt;- Abilitiamo le funzionalità che ci interessano (ASP, ASP.NET, CGI, Estensioni ISAPI, Filtri ISAPI, ecc...):&lt;br /&gt;
&lt;p$1&gt;- Sempre sotto il nodo Internet Information Services espandiamo il nodo Servizi Web, quindi Protezione e spuntiamo cio che ci interessa (solitamente basta Autenticazione di base per poter amministrare il sito web in locale)&lt;br /&gt;
&lt;p$1&gt;&amp;nbsp;- clicchiamo su OK ed attendiamo che la configurazione di IIS sia portata a termine.&lt;br /&gt;
&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/p$1&gt;&lt;/div&gt;&lt;p$1&gt;&lt;/p$1&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/8928789636623980741/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/iis-70-su-seven-installazione-di-aspnet.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/8928789636623980741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/8928789636623980741'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/iis-70-su-seven-installazione-di-aspnet.html' title='IIS 7.0 su Seven: installazione di ASP.NET'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_s-bbD_OuvNg/TVFEiA2TxRI/AAAAAAAAABY/VcYAWEdVzsw/s72-c/IIS7.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3057731074981017942.post-3290334622228012162</id><published>2011-02-01T14:28:00.004+01:00</published><updated>2011-02-17T12:04:33.461+01:00</updated><title type='text'>Lo scopo di questo blog...</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-Wrgamly56KM/TVkALSdPK1I/AAAAAAAAACA/vYvMWfnM_yQ/s1600/sviluppatore.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-Wrgamly56KM/TVkALSdPK1I/AAAAAAAAACA/vYvMWfnM_yQ/s1600/sviluppatore.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;... è quello di mantenere degli appunti: i famosi tips &amp;amp; tricks che possono però diventare pericolosamente tics &amp;amp; trips informatici. Molto spesso mi è capitato di trovare soluzioni a problemi che dovevo affrontare direttamente in internet e molto spesso trovavo queste soluzioni in forum o blog o comunque non su siti ufficiali. Spero allora che questo blog possa risolvere problemi che possono sorgere nel mondo della programmazione o comunque in campo informatico. Innanzitutto mi presento col dire di cosa mi occupo tutti i giorni: programmo dalla tenera età di 14 anni quando i miei genitori mi regalarono il buon vecchio Commodore 64 e già allora mi rendevo conto di avere due passioni: l&#39;informatica e la scrittura. Ho coltivato la prima passione proseguendo gli studi diventando prima perito informatico, poi ingegnere elettronico e poi ancora (ad oggi) con 10 anni di esperienze lavorative nel mondo ICT. La seconda passione invece, quella per la scrittura, l&#39;ho un pò tralasciata, se non qualche parentesi nella stesura di qualche articolo per la rivista .DEV di Infomedia. Oggi vorrei unire l&#39;utile al dilettevole scrivendo appunti &quot;a mano libera&quot;, senza un filo logico apparente,&amp;nbsp;su problematiche che mi capitano tutti i giorni e che possono essere di aiuto a qualcun altro, almeno spero.&lt;br /&gt;
Ogni vostro contributo sarà utile e prezioso... saluti!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmazioneedintorni.blogspot.com/feeds/3290334622228012162/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/lo-scopo-di-questo-blog.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/3290334622228012162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3057731074981017942/posts/default/3290334622228012162'/><link rel='alternate' type='text/html' href='http://programmazioneedintorni.blogspot.com/2011/02/lo-scopo-di-questo-blog.html' title='Lo scopo di questo blog...'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15634576564750681151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-Wrgamly56KM/TVkALSdPK1I/AAAAAAAAACA/vYvMWfnM_yQ/s72-c/sviluppatore.gif" height="72" width="72"/><thr:total>0</thr:total></entry></feed>