1、首先输入代码:
FileStream mystream = new FileStream("C:\\设备配置\\a.txt", FileMode.OpenOrCreate);
StreamWriter Mywriter = new StreamWriter(mystream, Encoding.Default);
string text = "";
2、然后输入代码:
for (int i = 0; i < axMSFlexGrid1.Rows; i++)
for (int j = 0; j < axMSFlexGrid1.Cols; j++)
text += flex.get_TextMatrix(i, j) + "\t";
3、然后再输入下方的代码就完成了。
Mywriter.Write(text);
Mywriter.Close();
mystream.Close();