<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0YMRno7fip7ImA9WhRaE0o.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963</id><updated>2012-02-16T08:59:47.406+01:00</updated><category term="singlecall" /><category term="analyseur C" /><category term="stats blogspot" /><category term="analyseur langage programmation pascal c" /><category term="liste fichiers" /><category term="dotnet Remoting" /><category term="rss c sharp" /><category term="marshalling" /><category term="switch en dot net" /><category term="switch dotnet" /><category term="pointeur ballant" /><category term="remote object" /><category term="outil statistiques" /><category term="caml language" /><category term="analyseur pascal" /><category term="c# switch" /><category term="singleton" /><category term="dotnet Remoting with c#" /><category term="syndication dot net" /><category term="client serveur c#" /><category term="fichiers c#" /><category term="syndication avec c#" /><category term="cao" /><category term="syndication .net" /><category term="messagerie avec c#" /><category term="TP compilation" /><category term="dotnet remoting avec c#" /><category term="switch" /><category term="c#" /><category term="dangling" /><category term="blogger stats" /><category term="rss c#" /><category term="csharp syndication" /><category term="marshallbyvalue" /><category term="statistiques blogger" /><category term="pointer problem" /><category term="compilation" /><category term="c# rss" /><category term="syndication c#" /><category term="c# chat" /><category term="activator remoting" /><category term="mbr" /><category term="switch en c#" /><category term="analyseur pascal C" /><category term="switch in c#" /><category term="pointer dangling" /><category term=".net" /><category term="Single call" /><category term="dangling pointer problem" /><category term="dotnet" /><category term="analyseur lexical pascal" /><category term="chat with c#" /><category term="Caml" /><category term="statistiques" /><category term="outil stat" /><category term="rss .net" /><category term="analyseur lexical c" /><category term="outil statistiques blogger" /><category term="c laxical analysiser" /><category term="dangling problem" /><category term="tutoriel WCF" /><category term="langage Caml" /><category term="switch c#" /><category term="getfiles()" /><category term="probleme pointeur" /><category term="ballant" /><category term="marshallbyref" /><category term="Syndication" /><category term="mbv" /><category term="probleme ballant" /><category term="system.io" /><category term="tutoriel c#" /><category term="syndication .net 3.5" /><category term="pointeur dangling" /><category term="blogger" /><category term="programmation fonctionnelle" /><category term="WCF" /><category term="dangling pointer" /><category term="functional programming" /><category term="instruction switch en c#" /><category term="ocaml" /><category term="dotnet switch" /><category term="chat avec c#" /><title>Desert Dev</title><subtitle type="html">Articles et tutoriels .net ,Astuces de programmation</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://ch-zaki.blogspot.com/" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/AeBT" /><feedburner:info uri="blogspot/aebt" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DEYGQn8-fCp7ImA9WhdTF04.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-4217862708121834830</id><published>2011-07-15T14:13:00.001+01:00</published><updated>2011-07-15T14:22:03.154+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-15T14:22:03.154+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".net" /><category scheme="http://www.blogger.com/atom/ns#" term="tutoriel c#" /><category scheme="http://www.blogger.com/atom/ns#" term="tutoriel WCF" /><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title>Tutoriel WCF</title><content type="html">Dans ce tutoriel on va essayer d'introduire à travers un exemple illustratif la technologie WCF qui a pour but de faciliter la communication entre les processus locaux ou distants et permettant ainsi un développement souple et performant.&lt;br /&gt;
Le principe est très simple, on a un serveur exposant un ou plusieurs services à des clients distant, dans notre cas le serveur offre un service d'inversement de chaines de caractères.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
En premier lieu nous avons besoins de définir les service que le client peut accéder, c-à-d les services exposés par le serveur. Cela est est réalisé à travers la définition de l'interface c# suivante:&lt;br /&gt;
&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;using&lt;/span&gt; &lt;span style="color: teal;"&gt;System&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;using&lt;/span&gt; &lt;span style="color: teal;"&gt;System.ServiceModel&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceContract&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;interface&lt;/span&gt; IStringReverser&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;OperationContract&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; ReverseString&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; value&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: black;"&gt;Comme on peut le constater, celle-ci est une interface simple qui définisse la méthode &lt;/span&gt;ReverseString qui prend comme argument une chaine de caractère nommée &lt;span style="color: #0600ff;"&gt;&lt;/span&gt;value et retourne un résultat du même type (String).&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;L'attribut &lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceContract&lt;/span&gt;&lt;span style="color: black;"&gt;] indique que cette interface peut être exposée au client en tant que service, tandis que l'attribut&amp;nbsp;&lt;/span&gt;&lt;code&gt;&lt;/code&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;OperationContract&lt;/span&gt;&lt;span style="color: black;"&gt;] indique que la méthode &lt;/span&gt;ReverseString&lt;span style="color: black;"&gt; fait partie de ce service et peut etre ainsi utilisé par les clients.&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp;Notons bien que l'ajout de l'espace de nom &lt;/span&gt;&lt;span style="color: teal;"&gt;System.ServiceModel&lt;/span&gt;&lt;span style="color: black;"&gt; au références du projet est requis.&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;Començons par implémenter notre serveur, en premier lieu on doit créer une classe qui implemente l'interface du service . le code de cette classe est illustré par le code suivant:&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;using&lt;/span&gt; &lt;span style="color: teal;"&gt;System&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;using&lt;/span&gt; &lt;span style="color: teal;"&gt;System.ServiceModel&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceContract&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;interface&lt;/span&gt; IStringReverser&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;OperationContract&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; ReverseString&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; value&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;class&lt;/span&gt; StringReverser &lt;span style="color: #296d26;"&gt;:&lt;/span&gt; IStringReverser&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; ReverseString&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; value&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;char&lt;/span&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt; retVal &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; value.&lt;span style="color: black;"&gt;ToCharArray&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;int&lt;/span&gt; idx &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; &lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;for&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;int&lt;/span&gt; i &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; value.&lt;span style="color: black;"&gt;Length&lt;/span&gt; &lt;span style="color: #296d26;"&gt;-&lt;/span&gt; &lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt; i &lt;span style="color: #296d26;"&gt;&amp;gt;=&lt;/span&gt; &lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt; i&lt;span style="color: #296d26;"&gt;--&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; retVal&lt;span style="color: black;"&gt;[&lt;/span&gt;idx&lt;span style="color: #296d26;"&gt;++&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt; &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; value&lt;span style="color: black;"&gt;[&lt;/span&gt;i&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;return&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;string&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;retVal&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;maintenant on doit ajouter une autre classe permettant de rendre fonctionnel notre serveur à travers la creation d'un ServiceHost (hébergeur de service)qui est responsable sur l'exposition et la communication dans le service.&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;La nouvelle classe (Main) du serveur sera donc la suivante:&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;class&lt;/span&gt; Program&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;void&lt;/span&gt; Main&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;string&lt;/span&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt; args&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: teal;"&gt;ServiceHost&lt;/span&gt; host&lt;span style="color: #296d26;"&gt;=&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceHost&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;typeof&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;StringReverser&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;,&lt;span style="color: #0600ff;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new&lt;/span&gt;&lt;span style="color: teal;"&gt;Uri&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"http://localhost:8000"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; host.&lt;span style="color: black;"&gt;AddServiceEndpoint&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;typeof&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;IStringReverser&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;BasicHttpBinding&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;"Reverse"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; host.&lt;span style="color: black;"&gt;Open&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"Service is available. "&lt;/span&gt; &lt;span style="color: #296d26;"&gt;+&lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;"Press &lt;enter&gt; to exit."&lt;/enter&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;ReadLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; host.&lt;span style="color: black;"&gt;Close&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;l'objet host représente notre service host ou hebergeur de notre service, ici on a utilisé comme adresse &lt;span style="color: red;"&gt;http://localhost:8000 &lt;span style="color: black;"&gt;pour indiqué que le service est hébergé sur le poste local.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&amp;nbsp;host.&lt;span style="color: black;"&gt;AddServiceEndpoint&lt;/span&gt;&lt;span style="color: black;"&gt;(...) permet de définir le point d'acces (&lt;/span&gt;&lt;span style="color: red;"&gt;"Reverse") &lt;/span&gt;&lt;span style="color: black;"&gt;de notre service et le protocole de communication &lt;span style="color: teal;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal;"&gt;asicHttpBinding)&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: teal;"&gt;&lt;span style="color: black;"&gt;ensuite il ne reste que lancer le service avec la commande &lt;/span&gt;&lt;/span&gt;host.&lt;span style="color: black;"&gt;Open&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;).&lt;/span&gt;&lt;span style="color: teal;"&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: teal;"&gt;&lt;span style="color: black;"&gt;Le code complet de notre serveur sera dons le suivant:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: teal;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;using&lt;/span&gt; &lt;span style="color: teal;"&gt;System&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;using&lt;/span&gt; &lt;span style="color: teal;"&gt;System.ServiceModel&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;namespace&lt;/span&gt; WCFServer&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceContract&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;interface&lt;/span&gt; IStringReverser&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;OperationContract&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; ReverseString&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; value&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;class&lt;/span&gt; StringReverser &lt;span style="color: #296d26;"&gt;:&lt;/span&gt; IStringReverser&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; ReverseString&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; value&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;char&lt;/span&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt; retVal &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; value.&lt;span style="color: black;"&gt;ToCharArray&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;int&lt;/span&gt; idx &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; &lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;for&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;int&lt;/span&gt; i &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; value.&lt;span style="color: black;"&gt;Length&lt;/span&gt; &lt;span style="color: #296d26;"&gt;-&lt;/span&gt; &lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt; i &lt;span style="color: #296d26;"&gt;&amp;gt;=&lt;/span&gt; &lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt; i&lt;span style="color: #296d26;"&gt;--&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; retVal&lt;span style="color: black;"&gt;[&lt;/span&gt;idx&lt;span style="color: #296d26;"&gt;++&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt; &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; value&lt;span style="color: black;"&gt;[&lt;/span&gt;i&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;return&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;string&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;retVal&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;span style="color: teal;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&amp;nbsp; &lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;class&lt;/span&gt; Program&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;void&lt;/span&gt; Main&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;string&lt;/span&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt; args&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: teal;"&gt;ServiceHost&lt;/span&gt; host&lt;span style="color: #296d26;"&gt;=&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceHost&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;typeof&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;StringReverser&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;,&lt;span style="color: #0600ff;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new&lt;/span&gt;&lt;span style="color: teal;"&gt;Uri&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"http://localhost:8000"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; host.&lt;span style="color: black;"&gt;AddServiceEndpoint&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;typeof&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;IStringReverser&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;BasicHttpBinding&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;,&lt;span style="color: red;"&gt;"Reverse"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; host.&lt;span style="color: black;"&gt;Open&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"Service is available. "&lt;/span&gt; &lt;span style="color: #296d26;"&gt;+&lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;"Press  to exit."&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;ReadLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; host.&lt;span style="color: black;"&gt;Close&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: black;"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;Passons maintenant au client, en premier lieu, on doit définir la même interface du service offerte par le serveur.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;En second lieu, on doit définir un proxy et un canal de communication entre le client et le serveur ce qui permettant ainsi l'echange des messages. Pour cela, on va utiliser la classe&lt;code style="color: #38761d;"&gt; &lt;/code&gt;&lt;/span&gt;&lt;span style="color: teal;"&gt;ChannelFactory&lt;/span&gt;&lt;code style="color: #38761d;"&gt;&lt;/code&gt; offerte par WCF.&lt;br /&gt;
&amp;nbsp;Le code du client sera donc comme suit:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;using&lt;/span&gt; &lt;span style="color: teal;"&gt;System&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;using&lt;/span&gt; &lt;span style="color: teal;"&gt;System.ServiceModel&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;using&lt;/span&gt; &lt;span style="color: teal;"&gt;System.ServiceModel.Channels&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;namespace&lt;/span&gt; WCFClient&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceContract&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;interface&lt;/span&gt; IStringReverser&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: teal;"&gt;OperationContract&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; ReverseString&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; value&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;class&lt;/span&gt; Program&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;void&lt;/span&gt; Main&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;string&lt;/span&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt; args&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;ChannelFactory&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;lt;&lt;/span&gt;IStringReverser&lt;span style="color: black;"&gt;&amp;gt;&lt;/span&gt; httpFactory &lt;span style="color: #296d26;"&gt;=&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;ChannelFactory&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;lt;&lt;/span&gt;IStringReverser&lt;span style="color: black;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;BasicHttpBinding&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;EndpointAddress&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"http://localhost:8000/Reverse"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; IStringReverser httpProxy &lt;span style="color: #296d26;"&gt;=&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpFactory.&lt;span style="color: black;"&gt;CreateChannel&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;while&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;true&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;string&lt;/span&gt; str &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;ReadLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"http: "&lt;/span&gt; &lt;span style="color: #296d26;"&gt;+&lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpProxy.&lt;span style="color: black;"&gt;ReverseString&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;str&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
trop simple non ?, WCF facilite beaucoup le développement des applications distribuées par l'abstraction de la partie communication et les développeurs n'ont qu'a definir les services et leurs mode de communication.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.ziddu.com/download/15698396/WCF.zip.html"&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Télécharger le code source de l'exemple ici &lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-4217862708121834830?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9J9RTVYuAfOrdI3DE6fNORHuVlQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9J9RTVYuAfOrdI3DE6fNORHuVlQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9J9RTVYuAfOrdI3DE6fNORHuVlQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9J9RTVYuAfOrdI3DE6fNORHuVlQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/ZUtSPBF_BtM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/4217862708121834830/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=4217862708121834830" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/4217862708121834830?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/4217862708121834830?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/ZUtSPBF_BtM/tutoriel-wcf.html" title="Tutoriel WCF" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2011/07/tutoriel-wcf.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IEQH44cSp7ImA9Wx5bEkU.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-778235361916451868</id><published>2010-10-28T16:56:00.002+01:00</published><updated>2010-10-28T16:58:21.039+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-28T16:58:21.039+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="liste fichiers" /><category scheme="http://www.blogger.com/atom/ns#" term="fichiers c#" /><category scheme="http://www.blogger.com/atom/ns#" term="tutoriel c#" /><category scheme="http://www.blogger.com/atom/ns#" term="system.io" /><category scheme="http://www.blogger.com/atom/ns#" term="getfiles()" /><title>Recuperer la liste des fichiers en c# -tutoriel C#</title><content type="html">Pouvez vous me dire combien de fichier existe-il sur l'un de vos disques&amp;nbsp; C: ,D: ou sur la totalité de l'ordinateur?&lt;br /&gt;
&lt;br /&gt;
il y a plusieurs situations ou le développeur est obligé de récupérer des informations pareilles ,et un grand merci a l'espace de noms System.IO qui nous facilite beaucoup les choses ., car tous ce que nous avons a faire c'est de créer une variable et une boucle.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
pour commencer on doit ajouter l'espace de nom System.IO parce qu'il n'est pas utilisé par défaut ,&lt;br /&gt;
&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;&lt;/span&gt;&lt;span title=""&gt;Ensuite,  nous allons créer une nouvelle instance de la classe &lt;b&gt;&lt;span style="color: #274e13;"&gt;DirectoryInfo&lt;/span&gt;&lt;/b&gt;, et dans ce cas,  nous utilisons le lecteur racine de &lt;b&gt;C: \ &lt;/b&gt;comme paramètre (parce que on veux avoir des informations sur ce dernier), de sorte que le code  devrait ressembler à:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="geshifilter"&gt;&lt;blockquote&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: teal;"&gt;DirectoryInfo&lt;/span&gt; fileListing &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;DirectoryInfo&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"C:&lt;span style="color: red;"&gt;\\&lt;/span&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;Ce code  fait exactement ce que vous pensez, il prend le répertoire et vous permet  d'obtenir toutes sortes d'informations&amp;nbsp; (permissions,Date de creation,Derniere date de modifications ...etc)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;Maintenant  que nous avons notre objet &lt;b&gt;&lt;span style="color: #274e13;"&gt;DirectoryInfo&lt;/span&gt;&lt;/b&gt;, nous pouvons parcourir tous  les fichiers de ce répertoire et faire n'importe quoi avec eux.Dans notre cas , on vaut seulement Remplir une ListBox avec le chemin Complet des Fichiers . pour faire cela on doit appeler la methode &lt;b&gt;&lt;span style="color: #274e13;"&gt;GetFiles()&lt;/span&gt;&lt;/b&gt;&lt;span style="color: #274e13;"&gt;&lt;span style="color: black;"&gt; qui retourne un tableau d'objets de type &lt;b&gt;FileInfo.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;&lt;span style="color: #274e13;"&gt;&lt;span style="color: black;"&gt;chaque FileInfo contient une tonne d'informations , mais tous ce qu'on a réellement besoin c'est le nom&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;,&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;Donc, notre code final pourrait ressembler à:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;blockquote&gt;&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: teal;"&gt;DirectoryInfo&lt;/span&gt; fileListing &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;DirectoryInfo&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"C:&lt;span style="color: red;"&gt;\\&lt;/span&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;foreach&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: teal;"&gt;FileInfo&lt;/span&gt; file &lt;span style="color: #0600ff;"&gt;in&lt;/span&gt; fileListing.&lt;span style="color: black;"&gt;GetFiles&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; listBox1.&lt;span style="color: black;"&gt;Items&lt;/span&gt;.&lt;span style="color: black;"&gt;Add&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;fileListing.&lt;span style="color: black;"&gt;ToString&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt; &lt;span style="color: #296d26;"&gt;+&lt;/span&gt; file.&lt;span style="color: black;"&gt;Name&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;Super simple mais soyons honnêtes, combien de fois on a besoin de tous les fichiers dans un répertoire ?! &lt;/span&gt;&lt;/span&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;Pas très souvent, mais heureusement la Méthode&amp;nbsp;&lt;/span&gt;&lt;/span&gt; GetFiles()accepte un argument &lt;b&gt;"Modèle de Recherche"&lt;/b&gt; pour Limiter les &lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;FileInfo retournés dans le résultat.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;Cet argument est juste une chaîne&lt;/span&gt;&lt;/span&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt; de caractères ,&lt;/span&gt;&lt;/span&gt;&lt;span class="" id="result_box" lang="fr"&gt;&lt;span title=""&gt;disons que nous voulons chercher des fichiers text (.txt) Alors &lt;/span&gt;&lt;span title=""&gt;Notre code de mise à jour &lt;/span&gt;&lt;/span&gt;sera le suivant:&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: teal;"&gt;DirectoryInfo&lt;/span&gt; fileListing &lt;span style="color: #296d26;"&gt;=&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;DirectoryInfo&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"C:&lt;span style="color: red;"&gt;\\&lt;/span&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;foreach&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: teal;"&gt;FileInfo&lt;/span&gt; file &lt;span style="color: #0600ff;"&gt;in&lt;/span&gt; fileListing.&lt;span style="color: black;"&gt;GetFiles&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"*.txt"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; listBox1.&lt;span style="color: black;"&gt;Items&lt;/span&gt;.&lt;span style="color: black;"&gt;Add&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;fileListing.&lt;span style="color: black;"&gt;ToString&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt; &lt;span style="color: #296d26;"&gt;+&lt;/span&gt; file.&lt;span style="color: black;"&gt;Name&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;le seul inconvenant dans l'utilisation du modèle de recherche c'est qu'on ne peux utiliser qu'un seul modèle c-a-d&amp;nbsp; on ne peux chercher qu'un seul type de fichier a la fois, et pour remédier a ce problème on n'a qu'a appeler la méthode GetFiles() plusieurs fois avec comme paramètre le type de fichier adéquat, pas plus simple que cela ;) .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-778235361916451868?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2H5-5ljJrbHajD3FyVN61dT5DXI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2H5-5ljJrbHajD3FyVN61dT5DXI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2H5-5ljJrbHajD3FyVN61dT5DXI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2H5-5ljJrbHajD3FyVN61dT5DXI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/TNXfIDXJlPA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/778235361916451868/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=778235361916451868" title="2 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/778235361916451868?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/778235361916451868?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/TNXfIDXJlPA/recuperer-la-liste-des-fichiers-en-c.html" title="Recuperer la liste des fichiers en c# -tutoriel C#" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2010/10/recuperer-la-liste-des-fichiers-en-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAASHo5eyp7ImA9Wx5WEkg.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-2306713670931991065</id><published>2010-09-21T16:28:00.005+01:00</published><updated>2010-09-23T16:45:49.423+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-23T16:45:49.423+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c# switch" /><category scheme="http://www.blogger.com/atom/ns#" term="switch c#" /><category scheme="http://www.blogger.com/atom/ns#" term="instruction switch en c#" /><category scheme="http://www.blogger.com/atom/ns#" term="switch en c#" /><category scheme="http://www.blogger.com/atom/ns#" term="switch dotnet" /><category scheme="http://www.blogger.com/atom/ns#" term=".net" /><category scheme="http://www.blogger.com/atom/ns#" term="switch" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><category scheme="http://www.blogger.com/atom/ns#" term="switch in c#" /><category scheme="http://www.blogger.com/atom/ns#" term="switch en dot net" /><category scheme="http://www.blogger.com/atom/ns#" term="dotnet switch" /><title>Jouer avec le Switch -Tutoriel c#</title><content type="html">Aujourd'hui, nous allons jeter un œil sur le &lt;span style="font-weight: bold;"&gt;switch&lt;/span&gt;. Plus précisément, nous allons voir certains des comportements les moins connus de l'instruction&lt;b&gt; switch&lt;/b&gt; &lt;b&gt;en C #&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1-&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;void&lt;/span&gt; FaireUnSwitch&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;int&lt;/span&gt; nbr&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;switch&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;nbr&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; &lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; &lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; &lt;span style="color: black;"&gt;2&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"Je suis dans le cas 0, 1 ou 2!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;break&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; &lt;span style="color: black;"&gt;3&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; &lt;span style="color: black;"&gt;4&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; &lt;span style="color: black;"&gt;5&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"je suis dans le cas 3, 4 ou 5!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;break&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;en écrivant le code de cette manière en regroupant les cases &lt;span class="short_text" id="result_box"&gt;&lt;span title=""&gt;on dit que:&lt;a name='more'&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="short_text" id="result_box"&gt;&lt;span title=""&gt; "pour 0,1,2 faire l'instruction X, et pour 3,4,5 faire l'instruction Y"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="short_text" id="result_box"&gt;&lt;span title=""&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="short_text" id="result_box"&gt;&lt;span title=""&gt;2-&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;enum&lt;/span&gt; State &lt;span style="color: black;"&gt;{&lt;/span&gt; One, Two, Three, Four &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;switch&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;mystate&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;One&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"Je suis dans l'etat: one!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;break&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;Two&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"&lt;/span&gt;&lt;span style="color: red;"&gt;Je suis dans l'etat:&lt;/span&gt;&lt;span style="color: red;"&gt; two!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;goto&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;Four&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;Three&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"&lt;/span&gt;&lt;span style="color: red;"&gt;Je suis dans l'etat:&lt;/span&gt;&lt;span style="color: red;"&gt; three!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;goto&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;Two&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;Four&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"&lt;/span&gt;&lt;span style="color: red;"&gt;Je suis dans l'etat:&lt;/span&gt;&lt;span style="color: red;"&gt; four!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;goto&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;One&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;en C# on a la possibilité de faire un goto vers un label (étiquette), ce qui veut dire qu'on peut&amp;nbsp;&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt; aller executer&amp;nbsp; n'importe quel case, nous voulons à tout moment .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt;si vous essayez d'executer le code precedant avec comme parametre mystate=three , vous aurez le resultat suivant :&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;span style="background-color: white; color: black;"&gt;Je suis dans l'etat: three!&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: black;"&gt;Je suis dans l'etat: two!&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: black;"&gt;Je suis dans l'etat: four!&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: black;"&gt;Je suis dans l'etat: one!&lt;/span&gt;&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class="long_text" id="result_box"&gt;&lt;span title=""&gt;Cool, non? &lt;/span&gt;&lt;span title=""&gt;c'est pas encore fini, nous avons un peu d'excitation en plus. &lt;/span&gt;&lt;span style="background-color: white;" title=""&gt;Vous pouvez également utiliser cette instruction &lt;b&gt;goto&lt;/b&gt; pour aller au bloc par défaut dans une instruction &lt;b&gt;switch&lt;/b&gt;. &lt;/span&gt;&lt;span title=""&gt;Par exemple&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;enum&lt;/span&gt; State &lt;span style="color: black;"&gt;{&lt;/span&gt; One, Two, Three, Four &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;void&lt;/span&gt; FaireUnSwitch&lt;span style="color: black;"&gt;(&lt;/span&gt;State mystate&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;switch&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;mystate&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;One&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"I'm in state one!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;break&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;Two&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"I'm in state two!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;goto&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;default&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;Three&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"I'm in state three!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;goto&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;default&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;Four&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"I'm in state four!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;goto&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;default&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;default&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"I'm at the default!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;break&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&amp;nbsp; &lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt;Ici, dans tous les cas sauf pour State.One, nous allons au bloc &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0600ff;"&gt;default&lt;/span&gt;&lt;span style="color: #296d26;"&gt;&lt;/span&gt;&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt; (par défaut) avant de quitter&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt;il faut bien faire attention lorseque on ecrit des saut explicites pareils&amp;nbsp; car&amp;nbsp; il est tres facile a entrer dans une boucle infinie ! .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt; &lt;/span&gt;&lt;span style="background-color: white;" title=""&gt;En fait, le compilateur vous permet même de faire quelque chose aussi bête que cela: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;div class="geshifilter"&gt;&lt;div class="csharp geshifilter-csharp" style="font-family: monospace;"&gt;&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;enum&lt;/span&gt; State &lt;span style="color: black;"&gt;{&lt;/span&gt; One, Two, Three, Four &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0600ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;void&lt;/span&gt; DoASwitch&lt;span style="color: black;"&gt;(&lt;/span&gt;State mystate&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: #0600ff;"&gt;switch&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;mystate&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;One&lt;/span&gt;&lt;span style="color: #296d26;"&gt;:&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: teal;"&gt;Console&lt;/span&gt;.&lt;span style="color: black;"&gt;WriteLine&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;"I'm in state one!"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0600ff;"&gt;goto&lt;/span&gt; &lt;span style="color: #0600ff;"&gt;case&lt;/span&gt; State.&lt;span style="color: black;"&gt;One&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;span class="medium_text" id="result_box"&gt;&lt;span style="background-color: white;" title=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt;je  suis sûr que vous pouvez voir qu'avec cette instruction  &lt;b&gt;goto&lt;/b&gt; une fois que le programme entre dans ce bloc de code, il ne va  pas le quitter &lt;/span&gt;&lt;/span&gt;;)&lt;br /&gt;
&lt;br /&gt;
OK, c'est tout pour aujourd'hui , et j'espère bien que cet Article était utile , au moins pour les gens qui ne savaient pas les possibilités de Saut entre les blocs case en c#&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-2306713670931991065?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/y3Iy0Ku2fsWCjV7KZp7nhRPrFhU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/y3Iy0Ku2fsWCjV7KZp7nhRPrFhU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/y3Iy0Ku2fsWCjV7KZp7nhRPrFhU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/y3Iy0Ku2fsWCjV7KZp7nhRPrFhU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/rKmK8rxwbCE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/2306713670931991065/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=2306713670931991065" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/2306713670931991065?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/2306713670931991065?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/rKmK8rxwbCE/jouer-avec-le-switch-tutoriel-c.html" title="Jouer avec le Switch -Tutoriel c#" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2010/09/jouer-avec-le-switch-tutoriel-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcGQn05eyp7ImA9Wx5QF04.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-737591579360853022</id><published>2010-09-05T01:02:00.010+01:00</published><updated>2010-09-06T00:40:23.323+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-06T00:40:23.323+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="statistiques blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="statistiques" /><category scheme="http://www.blogger.com/atom/ns#" term="outil statistiques" /><category scheme="http://www.blogger.com/atom/ns#" term="outil statistiques blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="outil stat" /><category scheme="http://www.blogger.com/atom/ns#" term="blogger stats" /><category scheme="http://www.blogger.com/atom/ns#" term="stats blogspot" /><title>Google ajoute un outil analytique au service blogger</title><content type="html">le service d'hébergement et de publication de blogs Blogger a maintenant sa propre fonctionnalité  d'analyse qui surveille l'utilisation d'un blog a travers des rapport détaillés et des graphes  ( beaucoup similaire a Google Analytics).&lt;br /&gt;&lt;br /&gt;et parce que les statistiques sont une fonctionnalité native de blogger , les éditeurs n'ont pas a faire quelque chose de spécial pour les activer , il suffit de vérifier le nouvel onglet statistiques dans le tableau de bord du blog .&lt;br /&gt;&lt;br /&gt;avec cette nouvelle fonctionnalité(outil d'analyse des visiteurs blogger) les éditeurs ne sont pas obligé d' intégrer d'autres trackers d'utilisation comme Google Analitics ou autre chose similaire  ,Toutefois,  l'intégration des outils d'analyse des sites et blogs exige  généralement que les éditeurs collent le code dans leurs pages Web ou  ajoutent des applications gadget.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://tctechcrunch.files.wordpress.com/2010/07/blogger-stats.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 613px; height: 415px;" src="http://tctechcrunch.files.wordpress.com/2010/07/blogger-stats.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-737591579360853022?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Gmd3bSiOxHf8Bqhj8cE--GiUI1w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Gmd3bSiOxHf8Bqhj8cE--GiUI1w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Gmd3bSiOxHf8Bqhj8cE--GiUI1w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Gmd3bSiOxHf8Bqhj8cE--GiUI1w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/WG1hRdd_sd8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/737591579360853022/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=737591579360853022" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/737591579360853022?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/737591579360853022?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/WG1hRdd_sd8/google-ajoute-un-outil-analytique-au.html" title="Google ajoute un outil analytique au service blogger" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2010/09/google-ajoute-un-outil-analytique-au.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcFQ3czcSp7ImA9Wx5QE0Q.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-7176500422916615149</id><published>2010-08-30T15:13:00.013+01:00</published><updated>2010-09-02T02:46:52.989+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-02T02:46:52.989+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="syndication avec c#" /><category scheme="http://www.blogger.com/atom/ns#" term="rss .net" /><category scheme="http://www.blogger.com/atom/ns#" term="rss c sharp" /><category scheme="http://www.blogger.com/atom/ns#" term="csharp syndication" /><category scheme="http://www.blogger.com/atom/ns#" term="c# rss" /><category scheme="http://www.blogger.com/atom/ns#" term="syndication .net" /><category scheme="http://www.blogger.com/atom/ns#" term="syndication dot net" /><category scheme="http://www.blogger.com/atom/ns#" term="syndication .net 3.5" /><category scheme="http://www.blogger.com/atom/ns#" term="Syndication" /><category scheme="http://www.blogger.com/atom/ns#" term="rss c#" /><category scheme="http://www.blogger.com/atom/ns#" term="syndication c#" /><title>Syndication avec C# (rss avec c# 3.5)</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-sLhPZBCjN0/TH78yD_56TI/AAAAAAAAAHg/PXfDpWqEbh0/s1600/rss.JPG"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;en&lt;span style="font-weight: bold;"&gt; .Net 3.5&lt;/span&gt; il y a l'espace de nom&lt;span style="font-weight: bold;"&gt; Syndication&lt;/span&gt; qui gère a la fois les&lt;span style="font-weight: bold;"&gt; Flux&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;RSS&lt;/span&gt; et &lt;span style="font-weight: bold;"&gt;Atom&lt;/span&gt; .&lt;br /&gt;Voici un extrait de code d'un petit &lt;span style="font-weight: bold;"&gt;lecteur de Flux&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;RSS/Atom&lt;/span&gt; ,pour le moment c'est une petite application Console , mais je vais essayer de publier une version WPF dans les prochains jours nchalah .&lt;br /&gt;A première vue c'est très facile a implémenter , &lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt;Il suffit juste d'ajouter &lt;span style="font-weight: bold;"&gt;System.ServiceModel&lt;/span&gt; et &lt;span style="font-weight: bold;"&gt;System.ServiceModel.Web&lt;/span&gt; comme référence à votre projet et commencer a coder votre lecteur de &lt;span style="font-weight: bold;"&gt;syndication&lt;/span&gt; ;)&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.ServiceModel.Syndication;&lt;br /&gt;using System.Xml;&lt;br /&gt;&lt;br /&gt;namespace rsstest&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;   static void Main(string[] args)&lt;br /&gt;   {&lt;br /&gt;       try&lt;br /&gt;       {&lt;br /&gt;&lt;br /&gt;           XmlReader reader = XmlReader.Create("http://ch-zaki.blogspot.com/feeds/posts/default");&lt;br /&gt;           SyndicationFeed feed = SyndicationFeed.Load(reader);&lt;br /&gt;           foreach (SyndicationItem item in feed.Items)&lt;br /&gt;           {&lt;br /&gt;               Console.WriteLine(item.LastUpdatedTime.DateTime.ToString() +" : " +item.Title.Text);&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;       catch (Exception e)&lt;br /&gt;       {&lt;br /&gt;           Console.WriteLine(e.Message);&lt;br /&gt;       }&lt;br /&gt;       Console.ReadLine();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;et voila le resultat de l'exemple  l'execution :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-sLhPZBCjN0/TH78yD_56TI/AAAAAAAAAHg/PXfDpWqEbh0/s1600/rss.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 200px;" src="http://2.bp.blogspot.com/_-sLhPZBCjN0/TH78yD_56TI/AAAAAAAAAHg/PXfDpWqEbh0/s400/rss.JPG" alt="" id="BLOGGER_PHOTO_ID_5512120930945067314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="medium_text" id="result_box"&gt;&lt;span title=""&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-7176500422916615149?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1AuG7ME5qI6Ys_61dH23J_S9zdQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1AuG7ME5qI6Ys_61dH23J_S9zdQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1AuG7ME5qI6Ys_61dH23J_S9zdQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1AuG7ME5qI6Ys_61dH23J_S9zdQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/jgCb1S-FnwE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/7176500422916615149/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=7176500422916615149" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/7176500422916615149?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/7176500422916615149?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/jgCb1S-FnwE/syndication-en-c-net-35.html" title="Syndication avec C# (rss avec c# 3.5)" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_-sLhPZBCjN0/TH78yD_56TI/AAAAAAAAAHg/PXfDpWqEbh0/s72-c/rss.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2010/08/syndication-en-c-net-35.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEHRnwyeSp7ImA9Wx5RFUo.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-5576752689974798206</id><published>2010-05-14T08:41:00.024+01:00</published><updated>2010-08-23T16:50:37.291+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-23T16:50:37.291+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="dotnet Remoting" /><category scheme="http://www.blogger.com/atom/ns#" term="mbv" /><category scheme="http://www.blogger.com/atom/ns#" term="dotnet remoting avec c#" /><category scheme="http://www.blogger.com/atom/ns#" term="dotnet Remoting with c#" /><category scheme="http://www.blogger.com/atom/ns#" term="singleton" /><category scheme="http://www.blogger.com/atom/ns#" term="activator remoting" /><category scheme="http://www.blogger.com/atom/ns#" term="cao" /><category scheme="http://www.blogger.com/atom/ns#" term="marshallbyref" /><category scheme="http://www.blogger.com/atom/ns#" term="Single call" /><category scheme="http://www.blogger.com/atom/ns#" term="marshalling" /><category scheme="http://www.blogger.com/atom/ns#" term="remote object" /><category scheme="http://www.blogger.com/atom/ns#" term="singlecall" /><category scheme="http://www.blogger.com/atom/ns#" term="mbr" /><category scheme="http://www.blogger.com/atom/ns#" term="marshallbyvalue" /><category scheme="http://www.blogger.com/atom/ns#" term="dotnet" /><title>Microsoft .net Remoting</title><content type="html">&lt;u&gt;&lt;span style="font-size: 130%; font-weight: bold;"&gt;SOMMAIRE:&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;b&gt;Qu’est-ce  qu’un &lt;/b&gt;&lt;b&gt;système/Application Distribuée&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;C’est quoi.net Remoting?&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Architecture.Net  Remoting&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Les Objets en .NET Remoting&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Exemple Illustratif  (Étapes de Développement)&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;I-Qu’est-ce qu’un  système/Application Distribuée :&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: arial; font-style: italic; font-weight: bold;"&gt;Système  Distribué:&lt;/span&gt;  c’est système composé d’un ensemble de processus  faiblement couplés&lt;br /&gt;
connectés par un réseau de communication.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: arial; font-style: italic; font-weight: bold;"&gt;Application  distribuée:&lt;/span&gt;Application qui suit les principes de l'architecture  client-serveur, et peut tourner de façon transparente sur plusieurs  ordinateurs reliés en réseau.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;span style="font-size: 130%;"&gt; &lt;span style="font-weight: bold;"&gt;II-C’est quoi.net Remoting?&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
*.Net  Remoting est une technologie Microsoft permettant l’implémentation           d’applications distribuées , elle est comparable a RMI de java.&lt;br /&gt;
&lt;br /&gt;
*Offre  une structure riche et extensible permettant à des&lt;b&gt; objets &lt;/b&gt;existant  dans différents &lt;b&gt;domaines d'applications&lt;/b&gt;, &lt;b&gt;différents processus&lt;/b&gt; et sur&lt;b&gt;  différentes machines&lt;/b&gt; de &lt;b&gt;communiquer&lt;/b&gt; sans problème.&lt;br /&gt;
&lt;br /&gt;
*Propose un  &lt;b&gt;modèle de programmation&lt;/b&gt; à la fois très simple et puissant ainsi q' une &lt;b&gt; prise en charge Runtime &lt;/b&gt;rendant ces interactions transparentes  &lt;b style="color: #38761d;"&gt;(Abstraction de la notion de sockets).&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
*&lt;b&gt;Le principe général de  .Net Remoting &lt;/b&gt;est d'&lt;b&gt;exposer &lt;/b&gt;sur une partie &lt;b&gt;serveur des objets  accessibles par des clients distants &lt;/b&gt;en utilisantdes Différent  protocoles tel que &lt;b&gt;TCP/Binaire et http/Soap.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;III-Architecture.Net Remoting:&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_-sLhPZBCjN0/S-0CMSuCSwI/AAAAAAAAAGs/FpQBd0We-AU/s1600/img1.PNG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5471031532531632898" src="http://3.bp.blogspot.com/_-sLhPZBCjN0/S-0CMSuCSwI/AAAAAAAAAGs/FpQBd0We-AU/s400/img1.PNG" style="cursor: pointer; display: block; height: 236px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;Dans une architecture Remoting on trouve principalement:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;Serveur&lt;/span&gt;:il s’agira de l’application qui héberge l’objet distribué.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;Client:&lt;/span&gt;il s'agira de l’application qui appellera à distance l'objet Distribué situé sur le serveur.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;L'interface:&lt;/span&gt;elle contiendra la déclaration des méthodes de l'objet distribué.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;Le proxy :&lt;/span&gt; c’est une couche intermédiaire créée Dynamiquement par le framework et qui se&lt;br /&gt;
charge du routage des demandes du client vers le serveur sur le réseau et inversement de récupérer les réponses du serveur. Donc, lorsque on Réalise des appels distants, on ne dialogue pas directement avec le serveur mais avec le proxy&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="file:///C:/DOCUME%7E1/KOURTY/LOCALS%7E1/Temp/moz-screenshot.png" /&gt;&lt;u&gt;&lt;span style="font-size: 130%;"&gt; &lt;span style="font-weight: bold;"&gt;IV-Les Objets .NET Remoting:&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
-En .Net Remoting &lt;b&gt;Les objets ou leur référence&lt;/b&gt; pourront transiter via le réseau grâce au principe du &lt;b&gt;marshalling (empaquetage).&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
-&lt;b&gt;Les protocoles et formatages &lt;/b&gt;possibles sont paramétrables : &lt;b&gt;TCP+Binaire ou Http+Soap&lt;/b&gt; par exemple.&lt;br /&gt;
&lt;br /&gt;
-Par défaut, le framework .NET propose Tcpet Http, mais la technologie .NET Remoting permet à des éditeurs tiers de réaliser leurs propres implémentations et rend donc .NET Remoting potentiellement ouvert.&lt;br /&gt;
&lt;br /&gt;
-En remoting, &lt;b&gt;on ne peut communiquer que des objets dits "Serialisables"&lt;/b&gt;. Autrement dit, ceux qui &lt;b&gt;implémentent l'interface ISerializable.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
-&lt;b&gt;&lt;span style="color: #38761d;"&gt;La sérialisation est le processus qui permet de transformer l'objet en un format commun, et communicable sur le réseau.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
*On peut "servir" (dans le sens publier, mettre à la disponibilité des clients) un objet de deux façons possibles: -Par référence (&lt;b&gt;MarshallByRef&lt;/b&gt;) ou &lt;b&gt;(MBR&lt;/b&gt;)&lt;br /&gt;
-Par valeur (&lt;b&gt;MarshallByValue&lt;/b&gt;) ou (&lt;b&gt;MBV&lt;/b&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;1-Par référence (MarshallByRef):&lt;/span&gt;Les objets vivent sur le serveur, et le client utilise une référence à ces objets. On peut comparer ça à un pointeur sur une variable mais sur le réseau.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_-sLhPZBCjN0/S-0EPfelJXI/AAAAAAAAAG0/xzdt4-e_Zvw/s1600/img2.PNG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5471033786519332210" src="http://2.bp.blogspot.com/_-sLhPZBCjN0/S-0EPfelJXI/AAAAAAAAAG0/xzdt4-e_Zvw/s400/img2.PNG" style="cursor: pointer; display: block; height: 236px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt; &lt;span style="font-weight: bold;"&gt;2-Par valeur (MarshallByValue):&lt;/span&gt; Le client manipule une copie de l'objet qui est sur le serveur. les Clients et serveur ont chacun leur copie et l'utilisent indépendamment.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_-sLhPZBCjN0/S-0FNdHGjjI/AAAAAAAAAG8/oKui9jZNnkE/s1600/img3.PNG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5471034851035876914" src="http://3.bp.blogspot.com/_-sLhPZBCjN0/S-0FNdHGjjI/AAAAAAAAAG8/oKui9jZNnkE/s400/img3.PNG" style="cursor: pointer; display: block; height: 231px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;-Modes D’activation des Objets en .net Remoting&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
En .NET Remotingon parle plutôt d’activation d’objets que de création d’objets car la création génère l’activation de plusieurs actions avant la disponibilité effective de l’objet.&lt;br /&gt;
Il existe trois types d’activation d'objets distants (deux Coté Serveur, et une Coté Client) ,on peut opter pour l'un ou l'autre&lt;br /&gt;
en fonction des besoins de Notre application:&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;Coté Serveur:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;-Single call&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;-Singleton&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;Coté Client:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;-Client Activated Object (CAO)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Mode SingleCall(Activation Coté Serveur):&lt;/span&gt;Dans ce mode à chaque appel, le serveur crée une nouvelle instance de l'objet qui est détruit après chaque utilisation.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Mode Singleton(Activation Coté Serveur)&lt;/span&gt;:&lt;br /&gt;
Un seul objet est partagé entre les clients et les appels pendant une durée de vie fixée.Lorsquecette derniereest expirée, l'objet est réinstancié.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;CAO (Activation Coté Client):&lt;/span&gt;&lt;br /&gt;
Dans ce mode l’objet est Activé par le Client = une instance par client&lt;br /&gt;
L’instance de l’objet est créée dès l’appel a &lt;span style="color: red;"&gt;Activator.CreateInstance()&lt;/span&gt;&lt;span style="color: red; font-weight: bold;"&gt; &lt;/span&gt;du client.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic; font-weight: bold;"&gt;V Exemple illustratif&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;:&lt;br /&gt;
&lt;br /&gt;
-Les Etapes de Developpementd’une Application d’une .Net Remoting&lt;/span&gt;&lt;br /&gt;
Dans cet Exemple on va essayer de donner un exemple d’une petite Application Remoting, dont le Serveur offre un Service de Mise En Majuscule&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;Les Elementsde base:&lt;/span&gt;&lt;br /&gt;
Une Application Remotingest Composée princialementde:&lt;br /&gt;
Une Interface,un Client,et un Serveur&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: 100%;"&gt;&lt;span style="font-weight: bold;"&gt;1-Definition de l’interface&lt;/span&gt;&lt;/span&gt;:Pour que le client ait connaissance des méthodes distantes, une interface contenant leur déclaration doit être distribuée côtéclient et côté serveur. L'objet exposé sur le serveur devra implémenter cette interface.Cette interface sera Donc le seul élément commun entre le serveur et le client&lt;br /&gt;
&lt;br /&gt;
namespace Interface&lt;br /&gt;
{&lt;br /&gt;
public interface IService&lt;br /&gt;
{&lt;br /&gt;
string MettreEnMajuscule(string ClientMessage);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;2-Le Serveur:&lt;/span&gt;du côté serveur L'objet Distribué exposé sur le serveur devra implémenter MarshalByRefObject,etL’interface du Service Définie Precedement(Iservice).&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote style="color: #006600;"&gt;class Service:MarshalByRefObject,Interface.IService&lt;br /&gt;
{&lt;br /&gt;
public string MettreEnMajuscule(string ClientMessage)&lt;br /&gt;
{&lt;br /&gt;
Console.WriteLine("Le serveur a recu la chaine:{0}",ClientMessage);&lt;br /&gt;
return ClientMessage.ToUpper();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
on implémente la classe &lt;span style="color: red; font-style: italic;"&gt;MarshalByRefObject&lt;/span&gt; qui indique que le client ne contiendra qu'une référence de l'objet et non l'objet lui-même, une sorte de pointeur de fonction distant. Ce fonctionnement est à opposer à &lt;span style="color: red;"&gt;MarshalByValue&lt;/span&gt; où une copie complète d'un objet sérialisableest passée au client.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Configuration et lancement du serveur&lt;/span&gt;&lt;br /&gt;
-Création et Enregistrement d'un nouveau Canal d’Ecoute&lt;br /&gt;
-Démarrage de l'écoute en exposant l'objet dans le mode Souhaité&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style="color: #006600;"&gt;  class Program&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;    {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;        static void Main(string[] args)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;        {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;            try&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;            {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;                TcpChannel channel = new TcpChannel(12345);//creation du canal&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;                ChannelServices.RegisterChannel(channel);//enregistrement du canal&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #006600;"&gt;                //Exposition de l'objet et demarrage d'ecoute&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;                RemotingConfiguration.RegisterWellKnownServiceType(typeof(Service), "MiseEnMajuscule", WellKnownObjectMode.Singleton);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;                Console.WriteLine("Serveur en Marche...");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;            }&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;            catch (Exception ex) { Console.WriteLine(ex.Message); }&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;            finally&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;            {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;                Console.ReadLine();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #006600;"&gt;            }&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
Ici, nous Avons Creéun nouveau canal(Channel) de type Tcp. Des channels d'autres types pourraient être utilisés comme HttpChannel ou des développements non standards comme IIOPChannel. TcpChannel a l'avantage ici d'être plus rapide que HttpChannel puisque les données transitent en binaire.&lt;br /&gt;
-La Configuration peut etreaussi faite a l’aide de la methode.Configure() qui utilse un fichier XML pour charger la configuration&lt;br /&gt;
-Cette Alternative est tres utile car on n’est pas obligé de Recompiler le Serveur a chaque fois qu’on desire changer la configuration(Numerode port,Objéexposé,Moded’Exposition…)&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;3-Le Client:&lt;/span&gt;&lt;br /&gt;
-Ajouter une reference de l’interface de l’objet distribuéde distribué&lt;br /&gt;
&lt;br /&gt;
-Créer un Canal de communication (Le meme type du canal/Formattage que le Serveur utilise)&lt;br /&gt;
&lt;br /&gt;
-Recuperer la la Reference de l’objet distantde&lt;br /&gt;
&lt;br /&gt;
-Utilisation de la Reference…&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote style="color: #006600;"&gt;static class Program&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
static void Main()&lt;br /&gt;
{&lt;br /&gt;
Interface.IService RemoteService;&lt;br /&gt;
TcpChannel channel = new TcpChannel();&lt;br /&gt;
ChannelServices.RegisterChannel(channel);&lt;br /&gt;
RemoteService = (Interface.IService)Activator.GetObject(typeof(Interface.IService), "Tcp://127.0.0.1:12345/MiseEnMajuscule");&lt;br /&gt;
while (true)&lt;br /&gt;
{&lt;br /&gt;
Console.WriteLine(RemoteService.MettreEnMajuscule(Console.ReadLine()));          &lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Le .NETRemoting est la dernière technologie en matière d'applications distribuées, Dans le domaine des applications client- serveur, il y a eu une constante évolution. Parmi les "anciens" concepts on peut citer CORBA, COM+, Java RMI ou plus dernièrement les Web Services.&lt;br /&gt;
-.NET Remoting est une technologie intéressante pour les applications qui requièrent un couplage fort.C'est-à-dire pour des appels distants qui permettent de disposer de transactions, de levées d'exceptions, et autres principes applicatifs que l'on retrouve dans des développements non distribués, plus conventionnels. Avec le protocole TCP et une communication en binaire, le transport est également plus rapide.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
telecharger cet Article sou format Power point :&lt;a href="http://mohamed-zaki.110mb.com/projects/Remotingppt.zip"&gt; ICI&lt;/a&gt;&lt;br /&gt;
télécharger l'exemple illustratif: &lt;a href="http://mohamed-zaki.110mb.com/Exemple%20Remoting.zip"&gt;&lt;/a&gt;&lt;a href="http://mohamed-zaki.110mb.com/projects/ExempleRemoting.zip"&gt;ICI&lt;/a&gt;&lt;br /&gt;
&lt;div style="direction: ltr; margin-bottom: 0pt; margin-left: 0in; margin-top: 0pt; text-align: left; unicode-bidi: embed;"&gt;&lt;a href="http://mohamed-zaki.110mb.com/Exemple%20Remoting.zip"&gt;&lt;u&gt;&lt;span style="color: black; font-family: &amp;quot;; font-size: 18pt;"&gt; &lt;/span&gt;&lt;/u&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-5576752689974798206?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7iPwj9UKBTGLtjAa8MHDePshVYc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7iPwj9UKBTGLtjAa8MHDePshVYc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7iPwj9UKBTGLtjAa8MHDePshVYc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7iPwj9UKBTGLtjAa8MHDePshVYc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/DgsoAc704dc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/5576752689974798206/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=5576752689974798206" title="2 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/5576752689974798206?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/5576752689974798206?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/DgsoAc704dc/microsoft-net-remoting.html" title="Microsoft .net Remoting" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_-sLhPZBCjN0/S-0CMSuCSwI/AAAAAAAAAGs/FpQBd0We-AU/s72-c/img1.PNG" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2010/05/microsoft-net-remoting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEER3o5cSp7ImA9Wx5RFE0.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-2954129803765329758</id><published>2010-04-21T15:52:00.000+01:00</published><updated>2010-08-21T15:56:46.429+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-21T15:56:46.429+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="functional programming" /><category scheme="http://www.blogger.com/atom/ns#" term="ocaml" /><category scheme="http://www.blogger.com/atom/ns#" term="langage Caml" /><category scheme="http://www.blogger.com/atom/ns#" term="Caml" /><category scheme="http://www.blogger.com/atom/ns#" term="caml language" /><category scheme="http://www.blogger.com/atom/ns#" term="programmation fonctionnelle" /><title>Caml</title><content type="html">&lt;h1 class="firstHeading" id="firstHeading"&gt;Programmation fonctionnelle :&lt;br /&gt;
&lt;/h1&gt;La &lt;b&gt;programmation fonctionnelle&lt;/b&gt; est un paradigme de programmation qui considère le calcul en tant qu'évaluation de fonctions mathématiques et rejette le changement d'état et la mutation des données. Elle souligne l'application des fonctions, contrairement au modèle de programmation impérative qui met en avant les changements d'état&lt;sup class="reference" id="cite_ref-0"&gt;&lt;span class="cite_crochet"&gt;[&lt;/span&gt;1&lt;span class="cite_crochet"&gt;]&lt;/span&gt;&lt;/sup&gt;. &lt;br /&gt;
Un &lt;b&gt;langage fonctionnel&lt;/b&gt; est donc un langage de programmation dont la syntaxe et les caractéristiques encouragent la programmation fonctionnelle. Alors que l'origine de la programmation fonctionnelle peut être trouvée dans le lambda-calcul, le langage fonctionnel le plus ancien est Lisp, créé en 1958 par McCarthy. Lisp a donné naissance à des variantes telles que Scheme (1975) et Common Lisp (1984)&lt;sup class="reference" id="cite_ref-1"&gt;&lt;span class="cite_crochet"&gt;[&lt;/span&gt;2&lt;span class="cite_crochet"&gt;]&lt;/span&gt;&lt;/sup&gt;, qui comme Lisp ne sont pas ou peu typés. Des langages fonctionnels plus récents tels ML (1973), Haskell (1987), &lt;span class="mw-redirect"&gt;OCaml&lt;/span&gt;, Erlang, Clean et &lt;span class="mw-redirect"&gt;Oz&lt;/span&gt;, CDuce (2003) ou F# sont fortement typés.&lt;br /&gt;
&lt;h3&gt;&lt;span class="mw-headline" id="Programmation_fonctionnelle"&gt;Programmation fonctionnelle&lt;/span&gt;&lt;/h3&gt;La programmation fonctionnelle s'affranchit de façon radicale des effets secondaires en interdisant toute opération d'affectation. &lt;br /&gt;
Le paradigme fonctionnel n'utilise pas de machine d'états pour décrire un programme, mais un emboîtement de fonctions que l'on peut voir comme des « boîtes noires » que l'on peut imbriquer les unes dans les autres. Chaque boîte possédant plusieurs paramètres en entrée mais une seule sortie, elle ne peut sortir qu'une seule valeur possible pour chaque n-uplet de valeurs présentées en entrée. Ainsi, les fonctions n'introduisent pas d'effets de bord. Un programme est donc une application, au sens mathématique, qui ne donne qu'un seul résultat pour chaque ensemble de valeurs en entrée. Cette façon de penser, qui est très différente de la pensée habituelle en programmation impérative est l'une des causes principales de la difficulté qu'ont les programmeurs formés aux langages impératifs pour aborder la programmation fonctionnelle. Cependant, elle ne pose généralement pas de difficultés particulières aux débutants qui n'ont jamais été exposés à des langages impératifs. Un avantage important des fonctions sans effet de bord est la facilité que l'on a à les tester unitairement. Par ailleurs, l'usage généralisé d'une gestion de mémoire automatique par l'intermédiaire d'un ramasse-miettes (en anglais &lt;i&gt;&lt;span class="lang-en" lang="en"&gt;garbage collector&lt;/span&gt;&lt;/i&gt;) simplifie la tâche du programmeur.&lt;br /&gt;
En pratique, pour des raisons d'efficacité, et du fait que certains algorithmes s'expriment aisément avec une machine d'états, certains langages fonctionnels autorisent la programmation impérative en permettant de spécifier que certaines variables sont assignables (ou &lt;i&gt;mutables&lt;/i&gt; selon la dénomination habituelle), et donc la possibilité d'introduire localement des effets de bord. Ces langages sont regroupés sous le nom de &lt;i&gt;langages fonctionnels impurs&lt;/i&gt;.&lt;br /&gt;
Les langages dits &lt;i&gt;purement fonctionnels&lt;/i&gt; n'autorisent pas la programmation impérative. De fait, ils sont dénués d'effets de bord et protégés contre les problèmes que pose l'exécution concurrente. On peut voir par exemple ce qui a été fait dans le cadre du langage Erlang.&lt;br /&gt;
L'implémentation des langages fonctionnels fait un usage sophistiqué de la pile car afin de s'affranchir de la nécessité de stocker des données temporaires dans des tableaux ils font largement appel à la &lt;i&gt;récursivité&lt;/i&gt; (fait d'inclure l'appel d'une fonction dans sa propre définition). La récursivité peut être rendue plus efficace à l'aide d'une technique dénommée récursion terminale (en anglais &lt;i&gt;&lt;span class="lang-en" lang="en"&gt;tail-recursion&lt;/span&gt;&lt;/i&gt;), qui consiste à accumuler les résultats intermédiaires dans une case mémoire de la pile et à la passer en paramètre dans l'appel récursif. Ceci permet d'éviter d'empiler les appels récursifs dans la pile en les remplaçant par une simple succession de sauts. Le code généré par le compilateur est alors similaire à celui généré par une boucle en impératif. Certains langages comme Scheme, &lt;span class="mw-redirect"&gt;OCaml&lt;/span&gt; et &lt;span class="mw-redirect"&gt;Anubis&lt;/span&gt; optimisent automatiquement les appels récursifs de cette manière.&lt;br /&gt;
&lt;h1 class="firstHeading" id="firstHeading"&gt;le langage Caml:&lt;/h1&gt;Caml (originalement acronyme de &lt;b&gt;C&lt;/b&gt;ategorical &lt;b&gt;A&lt;/b&gt;bstract &lt;b&gt;M&lt;/b&gt;achine &lt;b&gt;L&lt;/b&gt;anguage) , (un jeu de mots sur  "La machine abstraite catégorique" et "ML" la famille des langages a laquelle il appartient .&lt;br /&gt;
&lt;br /&gt;
&lt;span class="medium_text" id="result_box"&gt;&lt;span style="background-color: white;" title="Caml has been designed and implemented in the Formel project at INRIA headed by Gérard Huet until 1994 and its development now continues in project Cristal ."&gt;Caml a été conçu et mis en œuvre dans le projet Formel à l'INRIA&lt;/span&gt;&lt;/span&gt; Dirigé par "Gerrard Huet" jusqu'au 1994 et maintenant  son developpement se poursuit dans le projet "Cristal".&lt;br /&gt;
&lt;span class="long_text" id="result_box"&gt;&lt;span style="background-color: white;" title="The Formel project became interrested in the ML language in 1980-81."&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="long_text" id="result_box"&gt;&lt;span style="background-color: white;" title="Like all descendants of ML, Caml is statically typed, strictly evaluated, and uses automatic memory management."&gt;Comme tous les descendants de ML, Caml est typé statiquement, rigoureusement évalués, et utilise la gestion automatique de la mémoire.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
la première implémentation de Caml en Lisp a été surnommée :&lt;span class="long_text" id="result_box"&gt;&lt;span style="background-color: white;" title="The first Caml implementation in Lisp was nicknamed &amp;quot;Heavy CAML&amp;quot; because of its memory and CPU requirements relative to its successor Caml Light which was implemented in C by Xavier Leroy and Damien Doligez."&gt;"Heavy CAML" en raison de ses  exigences Mémoire et CPU&lt;/span&gt;&lt;/span&gt; , par Rapport a son successeur "CAML Light" qui a été implémente en C par &lt;span class="long_text" id="result_box"&gt;&lt;span style="background-color: white;" title="The first Caml implementation in Lisp was nicknamed &amp;quot;Heavy CAML&amp;quot; because of its memory and CPU requirements relative to its successor Caml Light which was implemented in C by Xavier Leroy and Damien Doligez."&gt;"Xavier Leroy" et "&lt;/span&gt;&lt;/span&gt;&lt;span class="long_text" id="result_box"&gt;&lt;span style="background-color: white;" title="The first Caml implementation in Lisp was nicknamed &amp;quot;Heavy CAML&amp;quot; because of its memory and CPU requirements relative to its successor Caml Light which was implemented in C by Xavier Leroy and Damien Doligez."&gt; Damien Doligez" &lt;/span&gt;&lt;/span&gt;. en plus de sa réécriture complète "Caml Lihgt" a ajouter un puissant système de modules  pour le noyeau du langage .&lt;br /&gt;
&lt;br /&gt;
Actuellement l'implémentation principale de "Caml" est "Objective Caml", &lt;span class="long_text" id="result_box"&gt;&lt;span style="background-color: white;" title="Currently, the main implementation of Caml is Objective Caml, which adds many new features to the language including an object layer."&gt;qui ajoute de nombreuses nouvelles fonctionnalités pour les langues, y compris une couche objet.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Caractéristiques et fonctionnalités  du langage&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 100%;"&gt;Sûreté:&lt;/span&gt;&lt;/h2&gt;Le langage Caml est très sûr. Le compilateur fait de nombreuses vérifications avant la compilation des programmes. De nombreuses erreurs de programmation deviennent ainsi impossibles en Caml: confusions de types de données, accès erronés à l'intérieur des données par exemple. En effet, tous ces points sont vérifiés et gérés automatiquement par le compilateur, ce qui garantit l'intégrité parfaite des données manipulées par les programmes.  &lt;br /&gt;
Caml est typé statiquement, mais il est inutile d'ajouter des informations de type dans les programmes (comme en Ada, en Pascal ou en C): les annotations de typage sont automatiquement calculées par le compilateur.&lt;br /&gt;
&lt;span style="font-size: 100%; font-weight: bold;"&gt;Types de données:&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Il existe en Caml de nombreux types de données prédéfinis:&lt;br /&gt;
&lt;ul compact="compact"&gt;&lt;li&gt;types de base: entiers, flottants, booléens, caractères, chaînes de caractères.  &lt;/li&gt;
&lt;li&gt;types de données plus complexes: n-uplets, tableaux, listes, ensembles, tables de hachage, files, piles, flux de données. &lt;/li&gt;
&lt;/ul&gt;Au-delà de ces types prédéfinis, Caml propose de puissants moyens de définir de nouveaux types: types enregistrements, types énumérés, et types sommes généraux. Les types sommes sont une généralisation des types unions, à la fois simple, sûre et facile à maîtriser. Ils permettent la définition de types de données qui présentent des valeurs hétérogènes repérées par des &lt;i&gt;constructeurs de valeurs&lt;/i&gt;.&lt;br /&gt;
Au gré du programmeur, tous ces types sont définissables &lt;i&gt;concrètement&lt;/i&gt; (les constructeurs sont disponibles à l'extérieur du module) ou &lt;i&gt;abstraitement&lt;/i&gt; (l'implémentation est restreinte au module de définition et les constructeurs sont invisibles à l'extérieur).&lt;br /&gt;
Ce mécanisme autorise un contrôle fin du degré d'&lt;i&gt;encapsulation&lt;/i&gt; des données manipulées par les programmes, ce qui est indispensable pour la programmation à grande échelle.&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Fonctions&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 100%; font-weight: bold;"&gt;:&lt;br /&gt;
&lt;/span&gt;Caml est un langage de programmation fonctionnel: il n'y a pas de restriction à la définition et à l'usage des fonctions, qu'on peut librement passer en argument ou retourner en résultat dans les programmes.&lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Gestion mémoire automatisée et incrémentale:&lt;/span&gt;&lt;/h2&gt;Caml offre une gestion automatique de la mémoire: l'allocation et la libération des structures de données est implicite (il n'y a pas de primitives de manipulation explicite de la mémoire comme ``new'' ou ``free'' ou ``dispose''), et laissée à la charge du compilateur. On obtient ainsi une programmation bien plus sûre, puisqu'il n'y a jamais de corruption inattendue des structures de données manipulées.&lt;br /&gt;
De plus le gestionnaire mémoire opère en parallèle avec l'application, sans jamais l'arrêter de façon notable (récupération mémoire incrémentale).&lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Traits impératifs:&lt;/span&gt;&lt;/h2&gt;Caml offre la panoplie complète des traits de la programmation impérative, en particulier les tableaux modifiables en place, les boucles et les variables affectables, les enregistrements avec champs physiquement modifiables.&lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Compilateur rapide, code exécutable rapide:&lt;/span&gt;&lt;/h2&gt;Caml propose un compilateur de fichiers, et la compilation séparée est assurée par un système de modules. De surcroît, le compilateur Caml comporte une option qui maximise la vitesse de compilation, la portabilité des programmes obtenus, et minimise la taille des exécutables (compilation en code-octets).&lt;br /&gt;
Le compilateur d'Objective Caml comporte en plus une option ``optimisante'' qui privilégie la vitesse d'exécution (compilation en code natif): le compilateur optimisant d'Objective Caml produit des programmes dont la vitesse d'exécution est digne des meilleurs compilateurs disponibles actuellement.&lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Interactivité&lt;/span&gt;&lt;/h2&gt;Caml offre également un système interactif (une boucle de lecture-évaluation-impression des résultats), qui est très pratique pour apprendre le langage ou essayer et corriger ses programmes: il n'y a pas besoin d'utiliser forcément des fichiers, ni d'ajouter des ordres d'impression dans les programmes puisque les résultats sont imprimés automatiquement par le système interactif.&lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Forte capacité de traitement symbolique&lt;/span&gt;&lt;/h2&gt;Caml vous propose la ``programmation orientée par filtrage'': cette puissante méthode de programmation est une généralisation de l'analyse de cas traditionnelle qui est maintenant disponible pour tous les types de données du langage. Le mécanisme de filtrage est un moyen concis et élégant de ``tester et de nommer'' les données en une seule opération. Le compilateur Caml tire avantage de ce trait unique pour faire de nombreuses vérifications sémantiques sur le code qui lui est soumis: le &lt;i&gt;vérificateur de filtrage&lt;/i&gt; du compilateur est capable de détecter les branches inutiles des analyses de cas (``ce cas ne se présentera jamais à l'exécution'') et, plus étonnant encore, &lt;i&gt;de détecter les cas oubliés&lt;/i&gt; (``ce cas n'est pas envisagé par votre programme''). Ainsi, le vérificateur de filtrage met souvent le doigt sur de subtiles erreurs qui se glissent dans les programmes. De surcroît, le vérificateur de filtrage est capable d'&lt;i&gt;apporter la preuve&lt;/i&gt; de couverture exhaustive des cas des programmes qui utilisent le filtrage.&lt;br /&gt;
Le filtrage apporte un confort inégalé dans le traitement symbolique des données.&lt;br /&gt;
Le vérificateur de filtrage procure un niveau de sécurité dans la programmation et un degré de qualité inégalé des programmes qui manipulent des données symboliques.&lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Traitement des erreurs:&lt;/span&gt;&lt;/h2&gt;Caml possède un mécanisme général d'exceptions, pour traiter ou corriger les erreurs ou les situations exceptionnelles.&lt;br /&gt;
&lt;span style="font-size: 130%; font-weight: bold;"&gt;Mise au point des programmes&lt;/span&gt;  &lt;br /&gt;
Plusieurs méthodes de mise au point des programmes s'offrent à vous en Caml:  &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;le système interactif offre une méthode élémentaire mais très simple et rapide pour tester des (petites) fonctions: on vérifie simplement les résultats obtenus sur quelques exemples tapés directement dans la boucle d'interaction.   &lt;/li&gt;
&lt;li&gt;dans les cas plus complexes, le système interactif permet également à très peu de frais de suivre la progression des calculs avec le mécanisme de &lt;i&gt;trace des appels de fonctions&lt;/i&gt;.   &lt;/li&gt;
&lt;li&gt;enfin le &lt;i&gt;debogueur symbolique avec retour arrière&lt;/i&gt; permet de suivre très finement le déroulement de l'exécution, de l'arrêter à tout moment pour examiner l'état courant des variables et des fonctions en attente, et même de &lt;i&gt;revenir en arrière&lt;/i&gt; dans les calculs pour reprendre l'exécution au moment où un evênement intéressant se produit.  &lt;/li&gt;
&lt;/ul&gt;&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Polymorphisme&lt;/span&gt;&lt;/h2&gt;Caml est doté d'un puissant typage ``polymorphe'': certains types peuvent rester indéterminés, représentant alors ``n'importe quel type''.&lt;br /&gt;
Ainsi, les fonctions et procédures qui sont d'usage général  s'appliquent à n'importe quel type de données, sans exception (par exemple les routines de tri s'appliquent à tout type de tableaux).&lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Méthode d'évaluation&lt;/span&gt;&lt;/h2&gt;Caml est un langage ``strict'', par opposition aux langages paresseux. Cependant la pleine fonctionnalité permet de créer des suspensions et donc de coder l'évaluation paresseuse de données potentiellement infinies. &lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Programmation en vraie grandeur&lt;/span&gt;&lt;/h2&gt;Les programmes Caml sont formés d'unités de compilation que le compilateur compile séparément. Ces organisation est parfaitement compatible avec l'utilisation d'outils traditionnels de gestion de projets (comme l'utilitaire &lt;code&gt;make&lt;/code&gt; d'Unix). Le système de module du langage est puissant et sûr (toutes les interactions entre modules sont statiquement vérifiées par le contrôleur de types). Les modules d'Objective Caml peuvent comporter des sous-modules (à un degré d'emboîtement quelconque) et les fonctions des modules dans les modules sont autorisées (ce qui permet de définir des modules paramétrés par d'autres modules).  &lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Programmation orientée objets&lt;/span&gt;&lt;/h2&gt;Objective Caml propose des &lt;i&gt;objets&lt;/i&gt; qui permettent d'utiliser le style &lt;i&gt;orienté objets&lt;/i&gt; dans les programmes Caml. Fidèle à la philosohie du langage, cette extension orientée objets obéit au paradigme du ``typage fort'': en conséquence, aucune méthode ne peut être appliquée à un objet qui ne pourrait y «répondre» («les méthodes sont toujours bien comprises»). Encore une fois, cette vérification systématique du compilateur évite de nombreuses erreurs. Ceci offre au programmeur Caml, outre un confort insoupçonné dans l'écriture de ses programmes orientés objets, un niveau inégalé de qualité des programmes qu'il produit.&lt;br /&gt;
&lt;h2 align="LEFT"&gt;&lt;span style="font-size: 130%;"&gt;Puissantes bibliothèques&lt;/span&gt;&lt;/h2&gt;De nombreuses bibliothèques et contributions sont disponibles en Caml, en particulier des primitives de dessin indépendantes de la machine (libgraph), une arithmétique rationnelle exacte en multi-précision (camlnum), et de nombreuses interfaces avec des technologies bien connues: générateurs d'analyseurs lexicaux et syntaxiques avec &lt;code&gt;camllex&lt;/code&gt; et &lt;code&gt;camlyacc&lt;/code&gt;. Sous Unix, on dispose aussi d'un débogueur avec retour arrière, d'un navigateur dans les fichiers sources (&lt;code&gt;camlbrowser&lt;/code&gt;), d'une interface graphique à l'aide de Tk/Tcl &lt;code&gt;(camltk&lt;/code&gt;) et d'une interface poussée avec le système (&lt;code&gt;libunix&lt;/code&gt;).&lt;br /&gt;
&lt;h2&gt;&lt;span class="mw-headline" id="Examples"&gt;&lt;span style="font-size: 130%;"&gt;Examples de code:&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;1-&lt;span class="short_text" id="result_box"&gt;&lt;span style="background-color: white;" title="Factorial function (recursion and purely functional programming)"&gt;Fonction factorielle (récursivité et la programmation purement fonctionnel):&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="de1"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="kw1" style="font-weight: bold;"&gt;let&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="kw1" style="font-weight: bold;"&gt;rec&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; fact n &lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;=&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="kw1" style="font-weight: bold;"&gt;if&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; n&lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;=&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;0 &lt;/span&gt;&lt;span class="kw1" style="font-weight: bold;"&gt;then&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; 1 &lt;/span&gt;&lt;span class="kw1" style="font-weight: bold;"&gt;else&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; n &lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; fact&lt;/span&gt;&lt;span class="br0" style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;n&lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;1&lt;/span&gt;&lt;span class="br0" style="font-weight: bold;"&gt;)&lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;;;&lt;/span&gt;

2-&lt;span class="short_text" id="result_box"&gt;&lt;span style="background-color: white;" title="Numerical derivative (higher-order functions)"&gt;Dérivés numeriques (fonctions d'ordre supérieur)&lt;/span&gt;&lt;/span&gt;:
&lt;span class="long_text" id="result_box"&gt;&lt;span style="background-color: white;" title="As a functional programming language, it is easy to create and pass around functions in OCaml programs."&gt;en tant que langage de programmation fonctionnelle, il est facile de créer et passer autour
des fonctions dans les programmes OCaml.
&lt;/span&gt;&lt;span style="background-color: white;" title="This capability has an enormous number of applications."&gt;Cette capacité a un très grand nombre d'applications. &lt;/span&gt;&lt;span style="background-color: white;" title="Calculating the numerical derivative of a function is one such application."&gt;Calcul de la dérivée numérique
d'une fonction est une telle demande. &lt;/span&gt;&lt;span style="background-color: white;" title="The following Caml function &amp;quot;d&amp;quot; computes the numerical derivative of a given function &amp;quot;f&amp;quot; at a given point &amp;quot;x&amp;quot;:"&gt;La fonction Caml suivant:
"d" calcule la dérivée numérique d'une fonction donnée "f" à un moment donné "X":&lt;/span&gt;&lt;/span&gt;

&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="kw1" style="font-weight: bold;"&gt;let&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; d delta f x &lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;=&lt;/span&gt;
&lt;span style="font-weight: bold;"&gt;     &lt;/span&gt;&lt;span class="br0" style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;f &lt;/span&gt;&lt;span class="br0" style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;x &lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;+.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="me1" style="font-weight: bold;"&gt;delta&lt;/span&gt;&lt;span class="br0" style="font-weight: bold;"&gt;)&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;-.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="me1" style="font-weight: bold;"&gt;f&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="br0" style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;x &lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;-.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="me1" style="font-weight: bold;"&gt;delta&lt;/span&gt;&lt;span class="br0" style="font-weight: bold;"&gt;))&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;/.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="br0" style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;2&lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;*.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span class="me1" style="font-weight: bold;"&gt;delta&lt;/span&gt;&lt;span class="br0" style="font-weight: bold;"&gt;)&lt;/span&gt;&lt;span class="sy0" style="font-weight: bold;"&gt;;;&lt;/span&gt;

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-2954129803765329758?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5qM2jHmdtF6K-JBjIiBlqDmtfSk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5qM2jHmdtF6K-JBjIiBlqDmtfSk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5qM2jHmdtF6K-JBjIiBlqDmtfSk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5qM2jHmdtF6K-JBjIiBlqDmtfSk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/0bm3dFND3zg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/2954129803765329758/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=2954129803765329758" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/2954129803765329758?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/2954129803765329758?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/0bm3dFND3zg/caml.html" title="Caml" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2010/01/caml.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYGSXc6fip7ImA9Wx5RFE0.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-3355538088982916859</id><published>2010-01-18T15:19:00.010+01:00</published><updated>2010-08-21T15:48:48.916+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-21T15:48:48.916+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="dangling" /><category scheme="http://www.blogger.com/atom/ns#" term="dangling pointer problem" /><category scheme="http://www.blogger.com/atom/ns#" term="pointeur ballant" /><category scheme="http://www.blogger.com/atom/ns#" term="probleme pointeur" /><category scheme="http://www.blogger.com/atom/ns#" term="probleme ballant" /><category scheme="http://www.blogger.com/atom/ns#" term="dangling pointer" /><category scheme="http://www.blogger.com/atom/ns#" term="pointer dangling" /><category scheme="http://www.blogger.com/atom/ns#" term="pointer problem" /><category scheme="http://www.blogger.com/atom/ns#" term="pointeur dangling" /><category scheme="http://www.blogger.com/atom/ns#" term="ballant" /><category scheme="http://www.blogger.com/atom/ns#" term="dangling problem" /><title>dangling pointers(pointeurs ballants)</title><content type="html">&lt;span style="font-weight: bold;"&gt;dangling pointers&lt;/span&gt; en programmation sont des pointeurs qui ne pointent pas vers un objet valide du type approprié.ils sont survenus lorsque un objet est supprimé ou désalloué sans modifier la valeur des pointeurs qui pointent cet objet. alors que le pointeur pointe toujours vers l'emplacement mémoire désalloué. et le Système peut réaffecter l'espace mémoire  précedement liberer un a autre processus.&lt;br /&gt;
dans ce cas si le programme d'origine déreference le pointeur un comportement imprévisible peut se produire.&lt;br /&gt;
c'est le meme cas ou le programme ecrit les données dans la zone mémoire pointée par le &lt;span style="font-weight: bold;"&gt;dangling pointer&lt;/span&gt;,une corruption silencieuse des données non-liés peut se produire conduisant a des bogues subtiles extrêmement difficile à les détecter , des erruers de segmentation ou des defauts de protection générals(sous Windows).&lt;br /&gt;
Si les Données écrasées sont des données de compatibilité utilisé par allocataire mémoire du Système la corruption peut causer des instabilités de ce dernier.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Les Causes des dangling pointers&lt;/b&gt;:&lt;br /&gt;
dans beaucoup de languages de programmation(language C par exemple) la suppression d'un objet a partir de la mémoire de maniere explicite ou implicite ne modifie pas les pas les pointeurs associés.le pointeur point toujours vers le meme emplacement mémoire meme si la reference a été supprimé et peut etre maintenant utilisés par d'autres processus.&lt;br /&gt;
Exemple:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
char *dp=NULL;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt; /*...*/&lt;/code&gt;&lt;br /&gt;
&lt;code&gt; {&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;   char c; &lt;/code&gt;&lt;code&gt;/* c maintenant est hors porté */&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;   dp=&amp;amp;c; &lt;/code&gt;&lt;code&gt; /* dp est un dangling pointer */&lt;/code&gt;&lt;br /&gt;
&lt;code&gt; }     &lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;      &lt;br /&gt;
&lt;/code&gt;&lt;span style="font-weight: bold;"&gt;Resoudre le Probleme de Dangling pointer &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
une Solution pour resoudre ce qui précède est d'attribuer la valeur NULL a dp immédiatement avant que le bloc interne est quitté .&lt;br /&gt;
une autre solution serait de garantir que dp ne serait pas utilisé a nouveau sans initialisation supplementaire.&lt;br /&gt;
&lt;br /&gt;
-une autre source fréquente de ce probleme (&lt;span style="font-weight: bold;"&gt;dangling pointer&lt;/span&gt;s)est une combinaison confuse des appels malloc( ) et free( ) , un pointeur devient ballant lorseque le bloc mémoire pointé est libéré. une façon d'éviter cela est de s'assurer de réinitialiser le pointeur a NULL apres la liberation de sa reference.&lt;br /&gt;
Exemple:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
char *dp=malloc(A_const);&lt;br /&gt;
&lt;br /&gt;
/*........*/&lt;br /&gt;
&lt;br /&gt;
free(dp); /* il devient un pointeur ballant */&lt;br /&gt;
&lt;br /&gt;
dp=NULL ; /*maintenant il n'est plus ballant*/&lt;br /&gt;
&lt;br /&gt;
/*........*/&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-3355538088982916859?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YQvEYYD1Dm8lDl_nowlQ7s92zAA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YQvEYYD1Dm8lDl_nowlQ7s92zAA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YQvEYYD1Dm8lDl_nowlQ7s92zAA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YQvEYYD1Dm8lDl_nowlQ7s92zAA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/t8KHJz1hEHo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/3355538088982916859/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=3355538088982916859" title="1 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/3355538088982916859?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/3355538088982916859?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/t8KHJz1hEHo/dangling-pointerspointeurs-ballants.html" title="dangling pointers(pointeurs ballants)" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2010/01/dangling-pointerspointeurs-ballants.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08FRnw-fip7ImA9Wx5XFk4.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-6258394218302255265</id><published>2009-06-02T16:38:00.008+01:00</published><updated>2010-09-16T13:23:37.256+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-16T13:23:37.256+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="chat avec c#" /><category scheme="http://www.blogger.com/atom/ns#" term="messagerie avec c#" /><category scheme="http://www.blogger.com/atom/ns#" term="chat with c#" /><category scheme="http://www.blogger.com/atom/ns#" term="c# chat" /><category scheme="http://www.blogger.com/atom/ns#" term="client serveur c#" /><title>Chat client serveur avec c#</title><content type="html">voici une petite application  de &lt;span style="font-weight: bold;"&gt;chat client/ serveur avec c#&lt;/span&gt;&lt;br /&gt;l'application est très légère et ne contient pas beaucoup de code&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;serveur&lt;/span&gt;:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_-sLhPZBCjN0/SiVJswbKoAI/AAAAAAAAAEQ/-fNsMwP2H4w/s1600-h/server.PNG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" id="BLOGGER_PHOTO_ID_5342757566206877698" src="http://1.bp.blogspot.com/_-sLhPZBCjN0/SiVJswbKoAI/AAAAAAAAAEQ/-fNsMwP2H4w/s400/server.PNG" style="cursor: pointer; display: block; height: 294px; margin: 0px auto 10px; text-align: center; width: 400px;" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;client:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_-sLhPZBCjN0/SiVKPqaqhdI/AAAAAAAAAEY/lBnKbJmCjGw/s1600-h/client.PNG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" id="BLOGGER_PHOTO_ID_5342758165889582546" src="http://4.bp.blogspot.com/_-sLhPZBCjN0/SiVKPqaqhdI/AAAAAAAAAEY/lBnKbJmCjGw/s400/client.PNG" style="cursor: pointer; display: block; height: 288px; margin: 0px auto 10px; text-align: center; width: 400px;" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;j'ai pas pu maitre tous le code dans le blog mais vous vouvez le  &lt;a href="http://mohamed-zaki.110mb.com/projects/simple_chat.zip"&gt;telecharger  ici&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-6258394218302255265?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lQ-WvTvAeUuEVjocgQOLcJqDMnI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lQ-WvTvAeUuEVjocgQOLcJqDMnI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lQ-WvTvAeUuEVjocgQOLcJqDMnI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lQ-WvTvAeUuEVjocgQOLcJqDMnI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/QmaepBI59MU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/6258394218302255265/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=6258394218302255265" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/6258394218302255265?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/6258394218302255265?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/QmaepBI59MU/messagerie-instantanee-simple-avec-c.html" title="Chat client serveur avec c#" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_-sLhPZBCjN0/SiVJswbKoAI/AAAAAAAAAEQ/-fNsMwP2H4w/s72-c/server.PNG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2009/06/messagerie-instantanee-simple-avec-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4MQXwyfip7ImA9Wx9TGEg.&quot;"><id>tag:blogger.com,1999:blog-1056619483313691963.post-6866071829746742505</id><published>2009-02-05T18:12:00.023+01:00</published><updated>2010-11-27T12:56:20.296+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-27T12:56:20.296+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="analyseur langage programmation pascal c" /><category scheme="http://www.blogger.com/atom/ns#" term="c laxical analysiser" /><category scheme="http://www.blogger.com/atom/ns#" term="analyseur lexical pascal" /><category scheme="http://www.blogger.com/atom/ns#" term="analyseur lexical c" /><category scheme="http://www.blogger.com/atom/ns#" term="compilation" /><category scheme="http://www.blogger.com/atom/ns#" term="analyseur pascal C" /><category scheme="http://www.blogger.com/atom/ns#" term="analyseur pascal" /><category scheme="http://www.blogger.com/atom/ns#" term="TP compilation" /><category scheme="http://www.blogger.com/atom/ns#" term="analyseur C" /><title>analyseur lexical pascal (en c)</title><content type="html">&lt;a href="http://1.bp.blogspot.com/_-sLhPZBCjN0/SYsg8a8CdAI/AAAAAAAAADg/OasEVhAaCr8/s1600-h/comp.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5299365608926901250" src="http://1.bp.blogspot.com/_-sLhPZBCjN0/SYsg8a8CdAI/AAAAAAAAADg/OasEVhAaCr8/s400/comp.JPG" style="cursor: pointer; display: block; height: 201px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;Voici un Analyseur lexical pour les programmes en langage Pascal , il est programmé en C dans le Cadre d'un TP du module Compilation &lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: center;"&gt;&lt;/div&gt;&lt;div style="color: red; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&amp;nbsp;&lt;a href="http://www.ziddu.com/download/12690260/tp_comp.zip.html"&gt;Telecharger(avec le code source)&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;Probleme avec le lien ? telecharger le depuis &lt;a href="http://www.cppfrance.com/codes/ANALYSEUR-LEXICAL-LANGUAGE-PASCAL_49180.aspx"&gt;CPPfrance.com &lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1056619483313691963-6866071829746742505?l=ch-zaki.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LYuisMw8QvHV3dJhGUKcvR2ed5k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LYuisMw8QvHV3dJhGUKcvR2ed5k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LYuisMw8QvHV3dJhGUKcvR2ed5k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LYuisMw8QvHV3dJhGUKcvR2ed5k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/AeBT/~4/PQYJq4IwMMs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ch-zaki.blogspot.com/feeds/6866071829746742505/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1056619483313691963&amp;postID=6866071829746742505" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/6866071829746742505?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1056619483313691963/posts/default/6866071829746742505?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/AeBT/~3/PQYJq4IwMMs/analyseur-lexical-pascal-en-c.html" title="analyseur lexical pascal (en c)" /><author><name>Mohamed Zaki</name><uri>http://www.blogger.com/profile/07495319631668067383</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_-sLhPZBCjN0/SYsg8a8CdAI/AAAAAAAAADg/OasEVhAaCr8/s72-c/comp.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://ch-zaki.blogspot.com/2009/02/analyseur-lexical-pascal-en-c.html</feedburner:origLink></entry></feed>

