zoukankan      html  css  js  c++  java
  • 复制一个资源文件并带comment列

                string resourceBackUpName = this.GetResourceBackUpName(resxFilePath);//back up the res file
                File.Copy(resxFilePath, resourceBackUpName);

                ResXResourceReader reader = new ResXResourceReader(resourceBackUpName);
                reader.UseResXDataNodes = true; // set it for get comments

                ResXResourceWriter writer = new ResXResourceWriter(resxFilePath);

                foreach (DictionaryEntry entry in reader)
                {
                    ResXDataNode tmpNode = (ResXDataNode)entry.Value;

                    AssemblyName[] assemblies = Assembly.GetExecutingAssembly().GetReferencedAssemblies();
                    string theValue = tmpNode.GetValue(assemblies).ToString();

                    ResXDataNode trimNode = new ResXDataNode(entry.Key.ToString(), theValue);
                    trimNode.Comment =  tmpNode.Comment;

                    writer.AddResource(trimNode);
                }
                reader.Close();
                writer.Close();

  • 相关阅读:
    行编辑
    二叉树
    多项式乘法
    引用标准库查看当前目录
    双向链表
    哈希表查找
    perl模块
    顺序栈实现
    C#中访问注册表
    查看perl的版本、配置和库信息
  • 原文地址:https://www.cnblogs.com/anorthwolf/p/1987424.html
Copyright © 2011-2022 走看看