Groups | Blog | Home
all groups > dotnet internationalization > december 2004 >

dotnet internationalization : How to use ResourceWriter.AddResource


msnews.microsoft.com
12/10/2004 4:00:54 PM
Hi,

In my application, I want to add some new items to an existing resource
file. So, I wrote below lines.

//--------------
IResourceWriter rw = new
ResourceWriter(@"C:\develop\\MyResource.resources");

rw.AddResource("Ninth", "Pluto");

//rw.Generate();

rw.Close();

//---------------------

It could write the items into the resorce file, but the problem is that all
old exsiting items disappeared. What I want to do is each time add new
items, I need append new items to existing old ones.

Could anybody help me figure out what is wrong with the code? Or could you
grant some information about how to do this.

Thanks a lot

LLI



Claire
12/14/2004 12:50:10 PM
I assume that the resource writer creates the file from new rather than
appending to it.
Perhaps read from the file first, filling out a collection of name value
pairs then use your function to write the whole back to file again.

AddThis Social Bookmark Button