Asp.net is garbled and the ASP.NET page is output to Excel

xiaoxiao2021-03-06  41

1. or 2. Specified file name when downloading files, Chinese The file name appears garbled? Response.addheader ("Content-Disposition", "Attachment; FileName =" httputility.urlencoding (filename.tostring ())); 4. Why is the Chinese characters read out? System.IO.StreamReader m_fs = System.IO.File.OpenText (Hfile_SelectFile.Value); to System.IO.StreamReader m_fs = new System.IO.StreamReader (Hfile_SelectFile.Value, System.Text.Encoding.GetEncoding ( "gb2312 ")); 5.jmail email attachment or not or in the body is garbled http://community.9cbs.net/expert/topic/3172/3172047.xml?temp=.3463404 6. How to solve query string Chinese Garbled problem? Query content with server.urlencode encoded string url = "http://localhost/test/test.aspx? A =" Server.urlencode ("Zhang San"); solution -> server.urdecode () Recently, development When ISO file management system, I have encountered the need to output ASPX directly to Excel, and I will share my experience with you. In fact, it is easy to use the ASP.NET output of Word, Excel, TXT, HTM and other types of documents such as the specified content. It is mainly divided into three steps.

转载请注明原文地址:https://www.9cbs.com/read-118460.html

New Post(0)