先来写一段代码,这段代码也是我在网上找的,但是他那个原先有点问题,我对他那个进行了修改,现在这个代码是我修改改过的,应该没有问题的. public int StreamExport(System.Data.DataTable dt, List<string> ColNames, string fileName) { ; StringBuilder content = new StringBuilder(); StringBuilder strtitle = new StringBuilder(…