如何使用逗号为每个文本框值保存记事本中的5个文本框值? [英] how to save 5 textbox values in notepad with comma for per textbox values?

查看:87
本文介绍了如何使用逗号为每个文本框值保存记事本中的5个文本框值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的设计页面中使用了五个文本框,如果我在文本框中输入值,所有将存储在(,)的特殊记事本文件中。它是怎么去的?

i have use five text box in my design page if i enter value in text box that all will store in particular notepad file with (,).how is it dears?

推荐答案

string textBoxesValues = "TextBox1.Text" + "," + "TextBox2.Text" + "," + "TextBox3.Text" + "," + "TextBox4.Text" + "," + "TextBox5.Text";
            StreamWriter writer = new StreamWriter("FilePath where you want to save e.g D:\\New Folder\abc.text", true);    //true if you want to append text
            writer.WriteLine(textBoxesValues);
            writer.Flush();
            writer.Close();
            writer.Dispose();
            //or try this
            File.AppendAllText("FilePath where you want to save e.g D:\\New Folder\abc.text", textBoxesValues);





帮助链接



MSDN LINK


这篇关于如何使用逗号为每个文本框值保存记事本中的5个文本框值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆