private void write()
    
{

        DMessage dmes 
= new DMessage();
        Message mes 
= new Message();
        mes 
= dmes.GetModel(Convert.ToInt32(ViewState["ID"]));
        
string filename = Server.UrlEncode("附件");
        Byte[] b 
= mes.Annex;
   
        
//Response.ContentType = "Application/msword";
        
//word 
        Response.ContentType = "application/octet-stream";

        Response.AddHeader(
"Content-Disposition", "attachment;   filename=" + HttpUtility.UrlEncode("附件", System.Text.Encoding.Unicode));
        
this.Response.Clear();
        System.IO.Stream fs 
= this.Response.OutputStream;
        fs.Write(b, 
0, b.Length);
        fs.Close();
        
this.Response.End();

    }
 
posted on 2008-06-16 17:29  code life  阅读(238)  评论(0)    收藏  举报