Hi,
ich habe das Problem, dass ich mir nicht erklären kann warum er das Verzeichniss nicht löschen kann.
wenn ich auf den Button drücke gibt er nur folgene Fehlermeldung aus:
"Eine nicht behandelte Ausnahme des Typs "System.UnauthorizedAccessException" ist in mscorlib.dll aufgetreten.
Zusätzliche Informationen: Der Zugriff auf den Pfad "map.xml" wurde verweigert."
Vllt. kann mir ja einer von Euch sagen wo der Fehler liegt
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
| using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO;
namespace WindowsFormsApplication21 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { string user = textBox1.Text; if (System.IO.Directory.Exists(@"C:\users\" + @user + "\\Appdata\\Roaming\\Command & Conquer 3 Tiberium Wars") == true) { System.IO.Directory.Delete(@"C:\users\" + @user + "\\Appdata\\Roaming\\Command & Conquer 3 Tiberium Wars", true); } } } } |
MfG.: KWR
Moderiert von Christian S.: Topic aus WinForms verschoben am Di 11.03.2014 um 18:38