我要创建一个CSV
并向其写入信息然后下载它。现在我必须以zip格式下载它。
public void WriteToCSV(List<DeviceModel> DeviceList)
{
string attachment = "attachment; filename=DeviceModel.csv";
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "text/csv";
Response.AddHeader("Pragma", "public");
WriteColumnName();
foreach (DeviceModel Device in DeviceList)
{
WriteDeviceInfo(Device);
}
Response.End();
}