http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-globalarchi.asp

解决方案 »

  1.   

    public class Res : IResource
    {
    Hashtable resources;
    public Res()
    {
    resources = new Hashtable();
    ResXResourceReader rx = new ResXResourceReader("Resource.resx");
    IDictionaryEnumerator n = rx.GetEnumerator();
    while (n.MoveNext())
    {
    if (!resources.ContainsKey(n.Key))
    {
    resources.Add(n.Key, n.Value);
    }
    }
    rx.Close();
    } public string GetString(string name)
    {
    return (string)resources[name];
    }
    }
      

  2.   

    public class Res {
    Hashtable resources;
    public Res()
    {
    resources = new Hashtable();
    ResXResourceReader rx = new ResXResourceReader("Resource.resx");
    IDictionaryEnumerator n = rx.GetEnumerator();
    while (n.MoveNext())
    {
    if (!resources.ContainsKey(n.Key))
    {
    resources.Add(n.Key, n.Value);
    }
    }
    rx.Close();
    } public string GetString(string name)
    {
    return (string)resources[name];
    }
    }
      

  3.   

    为什么我的System.Resource中没有ResXResourceReader类??很多的文档中都说过System.Resource中有此类郁闷呀...
      

  4.   

    请检查
    添加引用了没有。
    用using进行说明了没有。在MSDN中查看ResXResourceReader所在的命名空间,MSDN有例子。
      

  5.   

    不行呀,我往我的项目里添加了程序集,可是没有相应的ResXResourceReader呀高手帮忙呀,跪求...
      

  6.   

    就是System.Resources.ResXResourceReader.一个相似的例子:
    using System;
    using System.Drawing;
    using System.Resources;
     
    public class MainApp 
    {
       public static void Main() 
       {
          Image img = Image.FromFile("en-AU.jpg");
          ResXResourceWriter rsxw = new ResXResourceWriter("en-AU.resx"); 
          rsxw.AddResource("en-AU.jpg",img);
          rsxw.Close();
       }
    }
    顺便推荐一个制作资源文件的工具http://www.guohuasoft.com.