<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Le blog de Phoceis</title>
	<atom:link href="http://blog.phoceis.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.phoceis.com</link>
	<description>Zone d'expression des développeurs et webmarketeurs de la web-agency Phoceis</description>
	<pubDate>Tue, 28 Apr 2009 13:15:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Twipot.com : When Silverlight 3 and RIA Services meet Twitter</title>
		<link>http://blog.phoceis.com/2009/04/twipotcom-when-silverlight-3-and-ria-services-meet-twitter/</link>
		<comments>http://blog.phoceis.com/2009/04/twipotcom-when-silverlight-3-and-ria-services-meet-twitter/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 13:13:40 +0000</pubDate>
		<dc:creator>julien</dc:creator>
		
		<category><![CDATA[Silverlight]]></category>

		<category><![CDATA[ria services]]></category>

		<category><![CDATA[silverlight 3 beta]]></category>

		<category><![CDATA[social game]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/?p=62</guid>
		<description><![CDATA[As a showcase of Silverlight 3 Beta and RIA Services (both tehnologies have been previewed at the last MIX in Las Vegas), we would like to share with you Twipot.com.

Twipot.com is (for now) a simple Tetris game written in SL3, with a social dimensions : players can login using Twitter API. When signed in, their [...]]]></description>
			<content:encoded><![CDATA[<p>As a showcase of <a href="http://silverlight.net/GetStarted/silverlight3/default.aspx">Silverlight 3</a> Beta and <a href="http://blogs.msdn.com/dinesh.kulkarni/archive/2009/03/18/net-ria-services-is-now-public.aspx">RIA Services</a> (both tehnologies have been previewed at the last MIX in Las Vegas), we would like to share with you <a href="http://www.twipot.com">Twipot.com</a>.</p>
<p><a href="http://blog.phoceis.com/wp-content/uploads/2009/04/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://blog.phoceis.com/wp-content/uploads/2009/04/image-thumb.png" border="0" alt="image" width="404" height="468" /></a></p>
<p>Twipot.com is (for now) a simple Tetris game written in SL3, with a social dimensions : players can login using Twitter API. When signed in, their best score is saved and they can compare with their friends/followers or with the whole Twitter community.</p>
<p>To test it, you must install the Silverlight 3 beta plugin available for <a href="http://go.microsoft.com/fwlink/?LinkID=143433">Windows</a> and for <a href="http://go.microsoft.com/fwlink/?LinkID=143434">Mac</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2009/04/twipotcom-when-silverlight-3-and-ria-services-meet-twitter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Single Sign On with subdomains</title>
		<link>http://blog.phoceis.com/2009/01/single-sign-on-with-subdomains/</link>
		<comments>http://blog.phoceis.com/2009/01/single-sign-on-with-subdomains/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 15:35:55 +0000</pubDate>
		<dc:creator>julien</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[forms]]></category>

		<category><![CDATA[security]]></category>

		<category><![CDATA[sso]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/?p=57</guid>
		<description><![CDATA[Let’s say you want to authenticate on sub.domain.com a user previously logged on domain.com with ASP.NET 2.0 Forms authentication.
All you have to do is in the web.config file of the domain.com website add the attribute “domain” in the Forms tag, like this :
&#60;forms &#8230; domain=&#8221;.domain.com&#8221; /&#62;
]]></description>
			<content:encoded><![CDATA[<p>Let’s say you want to authenticate on sub.domain.com a user previously logged on domain.com with ASP.NET 2.0 Forms authentication.</p>
<p>All you have to do is in the web.config file of the domain.com website add the attribute “domain” in the Forms tag, like this :</p>
<p>&lt;forms &#8230; domain=&#8221;.domain.com&#8221; /&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2009/01/single-sign-on-with-subdomains/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rendre SIPS un peu plus sexy en .NET</title>
		<link>http://blog.phoceis.com/2008/12/rendre-sips-un-peu-plus-sexy-en-donet/</link>
		<comments>http://blog.phoceis.com/2008/12/rendre-sips-un-peu-plus-sexy-en-donet/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 13:28:24 +0000</pubDate>
		<dc:creator>julien</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[sips]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/?p=54</guid>
		<description><![CDATA[SIPS d&#8217;ATOS est la principale solution de paiement en France, proposée sous leur propre marque par de nombreuses banques (WebAffaires, E-Transactions, Sherlock, etc&#8230;).
Elle est toutefois ancienne et n&#8217;a pas évolué avec la demande pourtant toujours croissante des utilisateurs pour plus de convivialité. Notamment, elle nécessite l&#8217;affichage de plusieurs pages, là où l&#8217;on sait que chaque [...]]]></description>
			<content:encoded><![CDATA[<p>SIPS d&#8217;ATOS est la principale solution de paiement en France, proposée sous leur propre marque par de nombreuses banques (WebAffaires, E-Transactions, Sherlock, etc&#8230;).</p>
<p>Elle est toutefois ancienne et n&#8217;a pas évolué avec la demande pourtant toujours croissante des utilisateurs pour plus de convivialité. Notamment, elle nécessite l&#8217;affichage de plusieurs pages, là où l&#8217;on sait que chaque nouvelle page, chaque seconde perdue est un risque supplémentaire que l&#8217;utilisateur quitte le site sans passer à l&#8217;acte.</p>
<p>Nous avons donc essayé de nous affranchir pour le moins de la première page, celle du choix du moyen de paiement, ou tout du moins de l&#8217;intégrer mieux dans le processus d&#8217;achat via un affichage en Ajax (et donc un chargement de page en moins). Mais faire cela en .NET n&#8217;a pas été un chemin sans écueil.</p>
<p>Le résultat obtenu ressemblera à cela :</p>
<p><a href="http://blog.phoceis.com/wp-content/uploads/2008/12/image4.png"></a><a href="http://blog.phoceis.com/wp-content/uploads/2008/12/image5.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://blog.phoceis.com/wp-content/uploads/2008/12/image-thumb3.png" border="0" alt="image" width="404" height="249" /></a></p>
<p><span id="more-54"></span>Nous utilisons dans cet exemple les ASPXCallBack de <a href="http://www.devexpress.com" target="_blank">Devexpress</a>, mais cela reste tout à fait faisable avec des CallBack classiques.</p>
<p>Côté ASPX, vous devez disposer :</p>
<ul>
<li>d&#8217;un bouton déclenchant l&#8217;affichage de la popup</li>
<li>d&#8217;un ASPXCallback nommé cal_paiement</li>
<li>d&#8217;une popup nommée pop_paiement avec comme contenu un div &lt;div id=&#8221;div_paiement&#8221;&gt;&lt;/div&gt; pour l&#8217;instant vide</li>
</ul>
<p>Côté Code behind, une fonction permettant d&#8217;appeler la DLL de SIPS et renvoyer le code à afficher.</p>
<p>Le code sur le bouton est simple</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">cal_paiement.<span style="color: #660066;">SendCallback</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
pop_paiement.<span style="color: #660066;">Show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>Il déclenche le CallBack du CallBackPanel.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp csharp" style="font-family:monospace;"><span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">void</span> cba_paiement_Callback<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> source, DevExpress.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">ASPxCallback</span>.<span style="color: #0000FF;">CallbackEventArgs</span> e<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #FF0000;">string</span> pathfile <span style="color: #008000;">=</span> globals.<span style="color: #0000FF;">SIPS_Pathfile</span>;
        <span style="color: #FF0000;">string</span> request_exe <span style="color: #008000;">=</span> globals.<span style="color: #0000FF;">SIPS_Request_exe</span>;
        <span style="color: #FF0000;">string</span> amount <span style="color: #008000;">=</span> <span style="color: #FF0000;">1500</span>;
        <span style="color: #FF0000;">string</span> parm <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;merchant_id=&quot;</span> <span style="color: #008000;">+</span> globals.<span style="color: #0000FF;">SIPS_MerchantID</span>;
        parm <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot; merchant_country=fr&quot;</span>;
        parm <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot; amount=&quot;</span> <span style="color: #008000;">+</span> amount;
        parm <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot; currency_code=978&quot;</span>; <span style="color: #008080; font-style: italic;">//978 = EUR</span>
        parm <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot; caddie=1&quot;</span>;
        parm <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot; pathfile=&quot;</span> <span style="color: #008000;">+</span> pathfile;
        parm <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot; data=&quot;</span>;
        Execute transaction <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Execute<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
        transaction.<span style="color: #0000FF;">cmdLine</span> <span style="color: #008000;">=</span> request_exe;
        transaction.<span style="color: #0000FF;">parameters</span> <span style="color: #008000;">=</span> parm;
        <span style="color: #008080; font-style: italic;">// --Appel de l'activeX pour executer request</span>
        <span style="color: #FF0000;">string</span> result <span style="color: #008000;">=</span> transaction.<span style="color: #0000FF;">ExecuteApp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #008080; font-style: italic;">// --Sortie de la fonction executeApp() : !code!error!buffer!</span>
        <span style="color: #008080; font-style: italic;">// --- code=0: la fonction génère une page html contenue dans la variable buffer</span>
        <span style="color: #008080; font-style: italic;">// --- code=-1 : La fonction retourne un message d'erreur dans la variable error</span>
        <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> tableau <span style="color: #008000;">=</span> result.<span style="color: #0000FF;">Split</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">'!'</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #FF0000;">string</span> code <span style="color: #008000;">=</span> tableau<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#93;</span>;
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>code <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;0&quot;</span><span style="color: #000000;">&#41;</span>
            e.<span style="color: #0000FF;">Result</span> <span style="color: #008000;">=</span> tableau<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #000000;">&#93;</span>;
        <span style="color: #0600FF;">else</span>
            e.<span style="color: #0000FF;">Result</span> <span style="color: #008000;">=</span> tableau<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #000000;">&#93;</span>;
    <span style="color: #000000;">&#125;</span></pre></div></div>

<p>Le callBack renvoie dans e.Result le code html qui nous a été renvoyé par la DLL de SIPS. Nous pensions au début utiliser un UpdatePanel classique. Toutefois un problème s&#8217;est présenté. Le code retourné par la DLL est en fait un formulaire &#8220;&lt;FORM&gt;&lt;/FORM&gt;&#8221;. Or si l&#8217;on clique sur un des boutons (les logos CB) à l&#8217;intérieur de ce formulaire, l&#8217;action du formulaire principal de .NET (&lt;FORM runat=&#8221;server&#8221;&gt;) est exécuté, entraînant un rafraîchissement de la page au lieu de nous envoyer vers le serveur de paiement.</p>
<p>C&#8217;est pourquoi nous avons utilisé un CallBack, et sa fonctionnalité d&#8217;exécuter le javascript aprés que son CallBack ait été effectué. Le but va être de changer le &#8220;Action&#8221; du formulaire ASP.NET par l&#8217;adresse du formulaire de SIPS. Pour plus d&#8217;informations, voir <a href="http://www.cubiczone.com/Articles/tabid/65/EntryID/21/Default.aspx">cet article</a>.</p>
<p>Voilà donc le code pour l&#8217;évènement CallbackComplete de l&#8217;ASPXCallBackPanel</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">	<span style="color: #006600; font-style: italic;">//Displaying the SIPS form in our container layer</span>
	document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div_paiement'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span><span style="color: #339933;">=</span> e.<span style="color: #660066;">result</span>;
	<span style="color: #006600; font-style: italic;">// parsing code to get the &quot;action&quot; value.</span>
	<span style="color: #006600; font-style: italic;">// ok it is rough, will be tuned later on</span>
	<span style="color: #003366; font-weight: bold;">var</span> formAction <span style="color: #339933;">=</span> e.<span style="color: #660066;">result</span>.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">result</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ACTION='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #CC0000;">8</span><span style="color: #009900;">&#41;</span>;
	formAction <span style="color: #339933;">=</span> formAction.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span>0<span style="color: #339933;">,</span>formAction.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #006600; font-style: italic;">// changes the action value for the ASP.NET form tag</span>
	document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">action</span> <span style="color: #339933;">=</span> formAction;</pre></div></div>

<p>Remarques sur ce code : il conviendra, si l&#8217;utilisateur ferme la popup sans cliquer sur un logo de restaurer la valeur initiale de action pour le formulaire ASP.NET</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2008/12/rendre-sips-un-peu-plus-sexy-en-donet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Respecter la norme W3C avec ASP.net</title>
		<link>http://blog.phoceis.com/2008/12/respecter-la-norme-w3c-avec-aspnet/</link>
		<comments>http://blog.phoceis.com/2008/12/respecter-la-norme-w3c-avec-aspnet/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 08:07:52 +0000</pubDate>
		<dc:creator>florent</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/?p=41</guid>
		<description><![CDATA[Les pages .aspx générées par IIS ne respectent pas totalement la norme W3C.
Ce billet vous permettra d&#8217;obtenir une page aspx entièrement validée par le validateur W3C
Tout d&#8217;abord, je conseille fortement d&#8217;installer l&#8217;extension Firefox HTML Validator:

Ensuite, il faut définir le DTD (DocType qui définit les règles à respecter), les plus courament utilisés sont :
&#60;!DOCTYPE html PUBLIC [...]]]></description>
			<content:encoded><![CDATA[<p>Les pages .aspx générées par IIS ne respectent pas totalement la norme W3C.</p>
<p>Ce billet vous permettra d&#8217;obtenir une page aspx entièrement validée par le <a href="http://validator.w3.org/"></a><a href="http://validator.w3.org/" target="_blank">validateur W3C</a></p>
<p>Tout d&#8217;abord, je conseille fortement d&#8217;installer l&#8217;extension Firefox HTML Validator:</p>
<p><a href="http://blog.phoceis.com/wp-content/uploads/2008/12/post-1.jpg"><img class="alignnone size-full wp-image-42" src="http://blog.phoceis.com/wp-content/uploads/2008/12/post-1.jpg" alt="" width="333" height="124" /></a></p>
<p>Ensuite, il faut définir le DTD (DocType qui définit les règles à respecter), les plus courament utilisés sont :<br />
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
ou<br />
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&gt;<br />
<br />
Étant donné que ASP.net génère systématiquement un attribut &#8220;name&#8221; à la balise &#8220;form&#8221; (rumat=&#8217;server&#8217;) et que le DTD XHTML Strict ne reconnaît pas cet attribut pour les balises &#8220;form&#8221;,<br />
il est donc préférable de choisir le DTD Transitional qui est moins restrictif.</p>
<p>De plus, ASP.net génère des noms de variables javascript commançant par &#8220;__&#8221; (double underscore) alors que tous les noms de variables déclarées doivent commencer par une lettre.<br />
Par conséquent, des avertissements sont générés par HTML Validator:<br />
<a href="http://blog.phoceis.com/wp-content/uploads/2008/12/post-2.jpg"><img class="alignnone size-full wp-image-43" src="http://blog.phoceis.com/wp-content/uploads/2008/12/post-2.jpg" alt="" width="456" height="230" /></a></p>
<p>Une des solutions est de créer une classe PageBase dans le but de faire hériter toutes vos autres pages:<br />
public class PageBase : Page<br />
{<br />
protected override void Render(HtmlTextWriter writer)<br />
{<br />
System.IO.StringWriter stringWriter = new System.IO.StringWriter();<br />
HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);<br />
base.Render(htmlWriter);<br />
string html = stringWriter.ToString();<br />
html = html.Replace(&#8221;id=\&#8221;__EVENTTARGET\&#8221;", &#8220;id=\&#8221;EVENTTARGET\&#8221;");<br />
html = html.Replace(&#8221;id=\&#8221;__EVENTARGUMENT\&#8221;", &#8220;id=\&#8221;EVENTARGUMENT\&#8221;");<br />
html = html.Replace(&#8221;id=\&#8221;__LASTFOCUS\&#8221;", &#8220;id=\&#8221;LASTFOCUS\&#8221;");<br />
html = html.Replace(&#8221;id=\&#8221;__VIEWSTATE\&#8221;", &#8220;id=\&#8221;VIEWSTATE\&#8221;");<br />
writer.Write(html);<br />
}<br />
}</p>
<p>Après quelques ajustements de votre code HTML que vous pourrez faire en suivant les indications de HTML Validator, vous allez pouvoir valider votre page sur le site <a href="http://validator.w3.org/">http://validator.w3.org/</a> et obtenir le picto<br />
<a href="http://blog.phoceis.com/wp-content/uploads/2008/12/post-3.jpg"><img class="alignnone size-full wp-image-44" src="http://blog.phoceis.com/wp-content/uploads/2008/12/post-3.jpg" alt="" width="88" height="31" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2008/12/respecter-la-norme-w3c-avec-aspnet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>First look on Oxite (next part)</title>
		<link>http://blog.phoceis.com/2008/12/first-look-on-oxite-next-part/</link>
		<comments>http://blog.phoceis.com/2008/12/first-look-on-oxite-next-part/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 08:51:11 +0000</pubDate>
		<dc:creator>julien</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[oxite]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/?p=38</guid>
		<description><![CDATA[(This is the next part of this post, but in English because it may be interesting even for people who do not speak french)
2 - Administration Tab &#8220;tour&#8221;
Ok, hidden in the issue tracker page of the site, I finally manage to get the default admin password : it is &#8220;pa$$w0rd&#8221; (without the quotes).
Once logged in [...]]]></description>
			<content:encoded><![CDATA[<p>(This is the next part of <a href="http://blog.phoceis.com/2008/12/premier-regard-sur-oxite/">this post</a>, but in English because it may be interesting even for people who do not speak french)</p>
<h3>2 - Administration Tab &#8220;tour&#8221;</h3>
<p>Ok, <a href="http://www.codeplex.com/oxite/WorkItem/View.aspx?WorkItemId=6746">hidden</a> in the issue tracker page of the site, I finally manage to get the default admin password : it is &#8220;pa$$w0rd&#8221; (without the quotes).<br />
Once logged in as administrator, two links appear in the right sidebar : Create Post and Create Page</p>
<p><a href="http://blog.phoceis.com/wp-content/uploads/2008/12/image2.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.phoceis.com/wp-content/uploads/2008/12/image-thumb1.png" border="0" alt="image" width="404" height="186" /></a></p>
<p>So Oxite has a Page system. Pretty cool if you wish to use it as a CMS.</p>
<p>The new post page looks like this :</p>
<p><a href="http://blog.phoceis.com/wp-content/uploads/2008/12/image3.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.phoceis.com/wp-content/uploads/2008/12/image-thumb2.png" border="0" alt="image" width="404" height="172" /></a></p>
<p>I could find a way to edit page but no way to edit a post &#8230; strange. Moreover, there is no wysiwyg editor at this time.<br />
In the &#8220;About&#8221; page, the authors make it clear : this is just a sample program and not (yet ?) a real-life solution. For instance, to edit and post blogs, they use Windows Live Writer.</p>
<p>I hope this project will go forward and provide a fair alternative to platforms like wordpress, in the ASP.NET world. I will keep an eye on it and will post again here if I see more interesting things.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2008/12/first-look-on-oxite-next-part/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Premier regard sur Oxite</title>
		<link>http://blog.phoceis.com/2008/12/premier-regard-sur-oxite/</link>
		<comments>http://blog.phoceis.com/2008/12/premier-regard-sur-oxite/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 08:33:47 +0000</pubDate>
		<dc:creator>julien</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[oxite]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/?p=32</guid>
		<description><![CDATA[Microsoft a annoncé hier la sortie de Oxite, leur plate-forme open-source de blogging. Blog &#38; open-source, vous pensez immédiatement à Wordpress (ou DotClear), des frameworks open-source en php.
Pour Phoceis, c&#8217;est une grosse nouvelle puisque nous utilisions jusqu&#8217;à présent Wordpress pour nos clients, dans le cadre de la réalisation de blogs ou de sites relativement simples. [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft a <a href="http://www.readwriteweb.com/archives/microsoft_releases_open_source_blog_platform.php">annoncé</a> hier la sortie de <a href="http://visitmix.com/Lab/Oxite">Oxite</a>, leur plate-forme open-source de blogging. Blog &amp; open-source, vous pensez immédiatement à Wordpress (ou DotClear), des frameworks open-source en php.</p>
<p>Pour Phoceis, c&#8217;est une grosse nouvelle puisque nous utilisions jusqu&#8217;à présent Wordpress pour nos clients, dans le cadre de la réalisation de blogs ou de sites relativement simples. Vue notre expertise en .NET, l&#8217;arrivée d&#8217;Oxite pourrait peut-être changer la donne, à condition que ce dernier tienne la comparaison avec Wordpress. Je précise juste qu&#8217;Oxite est en version alpha, il faudra donc être indulgent et espérer qu&#8217;il saura fédérer une communauté de développeurs lui permettant d&#8217;atteindre le niveau de ses grands frères.</p>
<p>Dans la suite de ce billet, première prise en main, et premières impressions, sans filet.</p>
<h3>1. Téléchargement et ouverture du code source</h3>
<p>Le code source se télécharge depuis <a href="http://www.codeplex.com/oxite/Release/ProjectReleases.aspx?ReleaseId=20210">cette page</a>. Un code d&#8217;un peu plus d&#8217;un méga qui une fois dézippé se présente sous la forme d&#8217;un projet Visual Studio, doublé d&#8217;une version Visual Web Developper Express : une bonne idée pour que les développeurs ne possédant pas une licence Visual Studio puissent tout de même partcipier au projet avec cette version gratuite de l&#8217;outil. L&#8217;installation du <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A24D1E00-CD35-4F66-BAA0-2362BDDE0766&amp;displaylang=en">framework MVC</a> de Microsoft est également nécessaire (lien).</p>
<p>Une fois ouvert le projet se présente comme cela :</p>
<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.phoceis.com/wp-content/uploads/2008/12/image.png" border="0" alt="image" width="244" height="159" /></p>
<p>Note : L&#8217;ouverture du projet avec Visual Studio Professional entraîne une erreur puisque ce dernier le gère pas les fichiers dbproj.</p>
<p>Le projet compile correctement et la page d&#8217;accueil s&#8217;affiche correctement :</p>
<p><a href="http://blog.phoceis.com/wp-content/uploads/2008/12/image1.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.phoceis.com/wp-content/uploads/2008/12/image-thumb.png" border="0" alt="image" width="404" height="159" /></a></p>
<p>Et aprés &#8230; pour l&#8217;instant le néant car je n&#8217;ai pour l&#8217;instant pas trouvé le moyen d&#8217;accéder à l&#8217;admin &#8230; une version alpha de chez alpha donc &#8230; Dès que j&#8217;arrive à aller plus loin, je posterai un nouveau billet</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2008/12/premier-regard-sur-oxite/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Module URL Rewrite pour IIS7</title>
		<link>http://blog.phoceis.com/2008/12/module-url-rewrite-pour-iis7/</link>
		<comments>http://blog.phoceis.com/2008/12/module-url-rewrite-pour-iis7/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 16:13:54 +0000</pubDate>
		<dc:creator>florent</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/?p=24</guid>
		<description><![CDATA[Pendant la migration d&#8217;un site de II6 vers IIS7, je me suis aperçu que le module UrlRewritingNet ne fonctionnait plus correctement.
Heureusement, Microsoft a développé un module &#8220;URL rewrite&#8221; pour IIS7 (à télécharger ici) qui permet de générer des règles de réécriture simplement.

Il est également possible de tester les patterns directement.
Si vous utilisez de l&#8217;ajax dans [...]]]></description>
			<content:encoded><![CDATA[<p>Pendant la migration d&#8217;un site de II6 vers IIS7, je me suis aperçu que le module <a href="http://www.urlrewriting.net/149/en/home.html" target="_blank">UrlRewritingNet </a>ne fonctionnait plus correctement.</p>
<p>Heureusement, Microsoft a développé un module &#8220;URL rewrite&#8221; pour IIS7 <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=836778ea-b2f2-4907-b2dc-a152ec0a4bc4&amp;displaylang=en" target="_blank">(à télécharger ici</a>) qui permet de générer des règles de réécriture simplement.</p>
<p><a href="http://blog.phoceis.com/wp-content/uploads/2008/12/iis7.jpg"></a><a href="http://blog.phoceis.com/wp-content/uploads/2008/12/iis71.jpg"><img class="alignnone size-full wp-image-26" src="http://blog.phoceis.com/wp-content/uploads/2008/12/iis71.jpg" alt="" width="500" height="491" /></a></p>
<p>Il est également possible de tester les patterns directement.</p>
<p>Si vous utilisez de l&#8217;ajax dans vos pages, n&#8217;oublier pas de cocher la case &#8220;Stop processing of subsequent rules&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2008/12/module-url-rewrite-pour-iis7/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Consuming RSS feed in ASP.NET</title>
		<link>http://blog.phoceis.com/2008/12/consuming-rss-feed-in-aspnet/</link>
		<comments>http://blog.phoceis.com/2008/12/consuming-rss-feed-in-aspnet/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 14:26:45 +0000</pubDate>
		<dc:creator>julien</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[rss]]></category>

		<category><![CDATA[rsstoolkit]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/2008/12/consuming-rss-feed-in-aspnet/</guid>
		<description><![CDATA[Thanks to RSSToolKit, an open source component you can find at codeplex, consuming a RSS field to display, for instance, in your website has never been so easy.
Here is the code we use to display 3 posts of this blog on the official phoceis.com website (in a literal named lit_blog)

RssDocument rdoc = RssToolkit.Rss.RssDocument.Load&#40;new System.Uri&#40;&#34;http://blog.phoceis.com/feed/rss/&#34;&#41;&#41;;
DataView dv [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to RSSToolKit, an open source component you can find at <a href="http://www.codeplex.com/ASPNETRSSToolkit">codeplex</a>, consuming a RSS field to display, for instance, in your website has never been so easy.</p>
<p>Here is the code we use to display 3 posts of this blog on the official phoceis.com <a href="http://www.phoceis.com">website</a> (in a literal named lit_blog)</p>

<div class="wp_syntax"><div class="code"><pre class="csharp csharp" style="font-family:monospace;">RssDocument rdoc <span style="color: #008000;">=</span> RssToolkit.<span style="color: #0000FF;">Rss</span>.<span style="color: #0000FF;">RssDocument</span>.<span style="color: #0000FF;">Load</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">new</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Uri</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;http://blog.phoceis.com/feed/rss/&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
DataView dv <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>DataView<span style="color: #000000;">&#41;</span> rdoc.<span style="color: #0000FF;">SelectItems</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">3</span><span style="color: #000000;">&#41;</span>;
lit_blog.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;
&lt;ul&gt;&quot;</span>;
<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>DataRow dr <span style="color: #0600FF;">in</span> dv.<span style="color: #0000FF;">Table</span>.<span style="color: #0000FF;">Rows</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	lit_blog.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot;
	&lt;li&gt;&lt;a href='&quot;</span> <span style="color: #008000;">+</span> dr<span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;link&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;' target=&quot;</span>_blank<span style="color: #666666;">&quot;&gt;&quot;</span> <span style="color: #008000;">+</span> dr<span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;title&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;&lt;/a&gt;&lt;/li&gt;&quot;</span>;
<span style="color: #000000;">&#125;</span>
lit_blog.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot;&lt;/ul&gt;&quot;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2008/12/consuming-rss-feed-in-aspnet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>YouTube Chromeless player under Flex</title>
		<link>http://blog.phoceis.com/2008/11/youtube-chromeless-player-under-flex/</link>
		<comments>http://blog.phoceis.com/2008/11/youtube-chromeless-player-under-flex/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 09:07:58 +0000</pubDate>
		<dc:creator>julien</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[chromeless player]]></category>

		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/?p=15</guid>
		<description><![CDATA[Here is a code to show you how to integrate the YouTube Chromeless player with Flex. This work is based on the sample shown at this page http://code.google.com/apis/youtube/articles/youtube_as3_chromeless.html.


You can download the source code of this file here.
Please note : to get this to work, you may serve the bin-release/index.htm through a webserver (IIS, Apache, whatever [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a code to show you how to integrate the YouTube Chromeless player with Flex. This work is based on the sample shown at this page <a href="http://code.google.com/apis/youtube/articles/youtube_as3_chromeless.html">http://code.google.com/apis/youtube/articles/youtube_as3_chromeless.html</a>.</p>
<p><a href="http://blog.phoceis.com/wp-content/uploads/2008/11/moz-screenshot-103.jpg"><img src="http://blog.phoceis.com/wp-content/uploads/2008/11/moz-screenshot-103-300x255.jpg" alt="" title="moz-screenshot-103" width="300" height="255" class="alignnone size-medium wp-image-14" /></a></p>
<p>
You can download the source code of this file <a href="http://blog.phoceis.com/uploads/kidtube.rar">here</a>.<br />
Please note : to get this to work, you may serve the bin-release/index.htm through a webserver (IIS, Apache, whatever &#8230;)
</p>
<p>Here is the mxml file of the project</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;absolute&quot;</span> <span style="color: #000066;">creationComplete</span>=<span style="color: #ff0000;">&quot;init()&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;660&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;580&quot;</span> <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">			import mx.controls.Alert;</span>
<span style="color: #339933;">			import flash.sampler.NewObjectSample;</span>
&nbsp;
<span style="color: #339933;">			import flash.display.*;</span>
<span style="color: #339933;">			import flash.events.*;</span>
<span style="color: #339933;">			import flash.text.*;</span>
<span style="color: #339933;">			import timber.demo.*;</span>
<span style="color: #339933;">			import choppingblock.video.*;</span>
&nbsp;
<span style="color: #339933;">			private var _youTubeLoader:YouTubeLoader;</span>
<span style="color: #339933;">			private var _timer:Timer;</span>
<span style="color: #339933;">			private var _draggingSeeker:Boolean = false;</span>
<span style="color: #339933;">			function init():void {</span>
<span style="color: #339933;">				_youTubeLoader = new YouTubeLoader(); </span>
<span style="color: #339933;">				_youTubeLoader.addEventListener(YouTubeLoaderEvent.LOADED, youTubePlayerLoadedHandler, false, 0, true);</span>
<span style="color: #339933;">				_youTubeLoader.addEventListener(YouTubeLoaderEvent.STATE_CHANGE, youTubePlayerStateChangeHandler, false, 0, true);</span>
<span style="color: #339933;">				_youTubeLoader.create();</span>
<span style="color: #339933;">				_youTubeLoader.x = 5;</span>
<span style="color: #339933;">				_youTubeLoader.y = 5 ;</span>
<span style="color: #339933;">				mainUI.addChild(_youTubeLoader);</span>
<span style="color: #339933;">				_timer = new Timer(500);</span>
<span style="color: #339933;">				_timer.addEventListener(TimerEvent.TIMER,timerTick);</span>
<span style="color: #339933;">			}</span>
&nbsp;
<span style="color: #339933;">			private function youTubePlayerLoadedHandler (event:YouTubeLoaderEvent):void{</span>
<span style="color: #339933;">				_youTubeLoader.loadVideoById(&quot;SQ1ys3MxaEM&quot;);</span>
&nbsp;
<span style="color: #339933;">			};</span>
&nbsp;
<span style="color: #339933;">			private function youTubePlayerStateChangeHandler (event:YouTubeLoaderEvent):void{</span>
<span style="color: #339933;">			if (event.state==&quot;playing&quot;) {</span>
<span style="color: #339933;">				sli_seek.visible = true;</span>
<span style="color: #339933;">				sli_seek.minimum = 0;</span>
<span style="color: #339933;">				sli_seek.maximum = _youTubeLoader.getDuration();</span>
<span style="color: #339933;">				sli_seek.value=0;</span>
<span style="color: #339933;">				btn_pause.visible=true;				</span>
<span style="color: #339933;">				_timer.start();</span>
<span style="color: #339933;">			}</span>
<span style="color: #339933;">			};</span>
&nbsp;
<span style="color: #339933;">			private function timerTick(event:TimerEvent):void {</span>
<span style="color: #339933;">				if (!_draggingSeeker) {</span>
<span style="color: #339933;">				sli_seek.value = _youTubeLoader.getCurrentTime();</span>
<span style="color: #339933;">				}				</span>
<span style="color: #339933;">			}</span>
&nbsp;
<span style="color: #339933;">			private function seekChanged():void {</span>
<span style="color: #339933;">				_youTubeLoader.seekTo(sli_seek.value);</span>
<span style="color: #339933;">			}</span>
&nbsp;
<span style="color: #339933;">		]]&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:UIComponent</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;mainUI&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:UIComponent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:HSlider</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sli_seek&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;150&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;485&quot;</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;490&quot;</span> <span style="color: #000066;">change</span>=<span style="color: #ff0000;">&quot;seekChanged()&quot;</span> <span style="color: #000066;">thumbDrag</span>=<span style="color: #ff0000;">&quot;_draggingSeeker=true;&quot;</span> <span style="color: #000066;">thumbRelease</span>=<span style="color: #ff0000;">&quot;_draggingSeeker=false;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:HSlider<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;btn_play&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;490&quot;</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">              		<span style="color: #000066;">useHandCursor</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;">              	<span style="color: #000066;">overSkin</span>=<span style="color: #ff0000;">&quot;@Embed(source='../assets/playpause.swf', symbol='play_over')&quot;</span></span>
<span style="color: #009900;">     			<span style="color: #000066;">upSkin</span>=<span style="color: #ff0000;">&quot;@Embed(source='../assets/playpause.swf', symbol='play_up')&quot;</span> </span>
<span style="color: #009900;">     			<span style="color: #000066;">downSkin</span>=<span style="color: #ff0000;">&quot;@Embed(source='../assets/playpause.swf', symbol='play_down')&quot;</span>            	</span>
<span style="color: #009900;">              	<span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;_youTubeLoader.play();btn_pause.visible=true;btn_play.visible=false;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;btn_pause&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;490&quot;</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #009900;">              		<span style="color: #000066;">useHandCursor</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;">              	<span style="color: #000066;">overSkin</span>=<span style="color: #ff0000;">&quot;@Embed(source='../assets/playpause.swf', symbol='pause_over')&quot;</span></span>
<span style="color: #009900;">     			<span style="color: #000066;">upSkin</span>=<span style="color: #ff0000;">&quot;@Embed(source='../assets/playpause.swf', symbol='pause_up')&quot;</span> </span>
<span style="color: #009900;">     			<span style="color: #000066;">downSkin</span>=<span style="color: #ff0000;">&quot;@Embed(source='../assets/playpause.swf', symbol='pause_down')&quot;</span>            	</span>
<span style="color: #009900;">              	<span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;_youTubeLoader.pause();btn_play.visible=true;btn_pause.visible=false;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>              	
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2008/11/youtube-chromeless-player-under-flex/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Grab a file from the web and store it in your database using c#</title>
		<link>http://blog.phoceis.com/2008/11/grab-a-file-from-the-web-and-store-it-in-your-database-using-c/</link>
		<comments>http://blog.phoceis.com/2008/11/grab-a-file-from-the-web-and-store-it-in-your-database-using-c/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 15:26:27 +0000</pubDate>
		<dc:creator>julien</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[csharp]]></category>

		<category><![CDATA[linq]]></category>

		<guid isPermaLink="false">http://blog.phoceis.com/?p=10</guid>
		<description><![CDATA[If you want to download a file from the web and store it directly in a kind of blob field in your database

string url = &#34;the url of the file you want to download&#34;;
byte&#91;&#93; b;
HttpWebRequest myReq = &#40;HttpWebRequest&#41;WebRequest.Create&#40;url&#41;;
WebResponse myResp = myReq.GetResponse&#40;&#41;;
Stream stream = myResp.GetResponseStream&#40;&#41;;
using &#40;BinaryReader br = new BinaryReader&#40;stream&#41;&#41;
&#123;
	b = br.ReadBytes&#40;&#40;int&#41;stream.Length&#41;;
     [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to download a file from the web and store it directly in a kind of blob field in your database</p>

<div class="wp_syntax"><div class="code"><pre class="csharp csharp" style="font-family:monospace;"><span style="color: #FF0000;">string</span> url <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;the url of the file you want to download&quot;</span>;
<span style="color: #FF0000;">byte</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> b;
HttpWebRequest myReq <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>HttpWebRequest<span style="color: #000000;">&#41;</span>WebRequest.<span style="color: #0000FF;">Create</span><span style="color: #000000;">&#40;</span>url<span style="color: #000000;">&#41;</span>;
WebResponse myResp <span style="color: #008000;">=</span> myReq.<span style="color: #0000FF;">GetResponse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
Stream stream <span style="color: #008000;">=</span> myResp.<span style="color: #0000FF;">GetResponseStream</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">&#40;</span>BinaryReader br <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> BinaryReader<span style="color: #000000;">&#40;</span>stream<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	b <span style="color: #008000;">=</span> br.<span style="color: #0000FF;">ReadBytes</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span><span style="color: #000000;">&#41;</span>stream.<span style="color: #0000FF;">Length</span><span style="color: #000000;">&#41;</span>;
        br.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
myResp.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #008080; font-style: italic;">// say we have a LINQ datacontext named &quot;context&quot;, an entity video with a varbinary(max) </span>
<span style="color: #008080; font-style: italic;">// field named preview to store the content of the file (for instance a picture)</span>
video vid <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> video<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
vid.<span style="color: #0000FF;">preview</span> <span style="color: #008000;">=</span> b;
context.<span style="color: #0000FF;">videos</span>.<span style="color: #0000FF;">InsertOnSubmit</span><span style="color: #000000;">&#40;</span>vid<span style="color: #000000;">&#41;</span>;
context.<span style="color: #0000FF;">SubmitChanges</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.phoceis.com/2008/11/grab-a-file-from-the-web-and-store-it-in-your-database-using-c/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
