Rättat registryhantering + .CopyTo istället för MoveTo
This commit is contained in:
@ -20,7 +20,7 @@ namespace PictureReposit
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
RegistryKey PictureHandling = Registry.LocalMachine.OpenSubKey(@"Software\Tfoman\PictureHandling");
|
||||
RegistryKey PictureHandling = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Tfoman\PictureReposit");
|
||||
if (PictureHandling == null)
|
||||
{
|
||||
txtRootDir.Text = @"D:\Bildlabb\LabRotCat";
|
||||
@ -188,7 +188,22 @@ namespace PictureReposit
|
||||
|
||||
private void txtRootDir_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
//Software\Tfoman\PictureReposit
|
||||
RegistryKey Tfoman = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Tfoman", true);
|
||||
RegistryKey PictureHandling = Tfoman.OpenSubKey(@"PictureReposit", true);
|
||||
if (PictureHandling == null)
|
||||
{
|
||||
if (Tfoman == null)
|
||||
{
|
||||
Tfoman = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Tfoman");
|
||||
}
|
||||
else
|
||||
PictureHandling = Tfoman.CreateSubKey(@"PictureReposit");
|
||||
}
|
||||
else
|
||||
{
|
||||
PictureHandling.SetValue(@"RootMap", txtRootDir.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user