saveFileDialog1.Title = "保存";
saveFileDialog1.InitialDirectory = @"D";
dataGridView1.DataSource = dt;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
string fileName = saveFileDialog1.FileName;
//string str = dt.Rows.(这里怎么写,让dt里面的数据都存在字符串str中???)
File.WriteAllText(fileName, str);
}