using System.Resources;string sFile="c:\\1.resource";
ResourceWriter rw=null;
Image b=pictureBox1.Image; 
rw=new ResourceWriter(sFile);  //调用时,自动将该文件的内容清空
rw.AddResource("ToolIcon",b);  //工具图标
if(rw!=null) 
{
   rw.Close();   //写入资源文件中
   rw=null;
}

解决方案 »

  1.   

    public static Bitmap GetIcon(string iconName)
    {
    Bitmap icon = (Bitmap)rm.GetObject(iconName);
    return icon;
    }
    //問題是:  如何以這種方法返回要得到的指定圖標.比如:傳入圖標的ID,然后調出ICon.
    謝謝你的回答.
      

  2.   

    读取资源中的“值,键对” 
    IResourceReader reader = new ResourceReader(你的资源文件);
          IDictionaryEnumerator en = reader.GetEnumerator();
          
          // Goes through the enumerator, printing out the key and value pairs.
          while (en.MoveNext()) {
             Console.WriteLine();
             Console.WriteLine("Name: {0}", en.Key);
             Console.WriteLine("Value: {0}", en.Value);
          }
          reader.Close();
       }
      

  3.   

    謝謝倆位熱心人吶!真是雷鋒!我已經搞定了!
    按題意, wandao         得分 : 70
            perilla(紫苏)  得分 : 30