settembre 2007 Blog Posts

Script NSIS: salviamo la posizione delle icone del desktop

Leggendo questo articolo su come poter salvare la posizione delle icone del desktop mi sono detto: dai proviamo a fare un setup con NSIS tanto per fare un po di esperienza su questo stupendo tool di creazione setup. Downloads: Setup "MemIcons.exe" ...

posted @ venerdì 21 settembre 2007 23:31 | Feedback (0)

System.Security.SecureString: una string super sicura

Ne ignoravo l'esistenza, adesso che mi sono informato, provato e letto, posto per ricordarmi questa classe e segnalarla a chi non la conoscesse. Eccone una breve descrizione: The contents of SecureString is protected by DPAPI ( Data Protection API ), which means it's contents is encrypted all the time.  It is also pinned in memory, which means the .NET Framework doesn't move it around.  It is also mutable, which means 1) it can be cleared and 2) passing it around the framework doesn't cause several copies of the sensitive information to be floating around. Sweet idea. Un esempio di utilizzo: . ...

posted @ venerdì 7 settembre 2007 10:06 | Feedback (1)

Da MemoryStream a String e viceversa

Utili istruzioni che mi appunto per non doverle cercare sempre: . 1: // da Stream a String 2: byte[] b = MioMemoryStream.ToArray(); 3: string s = Encoding.UTF8.GetString(b); 4:   5: // da String a Stream 6: string s = "asdasdasd"; 7: byte[] b = Encoding.UTF8.GetBytes(s); 8: MemoryStream ms = new MemoryStream(b);

posted @ sabato 1 settembre 2007 12:29 | Feedback (0)