string sFileName="C:\xxx.txt";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(sFileName,System.Text.Encoding.UTF8));
Response.WriteFile(filePath);
Response.End();

解决方案 »

  1.   

    Dim name As String = "中文名称"
                Response.ContentType = "application/ms-word"
                Response.Charset = "UTF-8"
                Response.AddHeader("content-disposition", "attachment; filename= " & HttpUtility.UrlEncode(name) & ".doc")            Dim sourceFile As IO.FileStream = New IO.FileStream("F:\downloadexample.doc", IO.FileMode.Open)
                Dim FileSize As Long
                FileSize = sourceFile.Length
                Dim getContent() As Byte = New Byte(FileSize) {}            sourceFile.Read(getContent, 0, sourceFile.Length)
                Response.BinaryWrite(getContent)
                sourceFile.Close()
      

  2.   

    楼上的两位正确注意HttpUtility.UrlEncode,可以正常显示中文文件名