Stream inputstream = System.Web.HttpContext.Current.Request.InputStream;
try
{
byte[] b = new byte[inputstream.Length];
inputstream.Read(b, 0, (int)inputstream.Length);
string inputstr = UTF8Encoding.UTF8.GetString(b);
XmlDocument d = new XmlDocument();
d.LoadXml(inputstr);
HttpContext.Current.Response.Write(inputstr);
}
catch(Exception ex)
{
HttpContext.Current.Response.Write(ex);
WriteLog("错误输出:" + ex.ToString());
}
提示System.Xml.XmlException: 根级别上的数据无效。 第 1 行,位置 1。 在 System.Xml.XmlTextReaderImpl.Throw(Exception e) 在 System.Xml.XmlTextReaderImpl.Throw(String res, String arg) 在 System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() 在 System.Xml.XmlTextReaderImpl.ParseDocumentContent() 在 System.Xml.XmlTextReaderImpl.Read() 在 System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) 在 System.Xml.XmlDocument.Load(XmlReader reader) 在 System.Xml.XmlDocument.LoadXml(String xml) 在 WebApplication1.weixin.interfaceTest.Index() 位置 e:\百变游戏\BBGame\WebApplication\WebApplication1\weixin\interfaceTest.ashx.cs:行号 149