المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Checking file longer than 1 hour



C# Programming
07-30-2009, 02:12 PM
Hello Everyone
I need someone who can help me.I want to check the oldest file in the directory, and if that file is older than one hour then send an alert.
Here is my current work.

for (int index = 0; index < files.Length; index++)//Loop through the file.
{
string lastMTime = File.GetLastAccessTime(files[index]).ToString("ddMMyyymmss");//Get the last modified file by date.
files[index] = lastMTime + files[index];//Shuffle the array
}
Array.Sort(files);//Sort the array
string oldFile = Path.GetFileName(files[0].Substring(15));//Get the old file.
if(File.GetCreationTime(oldFile))// this is where i am stuck.....




if(File.GetCreationTime(oldFile))// this is where i am stuck.....


Please my code project peeps, help me out....
Thank you all in Advance
Marvel...