Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Obtenur une valeur Intéger à partir d’un élément XML

Utilisation,de,la,classe,'XmlTextReader',pour,lire,un,document,XML
{filelink=16414}

/*
  Microsoft Public License (Ms-PL)
  http://dbmlmanager.codeplex.com/license
 */
 
#region using
using System;
using System.Xml;
#endregion
 
namespace DbmlManager.Lib.Utility
{
  #region Class Docs
  ///
<summary>
  /// Summary description.
  /// </summary>
 
  #endregion
 
  public class XmlUtil
  {
 
    #region ChargerInteger(ref int valeur, XmlNode parent, string nom)
    public static void ChargerInteger(ref int valeur, XmlNode parent, string nom)
    {
      try
      {
        XmlElement elem = parent[nom];
        if (elem != null)
          valeur = Int32.Parse(elem.InnerText.Trim());
      }
      catch
      {
        valeur = 0;
      }
    }
    #endregion
 
  }
}

No comments yet.

Leave a Comment