C# Visual Studio 2005中将一个TextBox中的内容通过FileStream写到文件中
FileStream resultFile = new FileStream(folderPathAndFolderName + "/" + "word.data", FileMode.Create, FileAccess.Write);
byte a;
char ch;
int i;
for (i = 0; i <textBox3.Text.Length; i++)
{
ch = textBox3.Text[i];
a = (byte)ch;
resultFile.WriteByte(a);
}
resultFile.Flush();
resultFile.Close();