당신이 과부하가있는 방법이있을 때이 오류가 발생하고 사용에 대한
Thread thread = new Thread(delegate {
try
{
Helper.CopyFolder(from, to);
Helper.RunProgram("chown", "-R www-data:www-data " + to);
}
catch (Exception exception)
{
Helper.DeactivateThread(Thread.CurrentThread.Name);
}
Helper.DeactivateThread(Thread.CurrentThread.Name);
});
thread.IsBackground = true;
thread.Priority = ThreadPriority.Lowest;
thread.Name = name;
thread.Start();
덕분에 하나 과부하로 일할 수 있습니다. 컴파일러는 어느 오버로드를 호출해야 할지를 모르기 때문에 매개 변수를 형 변환하여 명시 적으로 명시해야합니다. 이렇게하는 한 가지 방법은 다음과 같이이다 : 또는
Thread thread = new Thread((ThreadStart)delegate {
try
{
Helper.CopyFolder(from, to);
Helper.RunProgram("chown", "-R www-data:www-data " + to);
}
catch (Exception exception)
{
Helper.DeactivateThread(Thread.CurrentThread.Name);
}
Helper.DeactivateThread(Thread.CurrentThread.Name);
});