c#将数据写入记事本需要控件吗?
展开全部
不用
using System.IO;
try
{
FileStream stream = new FileStream("test.txt", FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(stream);
string text="hello world";
sw.WriteLine(text);
sw.Close();
stream.Close();
}
catch (IOException e)
{
MessageBox.Show(e.Message);
}
using System.IO;
try
{
FileStream stream = new FileStream("test.txt", FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(stream);
string text="hello world";
sw.WriteLine(text);
sw.Close();
stream.Close();
}
catch (IOException e)
{
MessageBox.Show(e.Message);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询