How to add new string to Registry Entry of type REG_MULTI_SZ?

.net, c#, registry, windows

Solution

For a multi string value I would do this.

key.SetValue("MultipleStringValue", new string[] {"One", "Two", "Three"});

If it's a single value then as Wolfgang mentioned you should read existing and append.

Problem

I have 1 registry entry of type REG_MULTI_SZ. This entry already contains some string in it. Now i want to add 1 more string to it by using .net class`RegistryKey` . this class has method `key.SetValue(string,string)`. But when i use this method it removes all strings which are already there and then inserts new string, in short it overwrites. I don't want to touch strings which are already there, just want to add new string at the end. Anybody know how can we do this in C#.

Original source