我正在尝试为我的应用程序制作一个备份模块,这是我的代码:
try
{
string newDbName = Application.StartupPath + @"\Database1.accdb";
MessageBox.Show("The current directory is: " + newDbName);
File.Copy(backupPicker.FileName, newDbName, true);
MessageBox.Show("Restaurare efectuata cu succes.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
} catch (Exception ex)
{
MessageBox.Show("Nu s-a putut restaura reerva.\nMai multe informatii despre aceasta eroare pot fi gasite in jurnalul de erori.", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
但我的应用程序甚至没有运行!这是我从调试器得到的错误消息:
但实际上,我的应用程序有权访问该位置。我能做些什么?