Text dosyası okuma

Listeye Dön

Açıklama

Bu kod seçilen text dosyasını satır satır okumaktadır.
C# SOURCE CODE
int counter = 0;
string line;

// Read the file and display it line by line.
System.IO.StreamReader file = 
   new System.IO.StreamReader("c:\\test.txt");
while((line = file.ReadLine()) != null)
{
   Console.WriteLine (line);
   counter++;
}

file.Close();
Çıktı
Kodu çalıştırmak için ▶ butonuna tıklayın.

Detaylı İnceleme