<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>C#</title>
        <link>http://blogs.ugidotnet.org/dottor/category/2098.aspx</link>
        <description>C#</description>
        <language>it-IT</language>
        <copyright>Andrea Dottor</copyright>
        <generator>Subtext Version 2.1.0.5</generator>
        <item>
            <title>Il mio primo TIP su xe.net</title>
            <link>http://blogs.ugidotnet.org/dottor/archive/2006/07/03/43990.aspx</link>
            <description>&lt;FONT face=Verdana size=2&gt;
&lt;P&gt;A questo indirizzo &lt;A href="http://www.xedotnet.org/blogs/articoli/blogarticles/textboxmode.aspx"&gt;http://www.xedotnet.org/blogs/articoli/blogarticles/textboxmode.aspx&lt;/A&gt; 
è stato pubblicato il mio primo TIP, dove spiego &lt;STRONG&gt;&lt;EM&gt;come ralizzare una 
Textbox in formato password che sia in grado di mantenere in viewstate il valore 
inputato anche attraverso diversi postback&lt;/EM&gt;&lt;/STRONG&gt;.&lt;BR&gt;Non immaginate 
quanto grande sia la mia soddisfazione nel vederlo pubblicato.&lt;BR&gt;Tranquilli che 
non mi fermerò a questo tip, anche perchè &lt;A title="" href="http://blog.boschin.it/" target="" name=""&gt;Andrea&lt;/A&gt;&amp;nbsp;mi ha fatto promettere che 
dovrò consegnargli un articoletto&amp;nbsp;veramente interessante su una WebPart che ho 
da poco realizzato. Ma non vi voglio anticipare niente.&lt;/P&gt;

&lt;/FONT&gt;&lt;!-- Powered by IMHO 1.3 (IT) Instant Blogger Copyright (c) 2005 A.Boschin - http://www.imhoproject.org --&gt;
&lt;img src="http://blogs.ugidotnet.org/dottor/aggbug/43990.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrea Dottor</dc:creator>
            <guid>http://blogs.ugidotnet.org/dottor/archive/2006/07/03/43990.aspx</guid>
            <pubDate>Mon, 03 Jul 2006 15:35:00 GMT</pubDate>
            <comments>http://blogs.ugidotnet.org/dottor/archive/2006/07/03/43990.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/dottor/comments/commentRss/43990.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Leggere un file inserito come Risorsa Embedded</title>
            <link>http://blogs.ugidotnet.org/dottor/archive/2006/06/29/43749.aspx</link>
            <description>&lt;P&gt;
&lt;FONT face=Verdana size=2&gt;Una feature che st&amp;#242; 
iniziando ad usare parecchio sono le risorce embedded, cio&amp;#232; la capacita di 
inserire file all'interno dei nostri assembly e di poterli tranquillamente 
leggere.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Per inserire un file e renderlo 
disponibile come risorsa embedded non dobbiamo far altro che dal Solution 
Explorer di Visual Studio, aggiungere il file interessato e nelle propriet&amp;#224; 
dello stesso, alla voce Build Action, selezionare "Embedded Resource" ed il 
gioco &amp;#232; fatto.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;Per leggere il file in questione, ecco una 
funzione, che grazie al namespace del file ci ritorna uno stringa con il 
contenuto del file.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;
&lt;DIV style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: black 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: black 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: gainsboro"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #808080; FONT-FAMILY: Courier New"&gt;/// &lt;summary&gt;&lt;BR&gt;/// &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #008000; FONT-FAMILY: Courier New"&gt;Funzione di letttura delle risorse embedded&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #808080; FONT-FAMILY: Courier New"&gt;/// &lt;/summary&gt;&lt;BR&gt;/// &lt;param name="resourceName"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #008000; FONT-FAMILY: Courier New"&gt;Nome della risorsa completo di tutto il NameSpace&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #808080; FONT-FAMILY: Courier New"&gt;&lt;/param&gt;&lt;BR&gt;/// &lt;returns&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #008000; FONT-FAMILY: Courier New"&gt;Testo contenuto nella risorsa&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #808080; FONT-FAMILY: Courier New"&gt;&lt;/returns&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;private string &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;GetFromResources(&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;string &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;resourceName)&lt;BR&gt;{&lt;BR&gt;    Assembly assem = &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;this&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;.GetType().Assembly;&lt;BR&gt;    &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;using &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;(Stream stream = assem.GetManifestResourceStream(resourceName))&lt;BR&gt;    {&lt;BR&gt;        &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;try&lt;BR&gt;        &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;{&lt;BR&gt;            &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;using &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;(StreamReader reader = &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;new &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;StreamReader(stream))&lt;BR&gt;            {&lt;BR&gt;                &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;return &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;reader.ReadToEnd();&lt;BR&gt;            }&lt;BR&gt;        }&lt;BR&gt;        &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;catch &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;(Exception e)&lt;BR&gt;        {&lt;BR&gt;            &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;throw new &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;Exception("&lt;FONT color=#bd425a&gt;Error retrieving from Resources. Tried '&lt;/FONT&gt;"&lt;BR&gt;                                     + resourceName + "&lt;FONT color=#bd425a&gt;'\r\n&lt;/FONT&gt;" + e.ToString());&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;}&lt;BR&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;Per leggere la nostra risorsa, esempio "&lt;FONT color=#0080ff&gt;Script.js&lt;/FONT&gt;" contenuta nel progetto "&lt;FONT color=#0080ff&gt;AndreaDottor.UI&lt;/FONT&gt;" nella cartella "&lt;FONT color=#0080ff&gt;Resources&lt;/FONT&gt;" ora non dobbiamo far altro che 
scrivere&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;DIV style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: black 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: black 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: gainsboro"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New"&gt;string &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New"&gt;scriptResource = GetFromResources("&lt;FONT color=#bd425a&gt;AndreaDottor.UI.Resources.Script.js&lt;/FONT&gt;")&lt;BR&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;Un 
vantaggio di tutto questo, &amp;#232; anche la possibilit&amp;#224; di accedervi 
facilmente tramite il namespace, quindi senza doversi pi&amp;#249; preoccupare di dove si 
sarebbero trovati determinati file (esempio Stylesheet, file di Javascript o 
quantaltro). &lt;IMG height=19 src="http://www.imhoproject.org/files/occhiolino.gif" width=19 align=absMiddle border=0&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;Fonte: &lt;A href="http://www.codeproject.com/csharp/embeddedresourcestrings.asp"&gt;http://www.codeproject.com/csharp/embeddedresourcestrings.asp&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;!-- Powered by IMHO 1.3 (IT) Instant Blogger Copyright (c) 2005 A.Boschin - http://www.imhoproject.org --&gt;
&lt;img src="http://blogs.ugidotnet.org/dottor/aggbug/43749.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Andrea Dottor</dc:creator>
            <guid>http://blogs.ugidotnet.org/dottor/archive/2006/06/29/43749.aspx</guid>
            <pubDate>Thu, 29 Jun 2006 15:03:00 GMT</pubDate>
            <comments>http://blogs.ugidotnet.org/dottor/archive/2006/06/29/43749.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.ugidotnet.org/dottor/comments/commentRss/43749.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>