Cookie Consent by Free Privacy Policy Generator Polipone
<settembre 2026>
lunmarmergiovensabdom
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011
Per leggere un file di testo, una riga alla volta, il modo più semplice è usare l'oggetto StreamReader (del namespace System.IO)


        string nomeFile = @"c:\temp\file.txt";
        using (StreamReader sr = new StreamReader(nomeFile))
        {
            while (!sr.EndOfStream)
            {
                string myLine = sr.ReadLine();
            }
        }
Tutor On-Line
Ciao, sono il tuo Tutor on-line. Come posso aiutarti? 01:51

Notifiche