У меня есть цикл while в Main (), который проходит через несколько методов. Хотя один метод с именем ScanChanges()
имеет оператор if / else, в случае if
он должен перейти к Thread.Sleep(10000)
(в конце цикла).
static void Main(string[] args)
{
while (true)
{
ChangeFiles();
ScanChanges();
TrimFolder();
TrimFile();
Thread.Sleep(10000);
}
}
private static void ChangeFiles()
{
// code here
}
private static void ScanChanges()
{
}
FileInfo fi = new FileInfo("input.txt");
if (fi.Length > 0)
{
// How to Escape loop??
}
else
{
Process.Start("cmd.exe", @"/c test.exe -f input.txt > output.txt").WaitForExit();
}