System.Text.StringBuilder sb = new System.Text.StringBuilder();
//sb 中定义生成.csv文件的格式 中间以"\t"分开
Response.AddHeader("Content-Disposition", "attachment; filename=vhost" + string.Format("{0:yyyyMMddhhmmss}", DateTime.Now) + ".xls");
Response.ContentType = "application/text";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.Write(sb);
Response.End();
//sb 中定义生成.csv文件的格式 中间以"\t"分开
Response.AddHeader("Content-Disposition", "attachment; filename=vhost" + string.Format("{0:yyyyMMddhhmmss}", DateTime.Now) + ".xls");
Response.ContentType = "application/text";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.Write(sb);
Response.End();