/// <summary>
/// 下载附件方法
/// </summary>
private void DownLoad()
{
Response.Expires = -1;
string filename = Guid.NewGuid().ToString() + ".txt";
filename = Server.MapPath(filename);
StreamWriter write = new StreamWriter(filename, true, System.Text.Encoding.UTF8);
write.WriteLine(this.txtException.Text);
write.Flush();
write.Close();
Response.Clear();
Response.ClearHeaders();
//Response.Buffer = false;
System.IO.FileInfo fi = new FileInfo(filename);
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename= " + HttpUtility.UrlEncode(fi.FullName, System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length ", fi.Length.ToString());
Response.WriteFile(fi.FullName);
Response.Flush();
System.IO.File.Delete(filename);
Response.End();
}