导出文件

protected void Button3_Click(object sender, EventArgs e)

{

    Response.Clear();

    Response.Buffer = true;

    Response.AddHeader("Content-Disposition", "attachment;filename=ExportFile.txt");

    Response.ContentType = "text/plain";//application/ms-excel,application/ms-word,application/ms-html

    Response.Write("内容");

    Response.End();

}

你可能感兴趣的:(文件)