I have the following code:
class Program
{
static void Main(string[] args)
{
string linie;
foreach (string elem in Directory.GetFiles(@"C:\Users\A\Desktop\FIles", "*.txt"))
{
Console.WriteLine(elem);
StreamReader reader = new StreamReader(elem);
{
while (!reader.EndOfStream)
{
linie=reader.ReadLine();
Console.WriteLine(linie);
}
}
reader.Close();
}
Console.ReadKey();
Console.WriteLine(DateTime.ParseExact("5/10/2005", "m/d/yyyy", null).Day);
}
}
What i need is to select only the Date from a file.
For example if i have the string "the date is 20/2/2012" in a .txt
file, i need to substract only 20/2/2012
and to compare it with the current date.