private static Regex regex = new Regex("<(\\w+?)[ >]", RegexOptions.Compiled); 
private string GetRootElement(string body)
{
    Match match = regex.Match(body);
        if (match.Success)
        {
            return match.Groups[1].ToString();
        }
        else
        {
            throw new TopException("Invalid XML response format!");
        }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
猜你喜欢
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案