.NET http://blogs.ugidotnet.org/dotnet4ever/category/.NET.aspx Che altro dire: .NET! it-IT Michele Bernardi Subtext Version 2.6.0.0 Named Mutex: non mettete '\' nel nome! http://blogs.ugidotnet.org/dotnet4ever/archive/2011/06/12/named-mutex-non-mettete-nel-nome.aspx Non avevo mai usato un named Mutex, ma oggi ho bisogno di acquisire un Lock a livello di sistema e non solo interno al processo e ovviamente ci ho perso 1 ora per capirci qualcosa! In poche ed imprecise parole: se nel nome di un Mutex anteponete la stringa "Global\" il Mutex avrà validità contemporanea su tutte le sessioni Terminal Services, se mettete "Local\" o non mettete niente avrà effetto solo sulla sessione corrente. Dov'é il problema? Se voi mettete una stringa tipo "Global\MioPC\MiaRisorsa" o "Local\MioPC\MiaRisorsa" o "MioPC\MiaRisorsa" vi beccate una IOException non propriamente parlante ("La sintassi del nome del file, della directory o del volume non è corretta."). Soluzione: non usate il carattere '\' nel nome del vostro Mutex (sembra invece non dare problemi il carattere '/')!<img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/100126.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2011/06/12/named-mutex-non-mettete-nel-nome.aspx Sun, 12 Jun 2011 19:10:13 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2011/06/12/named-mutex-non-mettete-nel-nome.aspx#feedback http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/100126.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/100126.aspx Power Tools: Backup TFS http://blogs.ugidotnet.org/dotnet4ever/archive/2010/08/19/power-tools-backup-tfs.aspx <p>Per tutti quelli che non seguono il blog di <a href="http://blogs.msdn.com/b/bharry">Brian Harry</a>: dalla prossima versione dei Power Tools sarà disponibile una procedura di backup VERAMENTE ALLA PORTATA DI TUTTI! Soprattutto per chi ha installato la versione Basic, i piccoli team che si aspettano una procedura di backup semplificata.</p> <p>Maggiori informazioni (veramente dettagliate): <a href="http://blogs.msdn.com/b/bharry/archive/2010/08/18/backing-up-and-restoring-your-tfs-server.aspx">alla fonte</a>.</p><img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/99085.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2010/08/19/power-tools-backup-tfs.aspx Thu, 19 Aug 2010 10:03:00 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2010/08/19/power-tools-backup-tfs.aspx#feedback http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/99085.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/99085.aspx [TFS] TFSDeleteProject non (sempre) cancella tutto il progetto http://blogs.ugidotnet.org/dotnet4ever/archive/2009/01/21/tfs-tfsdeleteproject-non-sempre-cancella-tutto-il-progetto.aspx In TFS l'unico metodo per cancellare un progetto é tramite un tool a linea di comando: TFSDeleteProject. Alcune informazioni relative al progetto poterbbero però sopravvivere anche a questa operazione, in particolare:<br /> - Il TFSWarehouse non subirà alcuna modifica, i dati relativi al progetto rimarranno caricati. Per eliminare questi dati é necessario fare il rebuild del TFSwarehouse (vedi <a href="javascript:void(0);/*1232526226784*/">Setupwarehouse</a>)<br /> - Le cartelle dove viene fatto il drop delle build non vengono toccate<br /> - Metadati dei workitem condivisi tra più progetti<br /> - Shelveset che contengono file provenienti da un altro progetto<br /> <br /> Maggiori informazioni: <a href="javascript:void(0);/*1232526811884*/">qui</a><br /> Fonte: <a href="javascript:void(0);/*1232526793299*/">neno's blog</a><img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/95262.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2009/01/21/tfs-tfsdeleteproject-non-sempre-cancella-tutto-il-progetto.aspx Wed, 21 Jan 2009 10:33:54 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2009/01/21/tfs-tfsdeleteproject-non-sempre-cancella-tutto-il-progetto.aspx#feedback http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/95262.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/95262.aspx Process.Start e limiti sulla quantità di argomenti http://blogs.ugidotnet.org/dotnet4ever/archive/2008/07/23/process.start-e-limiti-sulla-quantit%25c3%25a0-di-argomenti.aspx <p>Lo so che é una cosa abbastanza inusuale avviare un processo con una stringa di comando (ampiamente) più lunga di 2000 caratteri, ma se dovesse servirvi sappiate un paio di cose:</p> <ol> <li>Su windows &lt;= windows 2000 (ok, dovrebbero essere un ricordo) il limite é sempre e comunque 260 caratteri, su windows &gt;= windows XP il limite teorico é di 32Kb</li> <li>Non usate <strong>Process.StartInfo.UseShellExecute</strong> = <em>true</em> (o gli overload <strong>Process.Start</strong>(<em>string, string</em>), ecc.)</li> </ol> <p>Impostando UseShellExecute = true (valore di default) riceverete una bella: "<font face="Arial"><em>System.ComponentModel.Win32Exception: Access Denied</em>"</font></p><img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/93512.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2008/07/23/process.start-e-limiti-sulla-quantit%25c3%25a0-di-argomenti.aspx Wed, 23 Jul 2008 17:19:55 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2008/07/23/process.start-e-limiti-sulla-quantit%25c3%25a0-di-argomenti.aspx#feedback http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/93512.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/93512.aspx Graphics.DrawImageUnscaled http://blogs.ugidotnet.org/dotnet4ever/archive/2008/07/20/graphics.drawimageunscaled.aspx Se dovesse capitarvi, come al sottoscritto, di scervellarvi per capire perché il metodo <font face="Arial"><em>DrawImageUnscaled</em> della classe <strong>Graphics</strong> vi stampa un'immagine che é tutt'altro che UNscaled la spiegazione sta nel fatto che l'immagine di origine e di destinazione hanno impostato dei differenti DPI... Al di là del fatto che mi sembrava molto più logico che usasse i pixel come unità di riferimento, la soluzione é usare il metodo DrawImage. Se anche voi come il sottoscritto temete un degrado di prestazioni vi rassicuro che potete dormire sonni tranquilli: DrawImageUnscaled internamente usa DrawImage (No Comment!).</font><img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/93473.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2008/07/20/graphics.drawimageunscaled.aspx Sun, 20 Jul 2008 17:31:20 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2008/07/20/graphics.drawimageunscaled.aspx#feedback http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/93473.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/93473.aspx Team System: data dei file http://blogs.ugidotnet.org/dotnet4ever/archive/2007/07/30/86989.aspx <P>Estraendo files da un server Team Foundation la data dei files presenti sul disco viene impostata alla data in cui questi sono stati estratti. Non che ci veda niente di strano, anzi... Purtroppo per&#242; numerose persone che erano abiuate ad usare Visual Source Safe sentono questo come un problema (non chiedetemi perch&#233;, ma vi garantisco che almeno una decina di persone me l'ha segnalato). </P> <P>Soluzione? Creare un programmino (console) che imposti la data dei file NON ESTRATTI in base alla data dell'ultimo checkin (scusate la lunghezza): </P> <P><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">static</SPAN> <SPAN style="COLOR: blue">void</SPAN> ChangeDate(<SPAN style="COLOR: blue">string</SPAN> ServerName, <SPAN style="COLOR: blue">string</SPAN> workspaceName, <SPAN style="COLOR: blue">string</SPAN> workspaceOwner, <SPAN style="COLOR: blue">string</SPAN> pattern, <SPAN style="COLOR: blue">bool</SPAN> subDirectories)<BR>{<BR>    <SPAN style="COLOR: #2b91af">TeamFoundationServer</SPAN> tfs = <SPAN style="COLOR: #2b91af">TeamFoundationServerFactory</SPAN>.GetServer(ServerName);<BR>    <SPAN style="COLOR: #2b91af">VersionControlServer</SPAN> vcs = (<SPAN style="COLOR: #2b91af">VersionControlServer</SPAN>)tfs.GetService(<SPAN style="COLOR: blue">typeof</SPAN>(<SPAN style="COLOR: #2b91af">VersionControlServer</SPAN>));<BR>    <SPAN style="COLOR: #2b91af">Workspace</SPAN> ws;<BR>    <SPAN style="COLOR: blue">if</SPAN> (<SPAN style="COLOR: blue">string</SPAN>.IsNullOrEmpty(workspaceOwner))<BR>        ws = <SPAN style="COLOR: #2b91af">WorkspaceSettings</SPAN>.GetWorkspace(vcs, workspaceName);<BR>    <SPAN style="COLOR: blue">else<BR></SPAN>        ws = <SPAN style="COLOR: #2b91af">WorkspaceSettings</SPAN>.GetWorkspace(vcs, workspaceName, workspaceOwner);<BR>    <SPAN style="COLOR: blue">if</SPAN> (ws == <SPAN style="COLOR: blue">null</SPAN>)<BR>        <SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">"Workspace specified doesn't exists."</SPAN>);<BR>    <SPAN style="COLOR: blue">else<BR></SPAN>    {<BR>        <SPAN style="COLOR: green">//Cerco la lista dei files specificati<BR></SPAN>        <SPAN style="COLOR: #2b91af">ItemSet</SPAN> items;<BR>        <SPAN style="COLOR: blue">if</SPAN> (subDirectories)<BR>            items = vcs.GetItems(pattern, <SPAN style="COLOR: #2b91af">RecursionType</SPAN>.Full);<BR>        <SPAN style="COLOR: blue">else<BR></SPAN>            items = vcs.GetItems(pattern, <SPAN style="COLOR: #2b91af">RecursionType</SPAN>.None);<BR>        <SPAN style="COLOR: green">//Controllo ogni singolo Item<BR></SPAN>        <SPAN style="COLOR: blue">foreach</SPAN> (<SPAN style="COLOR: #2b91af">Item</SPAN> item <SPAN style="COLOR: blue">in</SPAN> items.Items)<BR>        {<BR>            <SPAN style="COLOR: blue">if</SPAN> (ws.IsServerPathMapped(item.ServerItem))<BR>            {<BR>                <SPAN style="COLOR: green">//Trovo il file locale<BR></SPAN>                <SPAN style="COLOR: blue">string</SPAN> file = ws.GetLocalItemForServerItem(item.ServerItem);<BR>                System.IO.<SPAN style="COLOR: #2b91af">FileAttributes</SPAN> fileAttributes = System.IO.<SPAN style="COLOR: #2b91af">File</SPAN>.GetAttributes(file);<BR>                <SPAN style="COLOR: green">//Se il file &#233; readonly ri-applico la data altrimenti lo considero estratto e non gli cambio data<BR></SPAN>                <SPAN style="COLOR: blue">if</SPAN> ((fileAttributes & System.IO.<SPAN style="COLOR: #2b91af">FileAttributes</SPAN>.ReadOnly) == System.IO.<SPAN style="COLOR: #2b91af">FileAttributes</SPAN>.ReadOnly)<BR>                {<BR>                    <SPAN style="COLOR: green">//Per cambiare la data devo prima rimuovere l'attributo di readonly<BR></SPAN>                    System.IO.<SPAN style="COLOR: #2b91af">File</SPAN>.SetAttributes(file, fileAttributes & ~System.IO.<SPAN style="COLOR: #2b91af">FileAttributes</SPAN>.ReadOnly);<BR>                    System.IO.<SPAN style="COLOR: #2b91af">File</SPAN>.SetLastWriteTime(file, item.CheckinDate);<BR>                    System.IO.<SPAN style="COLOR: #2b91af">File</SPAN>.SetAttributes(file, fileAttributes);<BR>                    <SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(item.CheckinDate.ToString() + file);<BR>                }<BR>                <SPAN style="COLOR: blue">else<BR></SPAN>                    <SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">"checkedout "</SPAN> + file);<BR>                <SPAN style="COLOR: green">//Console.WriteLine(item.ServerItem + " is mapped as " + file.FullName);<BR></SPAN>            }<BR>            <SPAN style="COLOR: blue">else<BR></SPAN>                <SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(item.ServerItem + <SPAN style="COLOR: #a31515">" is not mapped"</SPAN>);<BR>        }<BR>        <SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">"Workspace's name is: "</SPAN> + ws.DisplayName);<BR>    }<BR>}</P><img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/86989.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2007/07/30/86989.aspx Mon, 30 Jul 2007 15:36:00 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2007/07/30/86989.aspx#feedback http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/86989.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/86989.aspx Team System: TeamFoundationServerFactory.GetServer accede al registry - LA SOLUZIONE http://blogs.ugidotnet.org/dotnet4ever/archive/2007/06/20/82877.aspx <P>Se cercate di creare un oggetto TeamFoundationServer da un thread che gira con un account utente che non ha le credenziali di scrittura sul registry incapperete nell'eccezione <EM>[SecurityException: Requested registry access is not allowed.]</EM> (<A href="http://blogs.ugidotnet.org/.net%20forever/archive/2007/06/19/82761.aspx">come gi&#224; descritto qui</A>).<BR>Grazie all'inossidabile <A href="http://blogs.ugidotnet.org/lbarbieri/">Lorenzo</A> ed ai suoi preziosi contatti ho trovato la <A href="http://www.developer.com/net/asp/article.php/10917_2245511_2">soluzione</A>.</P> <P>Sostanzialmente (se ho ben capito) se specifico un server nei metodi (ed i loro rispettivi overloads):<BR>TeamFoundationServerFactory.GetServer(serverName)<BR>new TeamFoundationServer(serverName)<BR>passando come parametro il SOLO NOME del server viene effettuato dapprima un accesso in lettura alla chiave:<BR><EM>HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\TeamFoundation\Servers</EM><BR>per verificare se esiste un server memorizzato con il nome passato, dappoi tenta l'accesso al server specificato sulla porta standard (8080). Verificata l'esistenza del server cerca di scrivere nella sopracitata chiave un valore. E qui casca TS: se il mio utente non ha il permesso di scrittura nella chiave tutto crasha (no, non ditemi "&#233; giusto cos&#236;": la verit&#224; &#233; che manca un bel try catch!).</P> <P>Workaround? Banalmente basta specificare l'URL completo del server: <A href="http://severName:8080">http://severName:8080</A><BR>Se poi avete esigenza di fare funzionare il tutto con ASP.NET ringraziando l'amico Luis di Lorenzo guardaveti <A href="http://blogs.msdn.com/narend/archive/2006/07/29/how-to-configure-wit-om-on-a-web-application.aspx">questa pagina</A>.</P> <P>Incrociare le dita... e che Dio ce la mandi buona!</P><img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/82877.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2007/06/20/82877.aspx Wed, 20 Jun 2007 18:48:00 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2007/06/20/82877.aspx#feedback http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/82877.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/82877.aspx Team System: TeamFoundationServerFactory.GetServer accede al registry http://blogs.ugidotnet.org/dotnet4ever/archive/2007/06/19/82761.aspx <P><FONT face=Tahoma>E se il mio utente non ha permesso di scrivere nel registry?!<BR></FONT><FONT face=Tahoma>Risposta:</FONT></P> <P>System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +48<BR>Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +2780921 <BR>Microsoft.TeamFoundation.Client.RegisteredServers.OpenCurrentUser(Boolean writable, Boolean shouldCreate) +50 <BR>Microsoft.TeamFoundation.Client.RegisteredServers.GetUriForServer(String serverName) +43 <BR>Microsoft.TeamFoundation.Client.TeamFoundationServer.GetUriForName(String name) +93 <BR>Microsoft.TeamFoundation.Client.TeamFoundationServer.get_Uri() +25 <BR>Microsoft.TeamFoundation.Client.CheckAuthenticationProxy..ctor(TeamFoundationServer server) +22 <BR>Microsoft.TeamFoundation.Client.TeamFoundationServer.Authenticate(Boolean useProvider, ICredentialsProvider provider) +58 <BR>Microsoft.TeamFoundation.Client.TeamFoundationServer.Authenticate() +17</P> <P><FONT face=Tahoma>E tutto questo per memorizzare l'elenco dei server conosciuti per l'utente... Direi che sono DISCRETAMENTE senza parole... </FONT><FONT face=Tahoma>alla faccia di sviluppare con zero privilegi!!! Francamente per quanto mi sforzi non riesco a trovare nessuna soluzione SPECIALMENTE perch&#233; la mia &#233; un'applicazione ASP.NET che dovrebbe girare con impersonation!!! :-S</FONT> </P> <P></P><img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/82761.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2007/06/19/82761.aspx Tue, 19 Jun 2007 19:29:00 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2007/06/19/82761.aspx#feedback 2 http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/82761.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/82761.aspx Aruba Free Hosting! http://blogs.ugidotnet.org/dotnet4ever/archive/2006/05/25/41597.aspx <P>Faccio un po' di publicit&#224; ad una contestatissima (anche se secondo me nemmeno troppo giustamente) societ&#224; di hosting italiano: su aruba &#233; possibile registrarsi per una "demo" di ASP.NET 2.0 con SQL Server 2005 (express). 100 Mb di spazio + 50 di DB + dominio di quarto livello...<BR>Provare per credere!!! <a title="" href="#" ><IMG src="http://messenger.msn.com/MMM2004-08-11_11.52/Resource/emoticons/wink_smile.gif" border=0></a></P> <P>Fonte: <A href="http://testdotnet.aruba.it/">http://testdotnet.aruba.it/</A></P><img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/41597.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2006/05/25/41597.aspx Thu, 25 May 2006 18:45:00 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2006/05/25/41597.aspx#feedback 4 http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/41597.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/41597.aspx Minimo comune multiplo in Visual Basic http://blogs.ugidotnet.org/dotnet4ever/archive/2006/03/06/36227.aspx <FONT face=Verdana size=2> <P>Dovesse servirvi...<BR>Eccolo:</P> <DIV style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: black 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; OVERFLOW: auto; BORDER-LEFT: black 1px solid; WIDTH: 690px; PADDING-TOP: 5px; BORDER-BOTTOM: black 1px solid; HEIGHT: 222px; BACKGROUND-COLOR: gainsboro">&nbsp;<SPAN style="FONT-SIZE: 10pt; COLOR: #008000; FONT-FAMILY: Courier New">'''&nbsp;-----------------------------------------------------------------------------<BR>&nbsp;'''&nbsp;&lt;summary&gt;<BR>&nbsp;'''&nbsp;Calcola&nbsp;il&nbsp;minimo&nbsp;comune&nbsp;multiplo<BR>&nbsp;'''&nbsp;&lt;/summary&gt;<BR>&nbsp;'''&nbsp;&lt;param&nbsp;name="num"&gt;Interi&nbsp;tra&nbsp;cui&nbsp;calcolare&nbsp;il&nbsp;mcm&lt;/param&gt;<BR>&nbsp;'''&nbsp;&lt;returns&gt;&lt;/returns&gt;<BR>&nbsp;'''&nbsp;&lt;remarks&gt;<BR>&nbsp;'''&nbsp;&lt;/remarks&gt;<BR>&nbsp;'''&nbsp;&lt;history&gt;<BR>&nbsp;'''&nbsp;&nbsp;&nbsp;[michele]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;08/02/2006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Created<BR>&nbsp;'''&nbsp;&lt;/history&gt;<BR>&nbsp;'''&nbsp;-----------------------------------------------------------------------------<BR>&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Public&nbsp;Overloads&nbsp;Shared&nbsp;Function&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">mcm(</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">ByVal&nbsp;ParamArray&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">num()&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">As&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">Int32)&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">As&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">Int32<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">If&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">num.Length&nbsp;=&nbsp;0&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">0<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">ElseIf&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">num.Length&nbsp;=&nbsp;1&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">num(1)<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">End&nbsp;If<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">mcm&nbsp;=&nbsp;num(0)<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">For&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">N&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">As&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">Int32&nbsp;=&nbsp;1&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">To&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">num.GetUpperBound(0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mcm&nbsp;=&nbsp;mcm(mcm,&nbsp;num(N))<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Next&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">N<BR>&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">End&nbsp;Function<BR><BR>&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #008000; FONT-FAMILY: Courier New">'''&nbsp;-----------------------------------------------------------------------------<BR>&nbsp;'''&nbsp;&lt;summary&gt;<BR>&nbsp;'''&nbsp;Calcola&nbsp;il&nbsp;minimo&nbsp;comune&nbsp;multiplo<BR>&nbsp;'''&nbsp;&lt;/summary&gt;<BR>&nbsp;'''&nbsp;&lt;param&nbsp;name="a"&gt;Primo&nbsp;intero&lt;/param&gt;<BR>&nbsp;'''&nbsp;&lt;param&nbsp;name="b"&gt;Secondo&nbsp;intero&lt;/param&gt;<BR>&nbsp;'''&nbsp;&lt;returns&gt;&lt;/returns&gt;<BR>&nbsp;'''&nbsp;&lt;remarks&gt;<BR>&nbsp;'''&nbsp;&lt;/remarks&gt;<BR>&nbsp;'''&nbsp;&lt;history&gt;<BR>&nbsp;'''&nbsp;&nbsp;&nbsp;[michele]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;08/02/2006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Created<BR>&nbsp;'''&nbsp;&lt;/history&gt;<BR>&nbsp;'''&nbsp;-----------------------------------------------------------------------------<BR>&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Public&nbsp;Overloads&nbsp;Shared&nbsp;Function&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">mcm(</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">ByVal&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">a&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">As&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">Int32,&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">ByVal&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">b&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">As&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">Int32)&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">As&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">Int32<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Dim&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">c&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">As&nbsp;Long&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">=&nbsp;a&nbsp;*&nbsp;b<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #008000; FONT-FAMILY: Courier New">'Dim&nbsp;r&nbsp;As&nbsp;Long<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">mcm&nbsp;=&nbsp;a&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Mod&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">b<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;=&nbsp;b<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b&nbsp;=&nbsp;mcm<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Loop&nbsp;While&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">mcm&nbsp;&lt;&gt;&nbsp;0<BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">Return&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Courier New">Convert.ToInt32(c&nbsp;\ a)<BR>&nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Courier New">End&nbsp;Function</DIV></SPAN> </FONT> <FONT face=Verdana size=2><P><A href="http://imhoproject.org/"><FONT face=Verdana size=1>powered by IMHO 1.3</FONT></A></P></FONT><!-- Powered by IMHO 1.3 (IT) Instant Blogger Copyright (c) 2005 A.Boschin - http://www.imhoproject.org --><img src="http://blogs.ugidotnet.org/dotnet4ever/aggbug/36227.aspx" width="1" height="1" /> Michele Bernardi http://blogs.ugidotnet.org/dotnet4ever/archive/2006/03/06/36227.aspx Mon, 06 Mar 2006 19:27:00 GMT http://blogs.ugidotnet.org/dotnet4ever/archive/2006/03/06/36227.aspx#feedback http://blogs.ugidotnet.org/dotnet4ever/comments/commentRss/36227.aspx http://blogs.ugidotnet.org/dotnet4ever/services/trackbacks/36227.aspx