将数据添加到txt文件中(在文件末尾) [英] adding data into a txt file(at the end of the file)

查看:132
本文介绍了将数据添加到txt文件中(在文件末尾)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次鼠标事件发生时,我都必须将数据添加到txt文件中!
我该怎么办?

(我是业余用户,请给我一个代码)

i have to add data to an txt file everytime the mouse event happens!
what should i do?

(Im an amatör please give me a code)

推荐答案

在鼠标事件处理程序中使用以下代码片段:
Use the following code snippet in your mouse event handler:
StreamWriter sw = File.AppendText("filename.ext");
sw.WriteLine("text to append");
sw.Close();


这篇关于将数据添加到txt文件中(在文件末尾)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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