-4
By pressing the button I need to move all zeroed files from one directory to another.
My code.
private void button1_Click(object sender, EventArgs e) {
var pasta = (@"C:\Users\Desktop\Nova pasta\");
var pasta2 = (@"C:\Users\Desktop\Nova pasta\outro\");
var dir = new DirectoryInfo(pasta);
foreach (FileInfo arquiv in dir.GetFiles()){
if (arquiv.Length <= 0)
{
arquiv.MoveTo(pasta2);
}
}
}
Thanks friend, it helped me a lot.
– Thiago