scenario is there is a drive and in that drive there is a files which is automatically created in every 4 mints so i fetch this date time in in this code
now i want to insert data in db that when any file not created within 4 mint then i want to insert data in db
data is sent to db but problem is this data not send when 4 mint is over and i want this condition
code
try
{
string abc= "";
abc= ConfigurationManager.AppSettings.Get("abc");
DateTime dattme= File.GetLastAccessTime(abc);
Console.WriteLine("the last access time for c {0}", dattme);
if(DateTime.Now.Minute > 4)
{
DataClasses1DataContext db = new DataClasses1DataContext();
tbl_OutBox tb = new tbl_OutBox();
tb.ToSIM_No = "+234234324";
tb.ToText = "Check please";
tb.FromSIM_No = "+234234324";
tb.FromText = "Check please";
db.tbl_OutBoxes.InsertOnSubmit(tb);
db.SubmitChanges();
}
}
catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
Thread.Sleep(5000);
}
}
how to solve