参考文章地址:https://blog.youkuaiyun.com/smartsmile2012/article/details/81559320
1. DataTable 导出excel
public static int TableToExcel(DataTable dt, string fileName, Dictionary<string, string> cellheader)
{
string selectPath = string.Empty;
int result = -1;
try
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.Description = "请选择需存储的文件夹";
if (dialog.ShowDialog() == DialogResult.OK)
{
if (string.IsNullOrEmpty(dialog.SelectedPath))
{
FuncMessage.ShowErrorMsg("文件夹路径不能为空");
}
selectPath = dialog.Se