zoukankan      html  css  js  c++  java
  • WP7 读取Properties中的xml文件

     public static string GetManifestAttribute(string elementName, string attributeName)
            {
                string ret = null;
                try
                {
                    var settings = new XmlReaderSettings { XmlResolver = new XmlXapResolver() };
                    const string manifestName = "WMAppManifest.xml";
                    //const string appNodeName = "App";
                    using (var rdr = XmlReader.Create(manifestName, settings))
                    {
                        rdr.ReadToDescendant(elementName);
                        if (!rdr.IsStartElement())
                        {
                            throw new FormatException(manifestName + " is missing " + elementName);
                        }

                        ret = rdr.GetAttribute(attributeName);
                    }
                }
                catch (Exception ex)
                {
                    throw(ex);

                }

                return ret;
            }

  • 相关阅读:
    蛤玮学计网 -- 简单的判断ip
    修路方案 Kruskal 之 次小生成树
    单词拼接 ----- 深搜
    KMP 算法
    城市平乱 ---- Dijkstra
    最少换乘
    ubuntu-vnc
    sshpass----------------sshfs--sftp(sublime)
    snmp ubuntu/centos--
    erlang ssl
  • 原文地址:https://www.cnblogs.com/mokey/p/2259285.html
Copyright © 2011-2022 走看看