我先这样做一个名为MyResources.resources的资源文件 

C# code
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;//调用图片必须的
using System.Resources;
using System.IO;

namespace Class1
{
    class Program
    {
        static void Main(string[] args)
        {//temp.jpg拖入该文件夹下运行会生成一个资源文件
            ResourceWriter rw = new ResourceWriter("MyResources.resources");//将资源文件存入MyResources.resources文件中            
            Image Img = Image.FromFile("temp.jpg");
            rw.AddResource("MyPic", Img);
            string Mystr = "I love China.";
            rw.AddResource("MyString", Mystr);           
            //rw.Generate();//以系统默认的format保存所有的资源(不管有没这行都失败)
            rw.Close();
        }
    }
}




在开一个使用资源文件的程序,然后先 Project->Add Existing Items->添加MyResources.resource文件后去Solution Explorer里右击设置其Build Action属性为Embedded(嵌进) Resource.Form1.cs里敲入下面代码: 

C# code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Resources;//使用资源文件要用的
using System.Reflection;
using System.IO;

namespace 使用自制的资源文件
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }  
        ResourceManager rm = new ResourceManager("MyResources", Assembly.GetExecutingAssembly());//初始化资源管理对象MyResources是资源文件名       
        private void btn_Img_Click(object sender, EventArgs e)
        {//从资源文件提取图片并显示
            MyPic.Image = (Image)rm.GetObject("MyPic");
        }

        private void btn_Str_Click(object sender, EventArgs e)
        {//从资源文件提取字符串
            string str = (string)rm.GetString("MyString");
            MessageBox.Show(str);
        }
    }
}



Debug运行后出现Error: 
Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "MyResources.resources" was correctly embedded or linked into assembly "使用自制的资源文件" at compile time, or that all the satellite assemblies required are loadable and fully signed. 

然后,我用MSIL Disassember反编译了下"使用自制的资源文件.exe"在MANIFEST里找到了下面 
.mresource public '使用自制的资源文件.MyResources.resources' 

  // Offset: 0x00000000 Length: 0x0000BC7F 

说明嵌入资源没错啊!!!!!!!我是见鬼了,怎么都调不出来