Code to append to resource files

N

Nick

I am trying to add to existing resource files in vb code.
The code below seems to overwrite the resource file, even
though I use OpenOrCreate file mode.

Dim fs As New FileStream("c:\items.resources", _
FileMode.OpenOrCreate, FileAccess.Write)
Dim writer = New ResourceWriter(fs)
writer.AddResource("String 3", "Third String")
writer.Close()

I tried using filemode Append, but then it appends the
whole resource file, including the header info, which I
presume is incorrect.

Thanks,
Nick
 
T

Tian Min Huang

Hi Nick,

Thanks for your post. .NET class library includes a class ResourceWriter
providing accesses to the resource file. Please refer to it in MSDN
documentation:

ResourceWriter Class
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemresourcesresourcewriterclasstopic.asp

Please feel free to let mke now if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top