Visual C# - Write contents of a textbox to a .txt file

后端 未结 5 1847
遇见更好的自我
遇见更好的自我 2020-12-31 11:28

I\'m trying to save the contents of a textbox to a text file using Visual C#. I use the following code:

private void savelog_Click(object sender, EventArgs e         


        
5条回答
  •  余生分开走
    2020-12-31 11:52

    I think what you need is:

    tw.WriteLine(logfiletextbox.Text);
    

    if you don't say '.Text' that's what you get

    Hope that helps!

提交回复
热议问题