次のようなレポート名があるとします。
string reportName = "Facebook Network Performance Summary Report (By Region, By Content)";
そのファイル名をExcelとして表示したい
以下は、ファイルをエクスポートするための私のコードです
Response.AddHeader("Content-Disposition", "attachment; filename=" reportName + ".xls");
Response.AddHeader("Content-Length", l.ToString());
Response.ContentType = "application/vnd.ms-excel";
Response.BinaryWrite(f);
残念ながら、レポート名の最初のスペースを読むと、Facebook しか表示されず、それ以外は表示されません。
fileNAme のスペースを処理するための ASP.NET またはその他のメソッド用の既存の API はありますか?