Rättat registryhantering + .CopyTo istället för MoveTo
This commit is contained in:
4
PictureReposit/Form1.Designer.cs
generated
4
PictureReposit/Form1.Designer.cs
generated
@ -50,6 +50,9 @@ namespace PictureReposit
|
|||||||
//
|
//
|
||||||
// pictureBox1
|
// pictureBox1
|
||||||
//
|
//
|
||||||
|
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.pictureBox1.Location = new System.Drawing.Point(183, 72);
|
this.pictureBox1.Location = new System.Drawing.Point(183, 72);
|
||||||
this.pictureBox1.Name = "pictureBox1";
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
this.pictureBox1.Size = new System.Drawing.Size(654, 548);
|
this.pictureBox1.Size = new System.Drawing.Size(654, 548);
|
||||||
@ -150,6 +153,7 @@ namespace PictureReposit
|
|||||||
this.txtRootDir.Size = new System.Drawing.Size(164, 23);
|
this.txtRootDir.Size = new System.Drawing.Size(164, 23);
|
||||||
this.txtRootDir.TabIndex = 10;
|
this.txtRootDir.TabIndex = 10;
|
||||||
this.txtRootDir.Text = "D:\\Bildlabb\\LabRotCat";
|
this.txtRootDir.Text = "D:\\Bildlabb\\LabRotCat";
|
||||||
|
this.txtRootDir.TextChanged += new System.EventHandler(this.txtRootDir_TextChanged);
|
||||||
//
|
//
|
||||||
// Form1
|
// Form1
|
||||||
//
|
//
|
||||||
|
|||||||
@ -20,7 +20,7 @@ namespace PictureReposit
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
RegistryKey PictureHandling = Registry.LocalMachine.OpenSubKey(@"Software\Tfoman\PictureHandling");
|
RegistryKey PictureHandling = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Tfoman\PictureReposit");
|
||||||
if (PictureHandling == null)
|
if (PictureHandling == null)
|
||||||
{
|
{
|
||||||
txtRootDir.Text = @"D:\Bildlabb\LabRotCat";
|
txtRootDir.Text = @"D:\Bildlabb\LabRotCat";
|
||||||
@ -188,7 +188,22 @@ namespace PictureReposit
|
|||||||
|
|
||||||
private void txtRootDir_TextChanged(object sender, EventArgs e)
|
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