Merhaba arkadaşlar bu yazımda sizlere asp.nette txt ye yazma ve okuma işleminden bahsetmek istiyorum Kodlar ekte vardır

 ********************Okuma Islemi************
     private List<string> txtOku()
        {
            string path = @”C:ProgramParmakBoyua.txt”;
            List<string> yaz = new List<string>();
            StreamReader oku = new StreamReader(path);
            string reader = oku.ReadLine();
            while (reader != null)
            {
                yaz.Add(reader);
                reader = oku.ReadLine();
            }
            oku.Close();
            return yaz;
        }

*******************  Yazma İşlemi ******************

 public void txtYaz(List<string> liste)
        {
            string path = @”C:ProgramParmakBoyua.arff “;
            // DosyaOlustur(path);
            FileStream mystream = new FileStream(path,
                FileMode.Append, FileAccess.Write);
            StreamWriter tw = new StreamWriter(mystream);
            int sayac = 0;
            liste.ForEach(x => x.Replace(‘,’, ‘.’));
            foreach (string item in liste)
            {
                sayac++;
                if (sayac == 3 || sayac == 6)
                {
                    tw.Write(item.Replace(‘,’, ‘.’) + “,”);
                }
                else if (sayac == 9)
                {
                    tw.Write(item);
                }
                else
                {
                    tw.Write(item + “,”);
                }
            }
            Random rand = new Random(2);
            tw.WriteLine(rand.Next(0, 1));
            tw.Close();
        }

******************** Oluşturma İşlemi***************
 string logFile = @”C:\ParmakBoyu”;
        private void CreateFolder()
        {

            bool isExists = System.IO.Directory.Exists(logFile);

            if (!isExists)
                System.IO.Directory.CreateDirectory(logFile);

        }

        public void DosyaOlustur(string path)
        {
            bool isExist = System.IO.Directory.Exists(path);
            if (!isExist)
            {
                System.IO.Directory.CreateDirectory(path);
                FileStream file;
                file = File.Create(path + “.txt”);
            }

        }

Ramazan CESUR…