using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
string n = Console.ReadLine();
DirectoryInfo d = new DirectoryInfo(n);
FileInfo[] files = d.GetFiles();
foreach (FileInfo f in files)
{
Console.WriteLine("{0} {1}", f.FullName, f.Length);
FileStream fp = new FileStream(f.FullName, FileMode.Open);
StreamReader reader = new StreamReader(fp);
string data;
while ((data = reader.ReadLine()) != null)
{
Console.WriteLine(data);
System.Threading.Thread.Sleep(50);
}
Console.WriteLine();
reader.Close();
fp.Close();
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
string n = Console.ReadLine();
DirectoryInfo d = new DirectoryInfo(n);
FileInfo[] files = d.GetFiles();
foreach (FileInfo f in files)
{
Console.WriteLine("{0} {1}", f.FullName, f.Length);
FileStream fp = new FileStream(f.FullName, FileMode.Open);
StreamReader reader = new StreamReader(fp);
string data;
while ((data = reader.ReadLine()) != null)
{
Console.WriteLine(data);
System.Threading.Thread.Sleep(50);
}
Console.WriteLine();
reader.Close();
fp.Close();
}
}
}
}
No comments:
Post a Comment