this is an example of stream reader in c# programming :
using System;
using System.Collections.Generic;
using System.IO;
class Program
{
static void Main()
{
//
// Read in a file line-by-line, and store it all in a List.
//
Listlist = new List ();
using (StreamReader reader = new StreamReader("file.txt"))
{
string line;
while ((line = reader.ReadLine()) != null)
{
list.Add(line); // Add to list.
Console.WriteLine(line); // Write to console.
}
}
}
}
for more detail about it....you can see in this link is http://dotnetperls.com/Content/Using-Keyword-StreamReader.aspx
^_^

No comments:
Post a Comment