在项目中的Resources目录下有个A.Resx资源文件,文件里面有内容如下
a1     1
a2     2
现在想一次性读取所有key和value生成一个列表,如list,而不是通过具体的key一个一个的去找value
谢谢。在线等

解决方案 »

  1.   

    System.Resources.ResourceWriter rw = new ResourceWriter(@"..\..\abc.resources");这句话应该要用吧,其他的不知道,同问。
      

  2.   

    楼主还在否?可以加QQ吗?我QQ:254867296,QQ交流会方便些。
      

  3.   

    public static void Main() 
        {
            // Create a ResourceReader for the file items.resources.
            ResourceReader rr = new ResourceReader("items.resources");         
            // Create an IDictionaryEnumerator to iterate through the resources.
            IDictionaryEnumerator id = rr.GetEnumerator();         // Iterate through the resources and display the contents to the console. 
            while(id.MoveNext())
              Console.WriteLine("\n[{0}] \t{1}", id.Key, id.Value);         rr.Close();     
     
        }
      

  4.   

    http://msdn.microsoft.com/zh-cn/library/system.resources.resxresourcereader.aspx
      

  5.   

    通过Application.GetResourceStream的方法,然后通过linq读取