ResourceManager rm;
rm = new ResourceManager("Skin", Assembly.GetExecutingAssembly());

解决方案 »

  1.   

    谢谢 happyjun2000正在msdn里查相关资料。
      

  2.   

    GetManifestResourceNames或 GetManifestResourceStream
      

  3.   

    那们老兄,好好说一下。如何嵌入的,就是把图片和exe文件一起打包。
      

  4.   

    VS.Net2003中,加入图片。选择属性:嵌入的资源,编译之。
    ResourceManager读取出来。注意名称是项目的默认名称空间+项目中的文件夹+文件夹下的图片名。
      

  5.   

    实例讲解.NET中资源文件的创建与使用 http://blog.csdn.net/lizanhong/archive/2004/09/10/100812.aspx
      

  6.   

    http://blog.csdn.net/lizanhong/archive/2004/09/10/100812.aspx我也正在看ing 写的还不错。
      

  7.   

    这是我写的代码 可以很好的运行!
    private void changeFile()
    {

    Random r = new Random();
    int fileLen = 1;
    /*
    //从文件夹读取图片
    string[] fileToDisplay = Directory.GetFiles (@"E:\MyDocument\My Pictures\","*.jpg");
    fileLen = fileToDisplay.Length ;
    Bitmap MyImage = new Bitmap(fileToDisplay[r.Next (fileLen)]);
    */
    //把图片做成资源的形式
    string[] fileToDisplay ={"DSCF0025.JPG",
    "DSCF0029.JPG",
    "DSCF0036.JPG",
    "DSCF0004.JPG",
    "DSCF0012.JPG",
    "DSCF0015.JPG",
    "DSCF0002.JPG",
    "DSCF0010.JPG",
    "DSCF0043.JPG",
    "DSCF0048.JPG"
    };
    fileLen = fileToDisplay.Length ;
    ResourceManager rm = new ResourceManager("cCharp.My",Assembly.GetExecutingAssembly ());
    Bitmap MyImage =  (Bitmap)rm.GetObject(fileToDisplay[r.Next (fileLen)]);
    picBox.Image = (Image) MyImage ;
    //
    MovePic();
    }