1.
1 protected void ebtDC_Click(object sender, EventArgs e) 2 { 3 4 string elxStr = "<table><tbody><tr><td>1</td><td>11</td></tr><tr><td>2</td><td>22</td></tr></tbody></table>"; 5 Response.Clear(); 6 Response.Buffer = true; 7 Response.AppendHeader("Content-Disposition", "attachment;filename=" + DateTime.Now.ToString("yyyyMMdd") + ".xls"); 8 Response.ContentEncoding = System.Text.Encoding.UTF8; 9 Response.ContentType = "application/vnd.ms-excel"; 10 Response.Write(elxStr); 11 Response.End(); 12 }
如果是身份证 string.Concat("'", dt.Rows[i]["CardNum"].ToString())