private void btnWrite_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "Excel文件(*.xlsx)|*.xlsx"; sfd.Title = "Excel文件操作"; if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { //文件名 //sfd.FileName bll.ExcelWrite(sfd.FileName); msgs.MsgDivShow("成功了", 1); } }