using System;
using System.IO;
namespace ConsoleApplication1
{
class CountWords
{
public string content { get; set; }
internal int wordsInFile(string P)
{
return File.ReadAllText(P).Split(' ').Length;
}
}
class Program
{
static void Main(string[] args)
{
CountWords c = new CountWords();
int numWords = c.wordsInFile(@"C:\test_data.txt");
Console.WriteLine(numWords);
Console.ReadLine();
}
}
}
Text and Speech Project in C# Dotnet
No comments:
Post a Comment