Это кажется довольно простой, но я не могу показаться, чтобы выяснить проблемыXmlTextWriter - Доступ к пути запрещен
public static string destinationFile;
[STAThread]
private static void Main(string[] args)
{
//doing something and then calling convert method
}
private static void convert(object source, FileSystemEventArgs f)
{
if (check(FileName))
{
//doing something
XmlTextWriter myWriter = new XmlTextWriter(destinationFile, null);
//doing something
}
}
private static bool check(string filename)
{
//check the file and return a boolean result
if (sometest)
{
destinationFile = @"d:/GS";
return true;
}
return false;
}
Когда я запускаю это я получаю:
The process failed:
System.UnauthorizedAccessException: Access to the path is denied
мая Я знаю, где я ошибаюсь.
Запустите вашу программу как «Администратор» и попробуйте еще раз –
Я использую windows xp и m уже в учетной записи администратора – user726720
Вы уверены, что администраторы имеют доступ к папке? –