1.找到K2的config路径

2.config配置方法

 

3.获取config配置的值

 private string GetK2Configuration(string key)
        {
            XmlNode config;

            try
            {
                config = this.xmlDoc.SelectSingleNode("Configuration/Item[@Name='" + key + "']");
                if (config != null)
                {
                    return config.InnerXml;
                }
            }
            catch { }

            try
            {
                config = this.xmlDoc.SelectSingleNode("Configuration/" + key);
                if (config != null)
                {
                    if (config is XmlAttribute)
                    {
                        return config.Value;
                    }
                    else
                    {
                        return config.InnerXml;
                    }
                }
            }
            catch { }

            return null;
        }

  

posted on 2014-07-04 10:43  赵子龙闯天涯  阅读(135)  评论(0)    收藏  举报