using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
Console.Write("filename = ");
string filename = Console.ReadLine();
if (File.Exists(filename))
{
FileStream fp = new FileStream(filename, FileMode.Open);
StreamReader reader = new StreamReader(fp);
int data;
while ((data = reader.Read()) != -1)
{
Console.Write((char)data);
System.Threading.Thread.Sleep(50);
}
reader.Close();
fp.Close();
}
else
Console.WriteLine("file is not found!");
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
Console.Write("filename = ");
string filename = Console.ReadLine();
if (File.Exists(filename))
{
FileStream fp = new FileStream(filename, FileMode.Open);
StreamReader reader = new StreamReader(fp);
int data;
while ((data = reader.Read()) != -1)
{
Console.Write((char)data);
System.Threading.Thread.Sleep(50);
}
reader.Close();
fp.Close();
}
else
Console.WriteLine("file is not found!");
}
}
}
No comments:
Post a Comment