Archivi

  • Chiamare un costruttore da un altro costruttore

    public FormNewArticolo(string id):this() { //blabla } public FormNewArticolo() { InitializeComponent(); dtCategorie = new DataTable(); dtSubCat = new DataTable(); dtCategorie.Columns.Add("Nome"); dtSubCat.Columns.Add("Nome"); dtSubCat.Columns.Add("Categoria"); }

    9 apr 2007, | Filed under C#
  • Andale Mono e Consolas download

    Since it took me a while to find these 2 fonts (which are very useful for coding), i’ve uploaded them both to rapidshare mirror. Link: http://rapidshare.com/files/24663204/DevFonts.rar

    6 apr 2007, | Filed under C#, Tips&Tricks
    Tags: ,
  • Use ListView Groups

    How To Group ListView Items listView1.Groups.Add(new ListViewGroup(“List item text”,HorizontalAlignment.Left)); listView1.Groups.Add(new ListViewGroup(“Bla”, HorizontalAlignment.Left)); listView1.Groups[1]. listView1.Items.Add(“Prova”); listView1.Items[listView1.Items.Count - 1].Group = listView1.Groups[0]; listView1.Items.Add(“Prova2″); listView1.Items[listView1.Items.Count - 1].Group = listView1.Groups[0]; listView1.Items.Add(“Prova3″); listView1.Items[listView1.Items.Count - 1].Group = listView1.Groups[1];

    6 apr 2007, | Filed under C#
  • Convertire i bytes in kb,mb,gb

    Piccola funzioncina x conversione dei byte che mi sono dovuto fare per 1 progetto. Funziona solo fino ai giga, per i terra aggiungete un paio di linee public string convertByteInOther(string stBytes) { string ris=”"; double bytes = Convert.ToInt32(stBytes); if (bytes < 1048576) ris = Convert.ToString(Math.Round(bytes / 1024, 2)) + ” Kb”; else if (bytes < [...]

    5 gen 2007, | Filed under C#
    Tags: ,
  • Analogo di explode in c#

    public WebPageInterrogater(string url, string sFilters) { _url = url; string[] filters = sFilters.Split(’;'); string pattern = string.Empty; for (int i = 0; i < filters.Length; i++ ) { pattern = "\\" + filters[i].Replace("*",string.Empty) + "$" + "|"; _filters += pattern; } _filters = _filters.Substring(0, _filters.Length-1); }

    5 gen 2007, | Filed under C#
  • Leggere dati da blob tramite select in firebird.

    Conversione da System.byte[] in string …. FbCommand cmd = new FbCommand(“select * from articoli order by nome asc”, db.GetConnection()); FbDataReader dr = cmd.ExecuteReader(); if (!dr.HasRows) return; while (dr.Read()) { byte[] bytes = (byte[])dr["descrizione"]; System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); string descrizione = enc.GetString(bytes); ….

    4 gen 2007, | Filed under C#
Archivio per la ‘C#’ Categoria