I have something like :
private void Form1_Load(object sender, EventArgs e)
{
Hide();
string ngdx = "*ngdx";
string atdx = "*atdx";
for (;;)
{
try
{
string[] convertngdx = Directory.GetFiles("D:\\folder", ngdx);
string[] convertatdx = Directory.GetFiles("D:\\folder", atdx);
foreach (var convertngd in convertngdx)
{
File.Move(convertngd, Path.ChangeExtension(convertngd, ".ngd"));
}
foreach (var convertatd in convertatdx)
{
File.Move(convertatd, Path.ChangeExtension(convertatd, ".atd"));
}
}
catch
{
}
}
}
I start my app and every time a .ngdx
and .atdx
file is send to the folder
it automatically converts it to .ngd
and .atd
.
My problem is that it instantly converts them , and I want it to wait for a second before converting them.
I used System.Threading.Thread.Sleep(1000);
but it doesn't quite seem to work,I think because when I run my app the System.Threading.Thread.Sleep(1000);
is called and then after a second it is never called again.
The idea is every time a new .ngdx
or .atdx
is send to the folder
I want it to wait for a second before converting them.