You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
814 B
C#
26 lines
814 B
C#
5 years ago
|
/*
|
||
|
* C# Program to Use StreamReader to Read Entire Line
|
||
|
*/
|
||
|
using System;
|
||
|
using System.IO;
|
||
|
using System.IO.Compression;
|
||
|
using System.Text;
|
||
|
public sealed class Program
|
||
|
{
|
||
|
public static void Main()
|
||
|
{
|
||
|
Stream s = new FileStream(@"c:\sri\srip.txt", FileMode.Open);
|
||
|
using (StreamReader sr = new StreamReader(s, Encoding.UTF8))
|
||
|
{
|
||
|
string line;
|
||
|
while ((line = sr.ReadLine()) != null)
|
||
|
{
|
||
|
Console.WriteLine(line);
|
||
|
}
|
||
|
Console.ReadLine();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
StreamWriter writes text files. It enables easy and efficient text output. It is best placed in a using-statement to ensure it is removed from memory when no longer needed. It provides several constructors and many methods.
|