SoFunction
Updated on 2025-03-07

c# Example method for simple reading of text


using System;
using ;
using ;
using ;
using ;

namespace StreamReadWrite
{
    class Program
    {
        static void Main(string[] args)
        {
            // Get the directories currently on the C drive.
            DirectoryInfo[] cDirs = new DirectoryInfo(@"e:\").GetDirectories();

            // Write each directory name to a file.
            using (StreamWriter sw = new StreamWriter(""))
            {
                foreach (DirectoryInfo dir in cDirs)
                {
                    ();

                }
            }

            // Read and show each line from the file.
            string line = "";
            using (StreamReader sr = new StreamReader(""))
            {
                while ((line = ()) != null)
                {
                    (line);
                }
            }
        }
    }
}