Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Text in Datei schreiben in C# mit der Klasse: File HILFE!!!

Empfohlene Antworten

Veröffentlicht

Guten Tag

Ich hab mal ne Frage.

Wollte einen Wert den ich Eingebe(Hier unter dem Variablennamen:"name")in eine erstellte Textdatei schreiben.....

Könnt Ihr mir sagen wo mein Fehler ist.

schonmal vorab vielen Dank für die Hilfe.

Carsten

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.IO;

namespace _Anwendung

{

class Program

{

static void Main(string[] args)

{

string name;

string eMail;

Console.WriteLine("EMAIL Programm");

Console.WriteLine("By CAR$TEN");

Console.Read();

Console.WriteLine("Bitte geben sie Ihren Namen und Ihre Email Adresse ein\n");

{

Console.WriteLine("Name:");

Console.Read();

name = Console.ReadLine();

}

{

Console.WriteLine("Emailadresse:\n");

eMail = Console.ReadLine();

}

Console.WriteLine("Ihr Name ist " + name + "");

Console.WriteLine("und Ihre Emailadresse lautet " + eMail + "");

Console.Read();

StreamWriter myStreamWriter = new StreamWriter(@"C:\Dokumente und Einstellungen\c.henek\Desktop\Neuer Ordner\blub.txt");

new FileAccess();

File.WriteAllText(@"C:\Dokumente und Einstellungen\c.henek\Desktop\Neuer Ordner\blub.txt", name);

}

}

}

:cool:

soo....hab den fehler gefunden.....dummer fehler....hätte mit myStreamWriter.WriteLine() direkt in die Textdatei reinschreiben können :-)

und danach myStreamWriter.close();

@klotzkopp: aber danke für die Hilfe ;-)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.