codice:
private void Note_Click(object sender, RoutedEventArgs e)
{
textBox2.Visibility = Visibility.Visible;
Process.Start(@"C:\Windows\System32\osk.exe");
textBox2.Focus();
}
private void textBox2_PreviewKeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return && !string.IsNullOrWhiteSpace(this.textBox1.Text))
{
string testo = "";
FileStream fs = new FileStream(path + this.textBox1.Text + estensione, FileMode.OpenOrCreate, FileAccess.Write);
System.IO.StreamWriter file1 = new System.IO.StreamWriter(fs);
foreach (string[] array in visualizzaRis.Items)
{
foreach (string s in array)
{
testo += s;
}
testo += "\r\n";
}
file1.WriteLine(testo);
file1.Flush();
file1.Close();
fs.Close();
}
}
scusami abbi un po' di pazienza con me, sono alle prime armi, cmq fino ad ora questo è il mio codice e quando premo invio nn crea nessun file (ti anticipo che path è una stringa uguale a @"C:\\Users\Utente\Desktop\" e estensione ".txt"), come mai?
ah anche this.Textbox1 ho modoficato in this.textBox2 ma nn va nemmeno