How to access a binary resource in a C# application

后端 未结 3 1864
余生分开走
余生分开走 2021-01-12 03:44

I\'m trying to store an empty Access database (.mdb) as a resource in my application. I then want to write it out the file system and populate it with table definitions, et

3条回答
  •  温柔的废话
    2021-01-12 04:06

    You can also check the names of your resources by invoking

    string[] myResources = objAssembly.GetManifestResourceNames();
    foreach(string reso in myResources) {
       Console.WriteLine(reso);
    }
    

    Also, make sure your empty.mdb file is marked with Embedded Resource on compilation action

    alt text http://img520.imageshack.us/img520/6649/sinttuloo.png

提交回复
热议问题