Hi
Ich schon wieder *g*, ich weis, Anfänger, hab Google benutzt, habe auch einiges gefunden doch es will nicht funktionieren!
Also, ich möchte, beim Startup prüfen ob eine Datei existiert. Wenn nicht, dann soll er sie erstellen. Das Problem liegt beim checken, ich bin schon "recht weit", für mich Persönlich ist der Code fertig doch es kommt immernoch ein Error, hier mein Code:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| private void FormGAL_Load(object sender, EventArgs e) { if (File.Exists(Application.StartupPath + (@"\appPath1.txt"))); { string Path1 = Application.StartupPath + (@"\appPath1.txt"); StreamReader sr1 = new StreamReader(Path1); string AppPath1 = sr1.ReadLine().ToString();
richTextBox1.Text = AppPath1;
sr1.Close(); } } |
Der Fehler, er konnte sie nicht finden *lol* was ja auch mehr oder weniger beabsichtigt ist!
"Could not find file 'F:\...\bin\Debug\appPath1.txt'."
Er tritt in der Zeile "StreamReader sr1=..." auf, markiert bei Path1
Bitte um Hilfe, bekomme das wirklich nicht gebacken!