Response.Clear()
Response.buffer = true
Response.ContentType = "application/vnd.ms-word; utf-8"Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312")
'Response.Charset = "utf-8"
If Instr(1, Request.ServerVariables("HTTP_USER_AGENT"), "MSIE 4.01") > 0 Then Response.AddHeader("Content-Disposition","inline;filename="+DateTime.Now.Tostring("yyyy-MM-dd")+".doc")
Else Response.AddHeader("Content-Disposition","attachment;filename="+DateTime.Now.Tostring("yyyy-MM-dd")+".doc"
End If
刚发的那个是加个Http头,会以流的方式写入到Word