0
HttpContext.Current.Response.ContentType = "text/xml";
HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;
HttpPostedFile file = HttpContext.Current.Request.Files[0];
XDocument doc = XDocument.Load(XmlReader.Create(file.InputStream));
var wr = new StringWriter();
doc.Save(wr);
HttpContext.Current.Response.Write(serializer.Serialize(wr.GetStringBuilder().ToString()));
これは、XMLファイルが壊れています。文字列は次のようになります。ジェネリックハンドラの応答にxmlファイルを書き込む
"\u003c?xml version=\"1.0\" encoding=\"utf-16\"?\u003e\r\n\u003cAuditSheet\u003e\r\n \u003cPLANT_SITE_CUSTOMER_NAME\u003eZINIFEX HOBART SMELTER\u003c/PLANT_SITE_CUSTOMER_NAME\u003e\r\n
私はここで何か分かりませんでしたか?手動で\r\n
を削除する必要がありますか?ありがとう
よろしくお願いします。 JSONのシリアル化から多くのペーストをコピーするには:-)お返事ありがとう – Johan