2012-04-11 4 views
1

アラビア語でメッセージを保存するウェブサイトを持っています.CSSvにエクスポートしようとすると、それは何ですか? 。以下は私がそれをエクスポートするために使用するコードですASP.NET Websitでアラビア語メッセージをエクスポートする

public void DownloadCSV(string csvData, string filename) 
{ 
    string strFileName = filename; 
    HttpContext.Current.Response.ClearContent(); 
    HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=" + strFileName); 
    HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("iso-8859-2"); 
    HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"; 
    HttpContext.Current.Response.Write(csvData); 
    HttpContext.Current.Response.Flush(); 
    HttpContext.Current.Response.End(); 
} 

どのようにこの問題を解決することができます。事前に感謝します

答えて

2

ContentEncodingをwindows-1256またはutf-8に変更してください。 また、より良いライブラリを使用してhttp://epplus.codeplex.com/

+0

epplusのようなExcelファイルを作成することをお勧めします。お返事をありがとうございます 。 – json

関連する問題