у меня есть этот метод
public void Copy(string sourcePath, string destPath)
{
string[] files= Directory.GetFiles(sourcePath);
for (int i = 0; i < files.Length; i++)
{
try
{
File.Copy(files[i], destPath);
}
catch
{
try
{
File.Replace(files[i], destPath, null);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
когда я запускаю его, я получаю исключение несанкционированного доступа, доступ запрещен! любую помощь в этом!