[求助]怎么写文本文件的格式,着急?!!
我写的文本文件都连在了一起,如何实现上述文本的格式啊?Help me!
代码如下:
FileStream fileStreamObject = new FileStream("sbh.TXT", FileMode.CreateNew);
BinaryWriter binaryWriterObject = new BinaryWriter(fileStreamObject);
int numCols = dt.DefaultView.Count;
for (int i = 0; i < numCols; i++) {
string kkk =dt.DefaultView[i]["付款单位识别号"].ToString().Trim();
binaryWriterObject.Write(kkk + "\t" + dt.DefaultView[i]["付款单位"].ToString().Trim() + "\t" + "4" + "\t" + "\t" + "\t" + this.textBox1.Text.Trim() + "\r\n");
}
fileStreamObject.Close();
binaryWriterObject.Close();
MessageBox.Show("成功!");