如何把传入的XML转成字符串
推荐于2017-09-25
展开全部
XmlWriter.Create(Server.MapPath(@"XMLFile1.xml"));
string xmlstr = "<?xml version=\"1.0\" encoding=\"gb2312\"?>" +
"<PARTNUMBER FLAG=\"TOP\">TE3000000000" +
"<CHILDPARTNUMBER>W200007440" +
"<COUNT>66.0</COUNT>" +
"<UNIT>每个</UNIT>" +
"<KEYPART></KEYPART><MATERIALREPLACEMENTELEMENT></MATERIALREPLACEMENTELEMENT>" +
"</CHILDPARTNUMBER></PARTNUMBER>";
StreamWriter sw = new StreamWriter(Server.MapPath(@"XMLFile1.xml"),false);
sw.Write(xmlstr);
sw.Close();
string xmlstr = "<?xml version=\"1.0\" encoding=\"gb2312\"?>" +
"<PARTNUMBER FLAG=\"TOP\">TE3000000000" +
"<CHILDPARTNUMBER>W200007440" +
"<COUNT>66.0</COUNT>" +
"<UNIT>每个</UNIT>" +
"<KEYPART></KEYPART><MATERIALREPLACEMENTELEMENT></MATERIALREPLACEMENTELEMENT>" +
"</CHILDPARTNUMBER></PARTNUMBER>";
StreamWriter sw = new StreamWriter(Server.MapPath(@"XMLFile1.xml"),false);
sw.Write(xmlstr);
sw.Close();
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询