Monday, 19 August 2013

Invalid Expression 'String' C#

Invalid Expression 'String' C#

I'm trying to make a program that when a button is pressed, the program
takes the words typed in the text box and adds it to a notepad file. This
is what I have so far:
private void textBox1_TextChanged(object sender, EventArgs e)
{
File.WriteAllText(path, string());
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
File.WriteAllText(path, string());
}
}
The String keeps coming up with error code CS1525. I haven't been able to
find any help elsewhere, so if you can offer help, thanks!

No comments:

Post a Comment