public static string Return(int resultCode, string resultMsg)
{ string xml = string.Empty; xml += "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"; xml += "<root>\n"; xml += string.Format(" <resultcode>{0}</resultcode>\n", resultCode); xml += string.Format(" <resultmsg>{0}</resultmsg>\n", resultMsg); xml += "</root>\n"; return xml; } StringBuilder xml = new StringBuilder();
xml.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"); xml.Append("<root>\n"); string resultcode = string.Format(" <resultcode>{0}</resultcode>\n", resultCode); string resultmsg = string.Format(" <resultmsg>{0}</resultmsg>\n", msg); xml.Append(resultcode); xml.Append(resultmsg); xml.Append("</root>\n"); //xml读取
XmlDocument xmlDoc = null;
xmlDoc=获取xml格式方法;//GetResponse(poststring, ServiceCodeEnum.SendMessage); //读取
xmlDoc.GetElementsByTagName("resultcode")[0].FirstChild.Value |
|