C # 读取XML文件
2016-03-15 21:47
267 查看
public static Boolean modifyManifest(PTData data, String code) { Console.WriteLine(TAG + " code::" + code); string mDir = data.ApkPath + Path.DirectorySeparatorChar + "test" + Path.DirectorySeparatorChar + "AndroidManifest.xml"; Console.WriteLine(TAG + " path::" + mDir); //读取xml XmlDocument doc = new XmlDocument(); doc.Load(mDir); XmlNodeList mtNodeList = doc.SelectNodes("//meta-data"); foreach (XmlNode node in mtNodeList) { string name = node.Attributes["android:name"].Value; //Console.WriteLine("name::" + name); string value = node.Attributes["android:value"].Value; //Console.WriteLine("value::" + value); if ("AD_CODE".Equals(name) && value != null) { node.Attributes["android:value"].Value = code; doc.Save(mDir); } } return false; }
相关文章推荐
- EditText的功能与用法
- CSS,Jquery精美进度条和滑动条(滑块)插件
- 控制文件(controlfile)
- 学习《HTML+CSS基础课程》里的权值
- Spring和Hibernate结合的一个小例子
- 百度距离谷歌何止一个太平洋的距离
- Spring和Hibernate结合的一个小例子
- python连接redis3.x集群并做操作
- shell之文本编辑
- nyoj27水池数目
- springMVC No mapping found for HTTP request with URI
- 百度距离谷歌何止一个太平洋的距离
- C#开源项目大全
- 自动生成四则运算题目
- 使用okhttp报错"Missing type parameter"
- Git 时间,版本控制工具进阶
- ext2文件系统源代码之dir.c
- 逆波兰表达式计算器
- Hibernate批量操作
- poj(1222)——EXTENDED LIGHTS OUT