I have a Visual Studio VB.NET program with one form. The form has one text box and one button. You enter text in the text box, click the button, and your input is saved in a new text filed called TextFile1.txt. It works fine. Here's the code for the Button1_Click.
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
My.Computer.FileSystem.Wri
teAllText _
("c:\TextFile1.txt", TextBox1.Text, False)
MsgBox("File saved as TextFile1.txt")
End Sub
I tried to create the same program in Visual C#, but it doesn't work. Here's the code for the Button1_Click.
private void Button1_Click(object sender, EventArgs e)
{
System.IO.File.WriteAllLin
es
(@"C:\TextFile2.txt", TextBox1.Text);
Microsoft.VisualBasic.Inte
raction.Ms
gBox
("File saved as TextFile2.txt");
}
I don't know how to make the C# version work. I'm going to attach both programs
to
http://www.ee-stuff.com/Expert/Upload/upload.php as zip files because this page won't let me attach them.
That's pretty vague. What happens that shouldn't, or doesn't that should?