Quote:
Originally Posted by ftplayer
OMG DUDE!
Code:
foreach (string acc in "C:\\Accounts\\")
{
if (DateTime.Now >= System.IO.File.GetLastWriteTime("C:\\Accounts\\" + acc).AddDays(3))
{
System.IO.File.Delete("C:\\Accounts\\" + acc);
}
}
you search a string in another string(thats what normaly C# reads-.-')
Code:
String Path = "C:\\Accounts\\";
foreach (string acc in System.IO.Directory.GetFiles(Path))
{
if (DateTime.Now >= System.IO.File.GetLastWriteTime(Path + acc).AddDays(3))
{
System.IO.File.Delete(Path + acc);
}
}
How do you expect people to learn if you give em ****?
|
Again, that's not a working code, it was a example of how you can use DateTime and GetLastWriteTime, it all was just a example. Rest of the code is just to make it all understandable, not working.