Hi I want to create an application that connect to my host and check if any new file added in the the directories. so I need the creation time of that host file but i could not connect to the server. I just find some code for creation time of server files but i don't know why they don't work some how. any suggestion?
this is the code:
string path = "http://neginmelk.ir/app_test\t2/mine.txt";
if (!File.Exists(path))
{
File.Create(path);
}
else
{
// Take an action that will affect the write time.
File.SetLastWriteTime(path, new DateTime(1985,4,3));
}
// Get the creation time of a well-known directory.
DateTime dt = File.GetLastWriteTime(path);
Console.WriteLine("The last write time for this file was {0}.", dt);
// Update the last write time.
File.SetLastWriteTime(path, DateTime.Now);
dt = File.GetLastWriteTime(path);
Console.WriteLine("The last write time for this file was {0}.", dt);