19/06/08 16:26
xLuk3x
Il mio intento era provare la funzione "StreamWriter", stranamente, è impossibile scrivere il file.
Cosa c'è di sbagliato?
Cosa c'è di sbagliato?
using System; using System.Collections.Generic; using System.Text; using System.IO; namespace IO_Test { class Program { static void Main(string[] args) { string input = ""; string testo; char op; start: Console.WriteLine("\nInserisci il testo: "); testo = Console.ReadLine(); Console.WriteLine("\nSalvare? (s/n)"); input = Console.ReadLine(); op = char.Parse(input); if (op == 's') { try { StreamWriter sw = new StreamWriter(@"C:\Testo.txt"); sw.WriteLine(testo); sw.Close(); } catch { Console.WriteLine("\nImpossibile Salvare!"); goto start; } } if (op == 'n') { goto start; } } } }
aaa