mirror of
https://github.com/Stone-Red-Code/AutoBackup.git
synced 2026-09-04 00:46:07 +02:00
Initial commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
* text=auto
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{9A045635-883B-4B86-88F4-C06CABC58D2C}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>AutoBackup</RootNamespace>
|
||||||
|
<AssemblyName>AutoBackup</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>Icons8-Windows-8-Database-Backup.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Backup.cs" />
|
||||||
|
<Compile Include="MainForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MainForm.Designer.cs">
|
||||||
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="MainForm.resx">
|
||||||
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\OFF.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\ON.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Icons8-Windows-8-Database-Backup.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.AccessControl;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AutoBackup
|
||||||
|
{
|
||||||
|
class Backup
|
||||||
|
{
|
||||||
|
volatile public int processCount = 0;
|
||||||
|
public List<string> currentStatus = new List<string>();
|
||||||
|
public bool windowVisible = false;
|
||||||
|
|
||||||
|
|
||||||
|
List<string> sourceFolders = new List<string>();
|
||||||
|
List<List<string>> destinationFolders = new List<List<string>>();
|
||||||
|
List<ulong[]> optionsList = new List<ulong[]>();
|
||||||
|
List<bool> isRunning = new List<bool>();
|
||||||
|
readonly Stopwatch stopwatch;
|
||||||
|
readonly Timer timer;
|
||||||
|
bool isON = false;
|
||||||
|
|
||||||
|
public Backup()
|
||||||
|
{
|
||||||
|
stopwatch = new Stopwatch();
|
||||||
|
timer = new Timer();
|
||||||
|
|
||||||
|
timer.Tick += Timer_Tick;
|
||||||
|
timer.Interval = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Timer_Tick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ulong milliseconds = (ulong)stopwatch.ElapsedMilliseconds;
|
||||||
|
stopwatch.Restart();
|
||||||
|
for (int index = 0; index < optionsList.Count; index++)
|
||||||
|
{
|
||||||
|
if (isRunning[index] == false)
|
||||||
|
{
|
||||||
|
optionsList[index][1] += milliseconds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CheckIfBackupRequired();
|
||||||
|
/*
|
||||||
|
else if (stopwatch.IsRunning)
|
||||||
|
{
|
||||||
|
//TimeSpan timeSpan = TimeSpan.FromMilliseconds(waitTimeMilliseconds - stopwatch.ElapsedMilliseconds + offset);
|
||||||
|
//currentStatus = "Time remaining to next Backup:" + timeSpan.ToString(@"dd\:hh\:mm\:ss");
|
||||||
|
//Console.WriteLine(waitTimeMilliseconds + "-" + stopwatch.ElapsedMilliseconds);
|
||||||
|
}
|
||||||
|
else if (isRunning == false)
|
||||||
|
{
|
||||||
|
currentStatus = "OFF";
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void CheckIfFilesChanged()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OFF()
|
||||||
|
{
|
||||||
|
isON = false;
|
||||||
|
stopwatch.Stop();
|
||||||
|
timer.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ON(List<string> _sourceFolders, List<List<string>> _destinationFolders, List<int[]> _optionsList)
|
||||||
|
{
|
||||||
|
sourceFolders.Clear();
|
||||||
|
destinationFolders.Clear();
|
||||||
|
optionsList.Clear();
|
||||||
|
isRunning.Clear();
|
||||||
|
currentStatus.Clear();
|
||||||
|
|
||||||
|
destinationFolders.AddRange(_destinationFolders);
|
||||||
|
sourceFolders.AddRange(_sourceFolders);
|
||||||
|
|
||||||
|
//sourceFolders = _sourceFolders;
|
||||||
|
//destinationFolders = _destinationFolders;
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
foreach (int[] timeOption in _optionsList)
|
||||||
|
{
|
||||||
|
ulong milliseconds = 0;
|
||||||
|
if (timeOption[1] == 0)
|
||||||
|
{
|
||||||
|
milliseconds = (ulong)timeOption[0] * 1000;
|
||||||
|
}
|
||||||
|
else if (timeOption[1] == 1)
|
||||||
|
{
|
||||||
|
milliseconds = (ulong)timeOption[0] * 60 * 1000;
|
||||||
|
}
|
||||||
|
else if (timeOption[1] == 2)
|
||||||
|
{
|
||||||
|
milliseconds = (ulong)timeOption[0] * 60 * 60 * 1000;
|
||||||
|
}
|
||||||
|
else if (timeOption[1] == 3)
|
||||||
|
{
|
||||||
|
milliseconds = (ulong)timeOption[0] * 24 * 60 * 60 * 1000;
|
||||||
|
}
|
||||||
|
else if (timeOption[1] == 4)
|
||||||
|
{
|
||||||
|
milliseconds = (ulong)timeOption[0] * 7 * 24 * 60 * 60 * 1000;
|
||||||
|
}
|
||||||
|
optionsList.Add(new ulong[3]);
|
||||||
|
optionsList[index][0] = milliseconds;
|
||||||
|
optionsList[index][2] = (ulong)_optionsList[index][2];
|
||||||
|
isRunning.Add(false);
|
||||||
|
currentStatus.Add(index + "_...");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
isON = true;
|
||||||
|
stopwatch.Start();
|
||||||
|
timer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CheckIfBackupRequired()
|
||||||
|
{
|
||||||
|
for (int index = 0; index < optionsList.Count; index++)
|
||||||
|
{
|
||||||
|
if (optionsList[index][0] < optionsList[index][1] && isRunning[index] == false)
|
||||||
|
{
|
||||||
|
isRunning[index] = true;
|
||||||
|
optionsList[index][1] = 0;
|
||||||
|
BackupFolder(index, optionsList[index][2]);
|
||||||
|
}
|
||||||
|
if (isRunning[index] == false)
|
||||||
|
{
|
||||||
|
TimeSpan timeSpan = TimeSpan.FromMilliseconds(optionsList[index][0] - optionsList[index][1]);
|
||||||
|
currentStatus[index] = "Time remaining to next Backup:" + timeSpan.ToString(@"dd\:hh\:mm\:ss") + " (" + sourceFolders[index] + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BackupFolder(int index, ulong maxBackupFolders)
|
||||||
|
{
|
||||||
|
if (index < destinationFolders.Count)
|
||||||
|
{
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
processCount++;
|
||||||
|
|
||||||
|
foreach (string destinationFolder in destinationFolders[index])
|
||||||
|
{
|
||||||
|
if (Directory.Exists(destinationFolder))
|
||||||
|
{
|
||||||
|
while ((ulong)Directory.GetDirectories(destinationFolder).Length > maxBackupFolders - 1 && maxBackupFolders > 0)
|
||||||
|
{
|
||||||
|
currentStatus[index] = "Deleting old backups";
|
||||||
|
FileSystemInfo fileInfo = new DirectoryInfo(destinationFolder).GetFileSystemInfos().OrderBy(fi => fi.CreationTime).First();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DeleteDirectory(fileInfo.FullName);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show(destinationFolder + " Does not exist!");
|
||||||
|
}
|
||||||
|
CopyDirecotory(sourceFolders[index], destinationFolder + "\\Backup " + DateTime.Now.ToString().Replace(":", "-").Replace("/",".").Replace("\\","."), index, GetFileCount(sourceFolders[index]));
|
||||||
|
}
|
||||||
|
processCount--;
|
||||||
|
|
||||||
|
isRunning[index] = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeleteDirectory(string targetDir)
|
||||||
|
{
|
||||||
|
File.SetAttributes(targetDir, FileAttributes.Normal);
|
||||||
|
|
||||||
|
string[] files = Directory.GetFiles(targetDir);
|
||||||
|
string[] dirs = Directory.GetDirectories(targetDir);
|
||||||
|
|
||||||
|
foreach (string file in files)
|
||||||
|
{
|
||||||
|
File.SetAttributes(file, FileAttributes.Normal);
|
||||||
|
File.Delete(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (string dir in dirs)
|
||||||
|
{
|
||||||
|
DeleteDirectory(dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
Directory.Delete(targetDir, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CopyDirecotory(string sourcePath, string destinationPath, int index, int fileCount, int filesCopied = 0)
|
||||||
|
{
|
||||||
|
if (isON == false) return 0;
|
||||||
|
if (!HasReadAccessToFolder(sourcePath)) return 0;
|
||||||
|
if (!Directory.Exists(destinationPath.Remove(destinationPath.LastIndexOf("\\"))))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(destinationPath);
|
||||||
|
}
|
||||||
|
if (!Directory.Exists(destinationPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(destinationPath);
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (string file in Directory.GetFiles(sourcePath))
|
||||||
|
{
|
||||||
|
if (isON == false) return 0;
|
||||||
|
|
||||||
|
if (windowVisible)
|
||||||
|
{
|
||||||
|
if (fileCount > 0)
|
||||||
|
{
|
||||||
|
currentStatus[index] = "Copying: (" + (Math.Round(100f / (float)fileCount * (float)filesCopied, 2)).ToString("0.0") + "%) " + file;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
currentStatus[index] = "Copying: (???%) " + file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.Copy(file, destinationPath + file.Substring(file.LastIndexOf("\\")), true);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.AppendAllText(destinationPath + "\\ErrorLog.txt", "\n" + ex);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
filesCopied++;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (string directory in Directory.GetDirectories(sourcePath))
|
||||||
|
{
|
||||||
|
filesCopied = CopyDirecotory(directory, destinationPath + directory.Substring(directory.LastIndexOf("\\")), index, fileCount, filesCopied);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.AppendAllText(destinationPath + "\\ErrorLog.txt", "\n" + ex);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
return filesCopied;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetFileCount(string path)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Directory.GetFiles(path, "*", SearchOption.AllDirectories).Length;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool HasReadAccessToFolder(string directoryPath)
|
||||||
|
{
|
||||||
|
bool hasAccess = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AuthorizationRuleCollection collection = Directory.
|
||||||
|
GetAccessControl(directoryPath)
|
||||||
|
.GetAccessRules(true, true, typeof(System.Security.Principal.NTAccount));
|
||||||
|
foreach (FileSystemAccessRule rule in collection)
|
||||||
|
{
|
||||||
|
if ((rule.FileSystemRights & System.Security.AccessControl.FileSystemRights.ReadData) > 0)
|
||||||
|
{
|
||||||
|
return hasAccess;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
hasAccess = false;
|
||||||
|
}
|
||||||
|
return hasAccess;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 163 KiB |
Generated
+397
@@ -0,0 +1,397 @@
|
|||||||
|
namespace AutoBackup
|
||||||
|
{
|
||||||
|
partial class MainForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Erforderliche Designervariable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Verwendete Ressourcen bereinigen.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Vom Windows Form-Designer generierter Code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Erforderliche Methode für die Designerunterstützung.
|
||||||
|
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.components = new System.ComponentModel.Container();
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||||
|
this.sourceFoldersListBox = new System.Windows.Forms.ListBox();
|
||||||
|
this.destinationFoldersListBox = new System.Windows.Forms.ListBox();
|
||||||
|
this.addSourceFolderButton = new System.Windows.Forms.Button();
|
||||||
|
this.removeSourceFolderButton = new System.Windows.Forms.Button();
|
||||||
|
this.removeDestinationFolderButton = new System.Windows.Forms.Button();
|
||||||
|
this.addDestinationFolderButton = new System.Windows.Forms.Button();
|
||||||
|
this.MainTimer = new System.Windows.Forms.Timer(this.components);
|
||||||
|
this.addFolderPopup = new System.Windows.Forms.Panel();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.selectFolderButton = new System.Windows.Forms.Button();
|
||||||
|
this.selectFolderPathTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.cancelButton = new System.Windows.Forms.Button();
|
||||||
|
this.okButton = new System.Windows.Forms.Button();
|
||||||
|
this.onOffToggleButton = new System.Windows.Forms.Button();
|
||||||
|
this.mainPanel = new System.Windows.Forms.Panel();
|
||||||
|
this.optionsPanel = new System.Windows.Forms.Panel();
|
||||||
|
this.maxBackupsNumericUpDown = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.timeUnitComboBox = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.backupTimeNumericUpDown = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.destinationDirectoriesLabel = new System.Windows.Forms.Label();
|
||||||
|
this.sourceDirectoriesLabel = new System.Windows.Forms.Label();
|
||||||
|
this.statusLabel = new System.Windows.Forms.Label();
|
||||||
|
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||||
|
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
|
||||||
|
this.addFolderPopup.SuspendLayout();
|
||||||
|
this.mainPanel.SuspendLayout();
|
||||||
|
this.optionsPanel.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.maxBackupsNumericUpDown)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.backupTimeNumericUpDown)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// sourceFoldersListBox
|
||||||
|
//
|
||||||
|
this.sourceFoldersListBox.FormattingEnabled = true;
|
||||||
|
this.sourceFoldersListBox.Location = new System.Drawing.Point(12, 23);
|
||||||
|
this.sourceFoldersListBox.Name = "sourceFoldersListBox";
|
||||||
|
this.sourceFoldersListBox.Size = new System.Drawing.Size(263, 173);
|
||||||
|
this.sourceFoldersListBox.TabIndex = 0;
|
||||||
|
this.sourceFoldersListBox.SelectedIndexChanged += new System.EventHandler(this.SourceFoldersListBox_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// destinationFoldersListBox
|
||||||
|
//
|
||||||
|
this.destinationFoldersListBox.FormattingEnabled = true;
|
||||||
|
this.destinationFoldersListBox.Location = new System.Drawing.Point(480, 23);
|
||||||
|
this.destinationFoldersListBox.Name = "destinationFoldersListBox";
|
||||||
|
this.destinationFoldersListBox.Size = new System.Drawing.Size(263, 173);
|
||||||
|
this.destinationFoldersListBox.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// addSourceFolderButton
|
||||||
|
//
|
||||||
|
this.addSourceFolderButton.Location = new System.Drawing.Point(12, 202);
|
||||||
|
this.addSourceFolderButton.Name = "addSourceFolderButton";
|
||||||
|
this.addSourceFolderButton.Size = new System.Drawing.Size(108, 23);
|
||||||
|
this.addSourceFolderButton.TabIndex = 2;
|
||||||
|
this.addSourceFolderButton.Text = "Add Folder";
|
||||||
|
this.addSourceFolderButton.UseVisualStyleBackColor = true;
|
||||||
|
this.addSourceFolderButton.Click += new System.EventHandler(this.AddSourceFolderButton_Click);
|
||||||
|
//
|
||||||
|
// removeSourceFolderButton
|
||||||
|
//
|
||||||
|
this.removeSourceFolderButton.Location = new System.Drawing.Point(167, 202);
|
||||||
|
this.removeSourceFolderButton.Name = "removeSourceFolderButton";
|
||||||
|
this.removeSourceFolderButton.Size = new System.Drawing.Size(108, 23);
|
||||||
|
this.removeSourceFolderButton.TabIndex = 3;
|
||||||
|
this.removeSourceFolderButton.Text = "Remove Folder";
|
||||||
|
this.removeSourceFolderButton.UseVisualStyleBackColor = true;
|
||||||
|
this.removeSourceFolderButton.Click += new System.EventHandler(this.RemoveSourceFolderButton_Click);
|
||||||
|
//
|
||||||
|
// removeDestinationFolderButton
|
||||||
|
//
|
||||||
|
this.removeDestinationFolderButton.Location = new System.Drawing.Point(635, 201);
|
||||||
|
this.removeDestinationFolderButton.Name = "removeDestinationFolderButton";
|
||||||
|
this.removeDestinationFolderButton.Size = new System.Drawing.Size(108, 23);
|
||||||
|
this.removeDestinationFolderButton.TabIndex = 5;
|
||||||
|
this.removeDestinationFolderButton.Text = "Remove Folder";
|
||||||
|
this.removeDestinationFolderButton.UseVisualStyleBackColor = true;
|
||||||
|
this.removeDestinationFolderButton.Click += new System.EventHandler(this.RemoveDestinationFolderButton_Click);
|
||||||
|
//
|
||||||
|
// addDestinationFolderButton
|
||||||
|
//
|
||||||
|
this.addDestinationFolderButton.Location = new System.Drawing.Point(480, 202);
|
||||||
|
this.addDestinationFolderButton.Name = "addDestinationFolderButton";
|
||||||
|
this.addDestinationFolderButton.Size = new System.Drawing.Size(108, 23);
|
||||||
|
this.addDestinationFolderButton.TabIndex = 4;
|
||||||
|
this.addDestinationFolderButton.Text = "Add Folder";
|
||||||
|
this.addDestinationFolderButton.UseVisualStyleBackColor = true;
|
||||||
|
this.addDestinationFolderButton.Click += new System.EventHandler(this.AddDestinationFolderButton_Click);
|
||||||
|
//
|
||||||
|
// MainTimer
|
||||||
|
//
|
||||||
|
this.MainTimer.Tick += new System.EventHandler(this.MainTimer_Tick);
|
||||||
|
//
|
||||||
|
// addFolderPopup
|
||||||
|
//
|
||||||
|
this.addFolderPopup.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||||
|
this.addFolderPopup.Controls.Add(this.label1);
|
||||||
|
this.addFolderPopup.Controls.Add(this.selectFolderButton);
|
||||||
|
this.addFolderPopup.Controls.Add(this.selectFolderPathTextBox);
|
||||||
|
this.addFolderPopup.Controls.Add(this.cancelButton);
|
||||||
|
this.addFolderPopup.Controls.Add(this.okButton);
|
||||||
|
this.addFolderPopup.Location = new System.Drawing.Point(312, 321);
|
||||||
|
this.addFolderPopup.Name = "addFolderPopup";
|
||||||
|
this.addFolderPopup.Size = new System.Drawing.Size(276, 161);
|
||||||
|
this.addFolderPopup.TabIndex = 6;
|
||||||
|
this.addFolderPopup.Visible = false;
|
||||||
|
this.addFolderPopup.VisibleChanged += new System.EventHandler(this.AddFolderPopup_VisibleChanged);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(4, 51);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(72, 13);
|
||||||
|
this.label1.TabIndex = 4;
|
||||||
|
this.label1.Text = "Select Folder:";
|
||||||
|
//
|
||||||
|
// selectFolderButton
|
||||||
|
//
|
||||||
|
this.selectFolderButton.Location = new System.Drawing.Point(246, 70);
|
||||||
|
this.selectFolderButton.Name = "selectFolderButton";
|
||||||
|
this.selectFolderButton.Size = new System.Drawing.Size(27, 20);
|
||||||
|
this.selectFolderButton.TabIndex = 3;
|
||||||
|
this.selectFolderButton.Text = "...";
|
||||||
|
this.selectFolderButton.UseVisualStyleBackColor = true;
|
||||||
|
this.selectFolderButton.Click += new System.EventHandler(this.SelectFolderButton_Click);
|
||||||
|
//
|
||||||
|
// selectFolderPathTextBox
|
||||||
|
//
|
||||||
|
this.selectFolderPathTextBox.Location = new System.Drawing.Point(4, 70);
|
||||||
|
this.selectFolderPathTextBox.Multiline = true;
|
||||||
|
this.selectFolderPathTextBox.Name = "selectFolderPathTextBox";
|
||||||
|
this.selectFolderPathTextBox.Size = new System.Drawing.Size(239, 20);
|
||||||
|
this.selectFolderPathTextBox.TabIndex = 2;
|
||||||
|
this.selectFolderPathTextBox.TextChanged += new System.EventHandler(this.SelectFolderPathTextBox_TextChanged);
|
||||||
|
//
|
||||||
|
// cancelButton
|
||||||
|
//
|
||||||
|
this.cancelButton.Location = new System.Drawing.Point(198, 135);
|
||||||
|
this.cancelButton.Name = "cancelButton";
|
||||||
|
this.cancelButton.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.cancelButton.TabIndex = 1;
|
||||||
|
this.cancelButton.Text = "CANCEL";
|
||||||
|
this.cancelButton.UseVisualStyleBackColor = true;
|
||||||
|
this.cancelButton.Click += new System.EventHandler(this.CancelButton_Click);
|
||||||
|
//
|
||||||
|
// okButton
|
||||||
|
//
|
||||||
|
this.okButton.Location = new System.Drawing.Point(3, 135);
|
||||||
|
this.okButton.Name = "okButton";
|
||||||
|
this.okButton.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.okButton.TabIndex = 0;
|
||||||
|
this.okButton.Text = "OK";
|
||||||
|
this.okButton.UseVisualStyleBackColor = true;
|
||||||
|
this.okButton.Click += new System.EventHandler(this.OkButton_Click);
|
||||||
|
//
|
||||||
|
// onOffToggleButton
|
||||||
|
//
|
||||||
|
this.onOffToggleButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.onOffToggleButton.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.onOffToggleButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("onOffToggleButton.BackgroundImage")));
|
||||||
|
this.onOffToggleButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||||
|
this.onOffToggleButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.onOffToggleButton.Location = new System.Drawing.Point(12, 459);
|
||||||
|
this.onOffToggleButton.Name = "onOffToggleButton";
|
||||||
|
this.onOffToggleButton.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||||
|
this.onOffToggleButton.Size = new System.Drawing.Size(70, 23);
|
||||||
|
this.onOffToggleButton.TabIndex = 7;
|
||||||
|
this.onOffToggleButton.UseVisualStyleBackColor = false;
|
||||||
|
this.onOffToggleButton.Click += new System.EventHandler(this.OnOffToggleButton_Click);
|
||||||
|
//
|
||||||
|
// mainPanel
|
||||||
|
//
|
||||||
|
this.mainPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.mainPanel.Controls.Add(this.addFolderPopup);
|
||||||
|
this.mainPanel.Controls.Add(this.optionsPanel);
|
||||||
|
this.mainPanel.Controls.Add(this.destinationDirectoriesLabel);
|
||||||
|
this.mainPanel.Controls.Add(this.sourceDirectoriesLabel);
|
||||||
|
this.mainPanel.Controls.Add(this.sourceFoldersListBox);
|
||||||
|
this.mainPanel.Controls.Add(this.addSourceFolderButton);
|
||||||
|
this.mainPanel.Controls.Add(this.removeSourceFolderButton);
|
||||||
|
this.mainPanel.Controls.Add(this.removeDestinationFolderButton);
|
||||||
|
this.mainPanel.Controls.Add(this.destinationFoldersListBox);
|
||||||
|
this.mainPanel.Controls.Add(this.addDestinationFolderButton);
|
||||||
|
this.mainPanel.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.mainPanel.Name = "mainPanel";
|
||||||
|
this.mainPanel.Size = new System.Drawing.Size(774, 440);
|
||||||
|
this.mainPanel.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// optionsPanel
|
||||||
|
//
|
||||||
|
this.optionsPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.optionsPanel.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.optionsPanel.Controls.Add(this.maxBackupsNumericUpDown);
|
||||||
|
this.optionsPanel.Controls.Add(this.label3);
|
||||||
|
this.optionsPanel.Controls.Add(this.timeUnitComboBox);
|
||||||
|
this.optionsPanel.Controls.Add(this.label2);
|
||||||
|
this.optionsPanel.Controls.Add(this.backupTimeNumericUpDown);
|
||||||
|
this.optionsPanel.Location = new System.Drawing.Point(0, 250);
|
||||||
|
this.optionsPanel.Name = "optionsPanel";
|
||||||
|
this.optionsPanel.Size = new System.Drawing.Size(256, 100);
|
||||||
|
this.optionsPanel.TabIndex = 12;
|
||||||
|
//
|
||||||
|
// maxBackupsNumericUpDown
|
||||||
|
//
|
||||||
|
this.maxBackupsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.maxBackupsNumericUpDown.Location = new System.Drawing.Point(93, 69);
|
||||||
|
this.maxBackupsNumericUpDown.Name = "maxBackupsNumericUpDown";
|
||||||
|
this.maxBackupsNumericUpDown.Size = new System.Drawing.Size(50, 20);
|
||||||
|
this.maxBackupsNumericUpDown.TabIndex = 13;
|
||||||
|
this.maxBackupsNumericUpDown.Value = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.maxBackupsNumericUpDown.ValueChanged += new System.EventHandler(this.MaxBackupsNumericUpDown_ValueChanged);
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(15, 71);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(75, 13);
|
||||||
|
this.label3.TabIndex = 12;
|
||||||
|
this.label3.Text = "Max Backups:";
|
||||||
|
//
|
||||||
|
// timeUnitComboBox
|
||||||
|
//
|
||||||
|
this.timeUnitComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.timeUnitComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.timeUnitComboBox.Items.AddRange(new object[] {
|
||||||
|
"seconds",
|
||||||
|
"minutes",
|
||||||
|
"hours",
|
||||||
|
"days",
|
||||||
|
"weeks"});
|
||||||
|
this.timeUnitComboBox.Location = new System.Drawing.Point(146, 38);
|
||||||
|
this.timeUnitComboBox.Name = "timeUnitComboBox";
|
||||||
|
this.timeUnitComboBox.Size = new System.Drawing.Size(94, 21);
|
||||||
|
this.timeUnitComboBox.TabIndex = 11;
|
||||||
|
this.timeUnitComboBox.SelectedIndexChanged += new System.EventHandler(this.TimeUnitComboBox_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(14, 40);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(76, 13);
|
||||||
|
this.label2.TabIndex = 9;
|
||||||
|
this.label2.Text = "Backup every:";
|
||||||
|
//
|
||||||
|
// backupTimeNumericUpDown
|
||||||
|
//
|
||||||
|
this.backupTimeNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.backupTimeNumericUpDown.Location = new System.Drawing.Point(93, 38);
|
||||||
|
this.backupTimeNumericUpDown.Minimum = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.backupTimeNumericUpDown.Name = "backupTimeNumericUpDown";
|
||||||
|
this.backupTimeNumericUpDown.Size = new System.Drawing.Size(50, 20);
|
||||||
|
this.backupTimeNumericUpDown.TabIndex = 10;
|
||||||
|
this.backupTimeNumericUpDown.Value = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.backupTimeNumericUpDown.ValueChanged += new System.EventHandler(this.BackupTimeNumericUpDown_ValueChanged);
|
||||||
|
//
|
||||||
|
// destinationDirectoriesLabel
|
||||||
|
//
|
||||||
|
this.destinationDirectoriesLabel.AutoSize = true;
|
||||||
|
this.destinationDirectoriesLabel.Location = new System.Drawing.Point(560, 9);
|
||||||
|
this.destinationDirectoriesLabel.Name = "destinationDirectoriesLabel";
|
||||||
|
this.destinationDirectoriesLabel.Size = new System.Drawing.Size(113, 13);
|
||||||
|
this.destinationDirectoriesLabel.TabIndex = 7;
|
||||||
|
this.destinationDirectoriesLabel.Text = "Destination Directories";
|
||||||
|
//
|
||||||
|
// sourceDirectoriesLabel
|
||||||
|
//
|
||||||
|
this.sourceDirectoriesLabel.AutoSize = true;
|
||||||
|
this.sourceDirectoriesLabel.Location = new System.Drawing.Point(96, 9);
|
||||||
|
this.sourceDirectoriesLabel.Name = "sourceDirectoriesLabel";
|
||||||
|
this.sourceDirectoriesLabel.Size = new System.Drawing.Size(94, 13);
|
||||||
|
this.sourceDirectoriesLabel.TabIndex = 6;
|
||||||
|
this.sourceDirectoriesLabel.Text = "Source Directories";
|
||||||
|
//
|
||||||
|
// statusLabel
|
||||||
|
//
|
||||||
|
this.statusLabel.AutoSize = true;
|
||||||
|
this.statusLabel.Location = new System.Drawing.Point(177, 456);
|
||||||
|
this.statusLabel.Name = "statusLabel";
|
||||||
|
this.statusLabel.Size = new System.Drawing.Size(73, 13);
|
||||||
|
this.statusLabel.TabIndex = 9;
|
||||||
|
this.statusLabel.Text = "statusLabel ";
|
||||||
|
//
|
||||||
|
// notifyIcon
|
||||||
|
//
|
||||||
|
this.notifyIcon.Text = "notifyIcon1";
|
||||||
|
this.notifyIcon.Visible = true;
|
||||||
|
this.notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon_MouseClick);
|
||||||
|
//
|
||||||
|
// MainForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(758, 494);
|
||||||
|
this.Controls.Add(this.onOffToggleButton);
|
||||||
|
this.Controls.Add(this.statusLabel);
|
||||||
|
this.Controls.Add(this.mainPanel);
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.MinimumSize = new System.Drawing.Size(500, 395);
|
||||||
|
this.Name = "MainForm";
|
||||||
|
this.Text = "Auto Backup";
|
||||||
|
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||||
|
this.SizeChanged += new System.EventHandler(this.MainForm_SizeChanged);
|
||||||
|
this.addFolderPopup.ResumeLayout(false);
|
||||||
|
this.addFolderPopup.PerformLayout();
|
||||||
|
this.mainPanel.ResumeLayout(false);
|
||||||
|
this.mainPanel.PerformLayout();
|
||||||
|
this.optionsPanel.ResumeLayout(false);
|
||||||
|
this.optionsPanel.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.maxBackupsNumericUpDown)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.backupTimeNumericUpDown)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.ListBox sourceFoldersListBox;
|
||||||
|
private System.Windows.Forms.ListBox destinationFoldersListBox;
|
||||||
|
private System.Windows.Forms.Button addSourceFolderButton;
|
||||||
|
private System.Windows.Forms.Button removeSourceFolderButton;
|
||||||
|
private System.Windows.Forms.Button removeDestinationFolderButton;
|
||||||
|
private System.Windows.Forms.Button addDestinationFolderButton;
|
||||||
|
private System.Windows.Forms.Timer MainTimer;
|
||||||
|
private System.Windows.Forms.Panel addFolderPopup;
|
||||||
|
private System.Windows.Forms.Button cancelButton;
|
||||||
|
private System.Windows.Forms.Button okButton;
|
||||||
|
private System.Windows.Forms.Button selectFolderButton;
|
||||||
|
private System.Windows.Forms.TextBox selectFolderPathTextBox;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Button onOffToggleButton;
|
||||||
|
private System.Windows.Forms.Panel mainPanel;
|
||||||
|
private System.Windows.Forms.Label destinationDirectoriesLabel;
|
||||||
|
private System.Windows.Forms.Label sourceDirectoriesLabel;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.ComboBox timeUnitComboBox;
|
||||||
|
private System.Windows.Forms.NumericUpDown backupTimeNumericUpDown;
|
||||||
|
private System.Windows.Forms.Label statusLabel;
|
||||||
|
private System.Windows.Forms.NotifyIcon notifyIcon;
|
||||||
|
private System.Windows.Forms.Panel optionsPanel;
|
||||||
|
private System.Windows.Forms.NumericUpDown maxBackupsNumericUpDown;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.ToolTip toolTip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+390
@@ -0,0 +1,390 @@
|
|||||||
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AutoBackup
|
||||||
|
{
|
||||||
|
public partial class MainForm : Form
|
||||||
|
{
|
||||||
|
List<string> sourceFolders = new List<string>();
|
||||||
|
List<List<string>> destinationFolders = new List<List<string>>();
|
||||||
|
List<int[]> optionsList = new List<int[]>();
|
||||||
|
readonly Backup backup;
|
||||||
|
|
||||||
|
bool addSourceFolder = true;
|
||||||
|
bool blockWrite = false;
|
||||||
|
|
||||||
|
readonly string localApplicationDataPath;
|
||||||
|
|
||||||
|
const string AppName = "AutoBackup";
|
||||||
|
const string registrykey = "HKEY_CURRENT_USER\\" + AppName;
|
||||||
|
|
||||||
|
public MainForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
localApplicationDataPath = Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + "\\" + AppName;
|
||||||
|
|
||||||
|
LoadFolders();
|
||||||
|
|
||||||
|
backup = new Backup();
|
||||||
|
|
||||||
|
if (!Directory.Exists(localApplicationDataPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(localApplicationDataPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if ((string)Registry.GetValue(registrykey, "OnOff", "Off") == "On")
|
||||||
|
{
|
||||||
|
OnOffToggleButton_Click(null, null);
|
||||||
|
this.ShowInTaskbar = false;
|
||||||
|
this.Visible = false;
|
||||||
|
this.WindowState = FormWindowState.Minimized;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
MainForm_SizeChanged(null, null);
|
||||||
|
MainTimer.Start();
|
||||||
|
|
||||||
|
notifyIcon.Icon = this.Icon;
|
||||||
|
notifyIcon.Visible = true;
|
||||||
|
notifyIcon.Text = this.Text;
|
||||||
|
|
||||||
|
toolTip.SetToolTip(maxBackupsNumericUpDown, "0 = no limit");
|
||||||
|
|
||||||
|
statusLabel.Location = new Point(13,13);
|
||||||
|
//CopyDirecotory("D:\\Test","D:\\TestCopy");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainTimer_Tick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (sourceFoldersListBox.SelectedIndex > -1)
|
||||||
|
{
|
||||||
|
addDestinationFolderButton.Enabled = true;
|
||||||
|
removeSourceFolderButton.Enabled = true;
|
||||||
|
optionsPanel.Enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addDestinationFolderButton.Enabled = false;
|
||||||
|
removeSourceFolderButton.Enabled = false;
|
||||||
|
optionsPanel.Enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (destinationFoldersListBox.SelectedIndex > -1)
|
||||||
|
{
|
||||||
|
removeDestinationFolderButton.Enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
removeDestinationFolderButton.Enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//statusLabel.Text = backup.processCount.ToString();
|
||||||
|
//statusLabel.Text = "";
|
||||||
|
string textToDisplay = "";
|
||||||
|
List<string> statusList = new List<string>();
|
||||||
|
statusList.AddRange(backup.currentStatus);
|
||||||
|
foreach (string status in statusList)
|
||||||
|
{
|
||||||
|
textToDisplay += status + "\n";
|
||||||
|
}
|
||||||
|
statusLabel.Text = textToDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoadFolders()
|
||||||
|
{
|
||||||
|
if (!File.Exists(localApplicationDataPath + "\\data.save"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
|
|
||||||
|
sourceFoldersListBox.Items.Clear();
|
||||||
|
destinationFoldersListBox.Items.Clear();
|
||||||
|
sourceFolders.Clear();
|
||||||
|
destinationFolders.Clear();
|
||||||
|
optionsList.Clear();
|
||||||
|
|
||||||
|
foreach (string _line in lines)
|
||||||
|
{
|
||||||
|
string line = _line;
|
||||||
|
destinationFolders.Add(new List<string>());
|
||||||
|
optionsList.Add(new int[3]);
|
||||||
|
|
||||||
|
string options = line.Substring(line.LastIndexOf(">"));
|
||||||
|
line = line.Replace(options, "");
|
||||||
|
|
||||||
|
string o3 = options.Substring(options.LastIndexOf(";")+1);
|
||||||
|
options = options.Remove(options.LastIndexOf(";"));
|
||||||
|
string o2 = options.Substring(options.LastIndexOf(";"));
|
||||||
|
options = options.Replace(o2, "");
|
||||||
|
string o1 = options.Replace(">", "");
|
||||||
|
|
||||||
|
optionsList[index][2] = int.Parse(o3);
|
||||||
|
optionsList[index][1] = int.Parse(o2.Replace(";", ""));
|
||||||
|
optionsList[index][0] = int.Parse(o1);
|
||||||
|
|
||||||
|
while (line.Contains("|"))
|
||||||
|
{
|
||||||
|
string folder = line.Substring(line.LastIndexOf("|"));
|
||||||
|
line = line.Replace(folder, "");
|
||||||
|
|
||||||
|
destinationFolders[index].Add(folder.Remove(0, 1));
|
||||||
|
}
|
||||||
|
sourceFolders.Add(line);
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
sourceFoldersListBox.Items.AddRange(sourceFolders.ToArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddSourceFolderButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
addSourceFolder = true;
|
||||||
|
addFolderPopup.Visible = true;
|
||||||
|
addFolderPopup.BringToFront();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveSourceFolderButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (sourceFoldersListBox.SelectedIndex > -1)
|
||||||
|
{
|
||||||
|
List<string> lines = File.ReadAllLines(localApplicationDataPath + "\\data.save").ToList();
|
||||||
|
lines.RemoveAt(sourceFoldersListBox.SelectedIndex);
|
||||||
|
File.WriteAllLines(localApplicationDataPath + "\\data.save", lines.ToArray());
|
||||||
|
LoadFolders();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddDestinationFolderButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
addSourceFolder = false;
|
||||||
|
addFolderPopup.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveDestinationFolderButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (destinationFoldersListBox.SelectedIndex > -1)
|
||||||
|
{
|
||||||
|
List<string> destFolders = destinationFolders[sourceFoldersListBox.SelectedIndex];
|
||||||
|
destFolders.RemoveAt(destinationFoldersListBox.SelectedIndex);
|
||||||
|
|
||||||
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
|
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
||||||
|
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] = sourceFolders[sourceFoldersListBox.SelectedIndex];
|
||||||
|
//lines[sourceFoldersListBox.SelectedIndex] = lines[sourceFoldersListBox.SelectedIndex].Replace(options, "");
|
||||||
|
|
||||||
|
foreach (string folder in destFolders)
|
||||||
|
{
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] += "|" + folder;
|
||||||
|
}
|
||||||
|
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] += options;
|
||||||
|
File.WriteAllLines(localApplicationDataPath + "\\data.save", lines);
|
||||||
|
LoadFolders();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SelectFolderButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
using (var fbd = new FolderBrowserDialog())
|
||||||
|
{
|
||||||
|
DialogResult result = fbd.ShowDialog();
|
||||||
|
|
||||||
|
if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
|
||||||
|
{
|
||||||
|
selectFolderPathTextBox.Text = fbd.SelectedPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OkButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Directory.Exists(selectFolderPathTextBox.Text))
|
||||||
|
{
|
||||||
|
if (!File.Exists(localApplicationDataPath + "\\data.save"))
|
||||||
|
{
|
||||||
|
File.Create(localApplicationDataPath + "\\data.save").Close();
|
||||||
|
}
|
||||||
|
if (addSourceFolder == true)
|
||||||
|
{
|
||||||
|
File.AppendAllText(localApplicationDataPath + "\\data.save", selectFolderPathTextBox.Text + ">1;1;1" + "\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
|
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] = lines[sourceFoldersListBox.SelectedIndex].Replace(options, "");
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] += "|" + selectFolderPathTextBox.Text + options;
|
||||||
|
File.WriteAllLines(localApplicationDataPath + "\\data.save", lines);
|
||||||
|
}
|
||||||
|
addFolderPopup.Visible = false;
|
||||||
|
LoadFolders();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Folder does not Exsit!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CancelButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
addFolderPopup.Visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SelectFolderPathTextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Directory.Exists(selectFolderPathTextBox.Text))
|
||||||
|
{
|
||||||
|
selectFolderPathTextBox.ForeColor = Color.Black;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
selectFolderPathTextBox.ForeColor = Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddFolderPopup_VisibleChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
selectFolderPathTextBox.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SourceFoldersListBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
destinationFoldersListBox.Items.Clear();
|
||||||
|
if (sourceFoldersListBox.SelectedIndex < destinationFolders.Count && sourceFoldersListBox.SelectedIndex > -1)
|
||||||
|
{
|
||||||
|
blockWrite = true;
|
||||||
|
destinationFoldersListBox.Items.AddRange(destinationFolders[sourceFoldersListBox.SelectedIndex].ToArray());
|
||||||
|
backupTimeNumericUpDown.Value = optionsList[sourceFoldersListBox.SelectedIndex][0];
|
||||||
|
timeUnitComboBox.SelectedIndex = optionsList[sourceFoldersListBox.SelectedIndex][1];
|
||||||
|
maxBackupsNumericUpDown.Value = optionsList[sourceFoldersListBox.SelectedIndex][2];
|
||||||
|
blockWrite = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnOffToggleButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (onOffToggleButton.BackColor == Color.Red)
|
||||||
|
{
|
||||||
|
onOffToggleButton.BackColor = Color.Green;
|
||||||
|
onOffToggleButton.BackgroundImage = Properties.Resources.ON;
|
||||||
|
mainPanel.Visible = false;
|
||||||
|
addFolderPopup.Visible = false;
|
||||||
|
statusLabel.Visible = true;
|
||||||
|
backup.ON(sourceFolders, destinationFolders, optionsList);
|
||||||
|
Registry.SetValue(registrykey, "OnOff", "On");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
onOffToggleButton.BackColor = Color.Red;
|
||||||
|
onOffToggleButton.BackgroundImage = Properties.Resources.OFF;
|
||||||
|
mainPanel.Visible = true;
|
||||||
|
statusLabel.Visible = false;
|
||||||
|
backup.OFF();
|
||||||
|
Registry.SetValue(registrykey, "OnOff", "Off");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BackupTimeNumericUpDown_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (blockWrite) return;
|
||||||
|
//Registry.SetValue(registrykey, "backupTime", backupTimeNumericUpDown.Value);
|
||||||
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
|
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] = lines[sourceFoldersListBox.SelectedIndex].Replace(options, "");
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] += ">" + backupTimeNumericUpDown.Value + ";" + timeUnitComboBox.SelectedIndex + ";" + maxBackupsNumericUpDown.Value;
|
||||||
|
File.WriteAllLines(localApplicationDataPath + "\\data.save", lines);
|
||||||
|
|
||||||
|
optionsList[sourceFoldersListBox.SelectedIndex][0] = (int)backupTimeNumericUpDown.Value;
|
||||||
|
optionsList[sourceFoldersListBox.SelectedIndex][1] = timeUnitComboBox.SelectedIndex;
|
||||||
|
optionsList[sourceFoldersListBox.SelectedIndex][2] = (int)maxBackupsNumericUpDown.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TimeUnitComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (blockWrite) return;
|
||||||
|
//Registry.SetValue(registrykey, "timeUnit", timeUnitComboBox.SelectedIndex);
|
||||||
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
|
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] = lines[sourceFoldersListBox.SelectedIndex].Replace(options, "");
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] += ">" + backupTimeNumericUpDown.Value + ";" + timeUnitComboBox.SelectedIndex + ";" + maxBackupsNumericUpDown.Value;
|
||||||
|
File.WriteAllLines(localApplicationDataPath + "\\data.save", lines);
|
||||||
|
|
||||||
|
optionsList[sourceFoldersListBox.SelectedIndex][0] = (int)backupTimeNumericUpDown.Value;
|
||||||
|
optionsList[sourceFoldersListBox.SelectedIndex][1] = timeUnitComboBox.SelectedIndex;
|
||||||
|
optionsList[sourceFoldersListBox.SelectedIndex][2] = (int)maxBackupsNumericUpDown.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MaxBackupsNumericUpDown_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (blockWrite) return;
|
||||||
|
//Registry.SetValue(registrykey, "timeUnit", timeUnitComboBox.SelectedIndex);
|
||||||
|
string[] lines = File.ReadAllLines(localApplicationDataPath + "\\data.save");
|
||||||
|
string options = lines[sourceFoldersListBox.SelectedIndex].Substring(lines[sourceFoldersListBox.SelectedIndex].LastIndexOf(">"));
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] = lines[sourceFoldersListBox.SelectedIndex].Replace(options, "");
|
||||||
|
lines[sourceFoldersListBox.SelectedIndex] += ">" + backupTimeNumericUpDown.Value + ";" + timeUnitComboBox.SelectedIndex + ";" + maxBackupsNumericUpDown.Value;
|
||||||
|
File.WriteAllLines(localApplicationDataPath + "\\data.save", lines);
|
||||||
|
|
||||||
|
optionsList[sourceFoldersListBox.SelectedIndex][0] = (int)backupTimeNumericUpDown.Value;
|
||||||
|
optionsList[sourceFoldersListBox.SelectedIndex][1] = timeUnitComboBox.SelectedIndex;
|
||||||
|
optionsList[sourceFoldersListBox.SelectedIndex][2] = (int)maxBackupsNumericUpDown.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
this.WindowState = FormWindowState.Normal;
|
||||||
|
this.Visible = true;
|
||||||
|
this.ShowInTaskbar = true;
|
||||||
|
backup.windowVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainForm_SizeChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
addFolderPopup.Location = new Point(this.Width / 2 - addFolderPopup.Width / 2, this.Height / 2 - addFolderPopup.Height / 2);
|
||||||
|
|
||||||
|
int space = 20;
|
||||||
|
|
||||||
|
sourceFoldersListBox.Height = this.Height - 243;
|
||||||
|
sourceFoldersListBox.Width = this.Width / 2 - 13 - space;
|
||||||
|
|
||||||
|
destinationFoldersListBox.Height = this.Height - 243;
|
||||||
|
destinationFoldersListBox.Location = new Point(this.Width / 2 - 15 + space, destinationFoldersListBox.Location.Y);
|
||||||
|
destinationFoldersListBox.Width = this.Width / 2 - 13 - space;
|
||||||
|
|
||||||
|
addSourceFolderButton.Location = new Point(sourceFoldersListBox.Location.X, sourceFoldersListBox.Height + 25);
|
||||||
|
removeSourceFolderButton.Location = new Point(sourceFoldersListBox.Location.X + sourceFoldersListBox.Width - removeSourceFolderButton.Width, sourceFoldersListBox.Height + 25);
|
||||||
|
|
||||||
|
addDestinationFolderButton.Location = new Point(destinationFoldersListBox.Location.X, destinationFoldersListBox.Height + 25);
|
||||||
|
removeDestinationFolderButton.Location = new Point(destinationFoldersListBox.Location.X + destinationFoldersListBox.Width - removeDestinationFolderButton.Width, destinationFoldersListBox.Height + 25);
|
||||||
|
|
||||||
|
sourceDirectoriesLabel.Location = new Point(sourceFoldersListBox.Location.X + sourceFoldersListBox.Width / 2 - sourceDirectoriesLabel.Width / 2, sourceDirectoriesLabel.Location.Y);
|
||||||
|
destinationDirectoriesLabel.Location = new Point(destinationFoldersListBox.Location.X + destinationFoldersListBox.Width / 2 - destinationDirectoriesLabel.Width / 2, destinationDirectoriesLabel.Location.Y);
|
||||||
|
|
||||||
|
mainPanel.Height = this.Height;
|
||||||
|
|
||||||
|
if (WindowState == FormWindowState.Minimized && ShowInTaskbar == true)
|
||||||
|
{
|
||||||
|
ShowInTaskbar = false;
|
||||||
|
backup.windowVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainForm_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+3029
File diff suppressed because it is too large
Load Diff
+22
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AutoBackup
|
||||||
|
{
|
||||||
|
static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new MainForm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||||
|
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||||
|
// die einer Assembly zugeordnet sind.
|
||||||
|
[assembly: AssemblyTitle("AutoBackup")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("AutoBackup")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||||
|
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||||
|
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||||
|
[assembly: Guid("9a045635-883b-4b86-88f4-c06cabc58d2c")]
|
||||||
|
|
||||||
|
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||||
|
//
|
||||||
|
// Hauptversion
|
||||||
|
// Nebenversion
|
||||||
|
// Buildnummer
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||||
|
// indem Sie "*" wie unten gezeigt eingeben:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
Generated
+83
@@ -0,0 +1,83 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Dieser Code wurde von einem Tool generiert.
|
||||||
|
// Laufzeitversion:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||||
|
// der Code erneut generiert wird.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace AutoBackup.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||||
|
/// </summary>
|
||||||
|
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||||
|
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||||
|
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||||
|
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoBackup.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||||
|
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap OFF {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("OFF", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap ON {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("ON", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="OFF" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\OFF.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="ON" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\ON.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
Generated
+30
@@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace AutoBackup.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
48a30b2fc0c048eb773685fa2b90420a676683e8
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\obj\Debug\AutoBackup.csprojAssemblyReference.cache
|
||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\obj\Debug\AutoBackup.Properties.Resources.resources
|
||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\obj\Debug\AutoBackup.csproj.GenerateResource.cache
|
||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\obj\Debug\AutoBackup.csproj.CoreCompileInputs.cache
|
||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\bin\Debug\AutoBackup.exe.config
|
||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\bin\Debug\AutoBackup.exe
|
||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\bin\Debug\AutoBackup.pdb
|
||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\obj\Debug\AutoBackup.exe
|
||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\obj\Debug\AutoBackup.pdb
|
||||||
|
C:\Users\David\source\repos\AutoBackup\AutoBackup\obj\Debug\AutoBackup.MainForm.resources
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\bin\Debug\AutoBackup.exe.config
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\bin\Debug\AutoBackup.exe
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\bin\Debug\AutoBackup.pdb
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Debug\AutoBackup.csprojAssemblyReference.cache
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Debug\AutoBackup.MainForm.resources
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Debug\AutoBackup.Properties.Resources.resources
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Debug\AutoBackup.csproj.GenerateResource.cache
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Debug\AutoBackup.csproj.CoreCompileInputs.cache
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Debug\AutoBackup.exe
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Debug\AutoBackup.pdb
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
50ef3a69ce9db936568a27e4d5ab91496b81cbfb
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\bin\Release\AutoBackup.exe.config
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\bin\Release\AutoBackup.exe
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\bin\Release\AutoBackup.pdb
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Release\AutoBackup.MainForm.resources
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Release\AutoBackup.Properties.Resources.resources
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Release\AutoBackup.csproj.GenerateResource.cache
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Release\AutoBackup.csproj.CoreCompileInputs.cache
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Release\AutoBackup.exe
|
||||||
|
C:\Users\David\Google Drive\Programmieren\AutoBackup\AutoBackup\obj\Release\AutoBackup.pdb
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user