rcord保存在文本文件中 [英] rcord saving in text file

查看:117
本文介绍了rcord保存在文本文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过C#代码将记录数据保存到txt文件中.
如果有代码的人请转发.
在此先感谢....

how to save record data in txt file by c# code.
if anyone having code please forward it.
thanks in advance....

推荐答案

1.读取gridview数据(数据表)并将其写入文本文件.
http://forums.asp.net/t/1674836.aspx/1 [ ^ ]

2.将普通的多行文本框控件写入文本文件.
http://www.gridview.net/write-text-file-in-c/ [ ^ ]

3.一般如何使用c#
编写文本文件 http://www.c -sharpcorner.com/uploadfile/mahesh/how-to-write-to-a-text-file-in-C-Sharp/ [
1. To read gridview data (datatable) and write it in text file.
http://forums.asp.net/t/1674836.aspx/1[^]

2. To write normal multiline textbox control in to text file.
http://www.gridview.net/write-text-file-in-c/[^]

3.In general how to write text file using c#
http://www.c-sharpcorner.com/uploadfile/mahesh/how-to-write-to-a-text-file-in-C-Sharp/[^]


请检查如何:写入文本文件(C#编程指南) [^ ].

几天前我已经使用过此代码...
Please check How to: Write to a Text File (C# Programming Guide)[^].

I have used this code before some days...


您可以尝试使用3行代码..

You can try with just 3 lines of code..

// create reader & open file
TextWriter tr = new StreamWriter(@"C:\" + "yourSavedData.txt");

// read a line of text
tr.Write(richTextBox1.Text);   //richtextbox.text may be your record

// close the stream
tr.Close();


这篇关于rcord保存在文本文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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