.net 接口返回xml字符串

  StringBuilder sb = new StringBuilder();
            string result = string.Empty;
            sb.Append("");
            sb.Append("");
            try
            {            
              sb.Append("标题");             
            }
            catch (Exception ex)
            {
                sb.Append("");
            }
            sb.Append("
");
            string xmlStr =sb.ToString();
            Response.ContentType = "text/xml";
            Response.Charset = "UTF-8";
            Response.Clear();
            Response.Write(xmlStr);
            Response.End(); 

你可能感兴趣的:(.net开发)