J
James Roberts
hiya i'm using this piece of code
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Retrospect",
true);
if(key != null)
{
// Sets up the registry, when run for the first time.
// Creates the subkey and sets the key to the directory its in
key = Registry.CurrentUser.CreateSubKey(@"Software\Retrospect");
key.SetValue("Letumexe", folder + @"\" + self.ScopeName);
// and copies itself to the choosen directory
}
when i run i get an nullreferenceexception which i think has come from
if(key != null)
i have also tried if(key == null) with no luck
How can this be solved?
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Retrospect",
true);
if(key != null)
{
// Sets up the registry, when run for the first time.
// Creates the subkey and sets the key to the directory its in
key = Registry.CurrentUser.CreateSubKey(@"Software\Retrospect");
key.SetValue("Letumexe", folder + @"\" + self.ScopeName);
// and copies itself to the choosen directory
}
when i run i get an nullreferenceexception which i think has come from
if(key != null)
i have also tried if(key == null) with no luck
How can this be solved?