c#怎么把数据存到缓冲区里面

c#怎么把数据存到缓冲区里面再写入TXT记事本里面

例如 string a="nihao "
string b="world"
string c="!"
把三个类型拼接起来成string d="nihaoworld!"
将 string d 放入缓冲区 之后写入txt文档 注意必须放入缓冲区里面 因为string D有n 个

求个DEMO。各位小可爱们爱你

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string a = "nihao";
string b = "world";
string c = "!";
string d = a + b + c;
string path=@"C:\Users\12847\Desktop\12.txt";
FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite);
byte[] array=Encoding.UTF8.GetBytes(d);
fs.Write(array,0,array.Length);
fs.Close();

    }
}

}

字符串不是很长的效率都比较快,字符串很长很长的效率就不好说了,能不能满足你的需求,写一个软件进行测试就可以了