J
Jim Margarit
copied from MSDN help on Registry class:
string[] tArray = (string[])Registry.GetValue(keyName,"TestArray",
newstring[] {"Default if TestArray does not exist."});
Here's my code:
string[] defaultExt = {".mp4",".avi"};
string[] validExts;
validExts = (string[])Registry.GetValue("myTest","validExts",defaultExt);
if the registry is empty, this always returns null. I'm expecting
{".mp4",".avi"}.
if I make the next line:
if (validExts = null) Registry.SetValue("myTest","validExts",defaultExt);
and then repeat the getvalue line, it produces the expected result.
Is this a bug or "you just can't do that". The line from the help makes
it seem that it should work.
Jim
string[] tArray = (string[])Registry.GetValue(keyName,"TestArray",
newstring[] {"Default if TestArray does not exist."});
Here's my code:
string[] defaultExt = {".mp4",".avi"};
string[] validExts;
validExts = (string[])Registry.GetValue("myTest","validExts",defaultExt);
if the registry is empty, this always returns null. I'm expecting
{".mp4",".avi"}.
if I make the next line:
if (validExts = null) Registry.SetValue("myTest","validExts",defaultExt);
and then repeat the getvalue line, it produces the expected result.
Is this a bug or "you just can't do that". The line from the help makes
it seem that it should work.
Jim