Text dosyası oluşturma ve bilgi ekleme C# Console Aşağıdaki kodlar c dizinine gorselprogramlama.txt dosyası oluşturur ve belirtilen bilgileri içerisine yazar.
[code lang=”csharp”]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace text_dosya_olustur_ve_yazi_ekle
{
class Program
{
static void Main(string[] args)
{
TextWriter dosya = new StreamWriter(@"C:\gorselprogramlama.txt");
try
{
dosya.WriteLine("Ali Duran ");
dosya.WriteLine("Sema Şahin");
dosya.WriteLine("Kemal Kaya");
}
finally
{
dosya.Flush();
dosya.Close();
}
}
}
}
[/code]
yola erişim reddedildi hatası