commit 793b560bef306f42d3eecf7039ead906974d11a0 Author: Eugen Höglinger Date: Wed Nov 25 16:55:09 2020 +0100 Initialize diff --git a/.vs/DeleteFileFolder.git/v16/.suo b/.vs/DeleteFileFolder.git/v16/.suo new file mode 100644 index 0000000..a00bb18 Binary files /dev/null and b/.vs/DeleteFileFolder.git/v16/.suo differ diff --git a/DeleteFileFolder.git.sln b/DeleteFileFolder.git.sln new file mode 100644 index 0000000..65508dd --- /dev/null +++ b/DeleteFileFolder.git.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30621.155 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeleteFileFolder", "DeleteFileFolder\DeleteFileFolder.csproj", "{9E1E89BE-2500-4B00-8179-6FCED03F07C9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_DeleteFileFolder", "Test_DeleteFileFolder\Test_DeleteFileFolder.csproj", "{E3AEAD97-B7B5-4DDE-92E6-06EBB0430676}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9E1E89BE-2500-4B00-8179-6FCED03F07C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E1E89BE-2500-4B00-8179-6FCED03F07C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E1E89BE-2500-4B00-8179-6FCED03F07C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E1E89BE-2500-4B00-8179-6FCED03F07C9}.Release|Any CPU.Build.0 = Release|Any CPU + {E3AEAD97-B7B5-4DDE-92E6-06EBB0430676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E3AEAD97-B7B5-4DDE-92E6-06EBB0430676}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E3AEAD97-B7B5-4DDE-92E6-06EBB0430676}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E3AEAD97-B7B5-4DDE-92E6-06EBB0430676}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {96FCD157-EBD9-4BF6-8695-DBBFCA29707F} + EndGlobalSection +EndGlobal diff --git a/DeleteFileFolder/DeleteFileFolder.cs b/DeleteFileFolder/DeleteFileFolder.cs new file mode 100644 index 0000000..5e91e71 --- /dev/null +++ b/DeleteFileFolder/DeleteFileFolder.cs @@ -0,0 +1,530 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Eugen.ESystem +{ + public class DeleteFileFolder + { + #region Version und Copyright + // Version und Copyright + string dllName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen + string dllVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + string copyright = GenerateCopyright(); + string icon = Application.StartupPath + "\\Info.bmp"; + //Assembly Datum und Zeit + static DateTime value = AssemblyDateTime(); + string date = value.ToShortDateString(); + string time = value.ToLongTimeString(); + private static DateTime AssemblyDateTime() + { + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision)); + //Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original) + return buildDateTime; + } + + private static string CurrentYear() + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + + private static string StartYear() + { + string startYear = ""; + if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © ")) + { + startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", ""); + while (startYear.StartsWith(" ")) + { + startYear = startYear.Remove(0, 1); + } + startYear = startYear.Remove(startYear.IndexOf(" ")); + return startYear; + } + else + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + } + + private static string GenerateCopyright() + { + string startYear = StartYear(); + string currentYear = CurrentYear(); + + if (startYear == currentYear) + { + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + } + else + { + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace(startYear, String.Concat(startYear, "-", currentYear)); + } + } + #endregion + + #region DLL-Info + /// + /// Contains the name of the program file + /// + public static string DllName { set; get; } + + /// + /// Contains the version of the program file + /// + public static string DllVersion { set; get; } + + /// + /// Contains the copyright notice + /// + public static string Copyright { set; get; } + + private void SetDllInfo() + { + //Name, Version und Copyright setzen + DllName = dllName; + DllVersion = dllVersion; + Copyright = copyright; + } + #endregion + + public DeleteFileFolder() + { + SetDllInfo(); + + Dir = false; + } + + List undeletableFiles = new List(); //Liste der unlöschbaren Dateien + + private long FileCounter { set; get; } //Anzahl der abgearbeiteten Dateien + private long DirectoryCounter { set; get; } //Anzahl der abgearbeiteten Verzeichnisse + + private long NumberOfFiles { set; get; } //Anzahl der Dateien + private long NumberOfDirectories { set; get; } //Anzahl der Verzeichnisse + public long PercentDone { set; get; } //Prozent abgeschlossen + private bool Dir { set; get; } //true = Verzeichnisse und Dateien; false = Nur Dateien + + /// + /// Deletes a singel File. + /// + /// A valid filename with path. + /// If the file was successfully deleted, 'null' is returned, otherwise the filename. + public string File(string fileName) + { + try + { + FileCounter++; //Zähler hochzählen + + System.IO.File.SetAttributes(fileName, FileAttributes.Normal); //Attribute zurücksetzen + System.IO.File.Delete(fileName); //Datei löschen + + return null; //Wenn löschen möglich war + } + catch (Exception) + { + return fileName; //Wenn löschen nicht möglich war + } + } + + /// + /// Deletes a singel File with the declared extension. + /// + /// A valid filename with path. + /// A valid file extension, e.g.: .txt + /// If the file was successfully deleted, 'null' is returned, otherwise the filename. + public string File(string fileName, string searchPattern) + { + try + { + if (Path.GetExtension(fileName) != searchPattern) + { + return null; + } + FileCounter++; //Zähler hochzählen + PercentDone = 100 / NumberOfFiles * FileCounter; + + System.IO.File.SetAttributes(fileName, FileAttributes.Normal); //Attribute zurücksetzen + System.IO.File.Delete(fileName); //Datei löschen + + return null; //Wenn löschen möglich war + } + catch (Exception) + { + return fileName; //Wenn löschen nicht möglich war + } + } + + + /// + /// Delete all files in a specified folder. + /// + /// Full path of a folder. + /// Returns a list of all undeletable files. + public List AllFiles(string path) + { + NumberOfFiles = CountFiles(path); //Anzahl der löschbaren Dateien + + FileCounter = 0; //Zähler zurücksetzen + string result = ""; //Rückgabewert + + undeletableFiles.Clear(); + + foreach (var file in Directory.GetFiles(path)) + { + result = File(file); //Dateien löschen + + //Berechnen wie viel Prozenz bereits gelöscht sind + if (Dir) + { + //Dateien und Verzeichnisse werden berücksichtigt + PercentDone = Convert.ToInt32(100 / Convert.ToDouble(NumberOfFiles + NumberOfDirectories) * Convert.ToDouble(FileCounter + DirectoryCounter)); + } + else + { + //Nur Dateien werden berücksichtigt + PercentDone = Convert.ToInt32(100 / Convert.ToDouble(NumberOfFiles) * Convert.ToDouble(FileCounter)); + OnEvent(PercentDone); + } + + if (result != null) + { + //Wenn ein Dateiname zurückgeliefert wird, dann in die Liste aufnehmen + undeletableFiles.Add(result); + } + } + return undeletableFiles; //Gibt die Liste der unlöschbaren Dateien zurück + } + + /// + /// Delete all files in a specified folder and subfolders. + /// + /// Full path of a folder. + /// If true, then all files in all subdirectories are also deleted. + /// + public List AllFiles(string path, bool subFolder) + { + NumberOfFiles = CountFiles(path, subFolder); //Anzahl der löschbaren Dateien + + FileCounter = 0; //Zähler zurücksetzen + + undeletableFiles.Clear(); //Liste der unlöschbaren Dateien zurücksetzen + + //Löscht alle Dateien und gibt die Liste der unlöschbaren Dateien zurück + return AllFilesInFolders(path, true); + } + + /// + /// Delete all files in a specified folder and subfolders with the declared extension. + /// + /// Full path of a folder. + /// If true, then all files in all subdirectories are also deleted. + /// A valid file extension, e.g.: .txt + /// Returns a list of all undeletable files. + public List AllFiles(string path, bool subFolder, string searchPattern) + { + NumberOfFiles = CountFiles(path, subFolder); //Anzahl der löschbaren Dateien + + FileCounter = 0; //Zähler zurücksetzen + + undeletableFiles.Clear(); //Liste der unlöschbaren Dateien zurücksetzen + + //Löscht alle Dateien und gibt die Liste der unlöschbaren Dateien zurück + return AllFilesInFolders(path, true, searchPattern); + } + + + private List AllFilesInFolders(string path, bool subFolder) + { + string result = ""; //Rückgabewert + + foreach (var file in Directory.GetFiles(path)) + { + result = File(file); //Dateien löschen + + //Berechnen wie viel Prozenz bereits gelöscht sind + if (Dir) + { + //Dateien un Verzeichnisse werden berücksichtigt + PercentDone = Convert.ToInt32(100 / Convert.ToDouble(NumberOfFiles + NumberOfDirectories) * Convert.ToDouble(FileCounter + DirectoryCounter)); + OnEvent(PercentDone); + } + else + { + //Nur Dateien werden berücksichtigt + PercentDone = Convert.ToInt32(100 / Convert.ToDouble(NumberOfFiles) * Convert.ToDouble(FileCounter)); + OnEvent(PercentDone); + } + + if (result != null) + { + //Wenn ein Dateiname zurückgeliefert wird, dann in die Liste aufnehmen + undeletableFiles.Add(result); + } + } + if (subFolder) + { + //Alle Dateien in den Unterverzeichnissen löschen + foreach (var sFolder in Directory.GetDirectories(path)) + { + AllFilesInFolders(sFolder, true); + } + } + + return undeletableFiles; //Gibt die Liste der unlöschbaren Dateien zurück + } + + private List AllFilesInFolders(string path, bool subFolder, string searchPattern) + { + string result = ""; //Rückgabewert + + foreach (var file in Directory.GetFiles(path)) + { + result = File(file, searchPattern); //Dateien löschen + + if (result != null) + { + //Wenn ein Dateiname zurückgeliefert wird, dann in die Liste aufnehmen + undeletableFiles.Add(result); + } + } + if (subFolder) + { + //Alle Dateien in den Unterverzeichnissen löschen + foreach (var sFolder in Directory.GetDirectories(path)) + { + AllFilesInFolders(sFolder, true, searchPattern); + } + } + + return undeletableFiles; //Gibt die Liste der unlöschbaren Dateien zurück + } + + + public string SingleDirectory(string path) + { + try + { + DirectoryCounter++; //Zähler hochzählen + + DirectoryInfo dirInfo = new DirectoryInfo(path); + dirInfo.Attributes = FileAttributes.Normal; + System.IO.Directory.Delete(path); + + return null; //Wenn löschen möglich war + } + catch (Exception) + { + return path; //Wenn löschen nicht möglich war + } + } + + public List AllDirectories(string path) + { + undeletableFiles.Clear(); + + if (!Directory.Exists(path)) + { + undeletableFiles.Add(path); + return undeletableFiles; + } + + Dir = true; + + NumberOfFiles = CountFiles(path, true); //Anzahl der löschbaren Dateien + NumberOfDirectories = CountDirectories(path); //Anzahl der löschbaren Verzeichnsse + + //Alle Dateien im Verzeichnis löschen + undeletableFiles.AddRange(AllFiles(path, true)); + + undeletableFiles = AllSubDirectories(path); //Alle Verzeichnisse löschen + + string result = SingleDirectory(path); + if (!String.IsNullOrEmpty(result)) + { + undeletableFiles.Add(result); + } + + //Berechnen wie viel Prozenz bereits gelöscht sind + PercentDone = Convert.ToInt32(100 / Convert.ToDouble(NumberOfFiles + NumberOfDirectories) * Convert.ToDouble(FileCounter + DirectoryCounter)); + OnEvent(PercentDone); + + return undeletableFiles; //Gibt die Liste der unlöschbaren Dateien und Verzeichnisse zurück + } + + public List AllSubDirectories(string path) + { + //Unterverzeichnisse löschen + foreach (var sFolder in Directory.GetDirectories(path)) + { + undeletableFiles.AddRange(AllSubDirectories(sFolder)); + + SingleDirectory(sFolder); + + //Berechnen wie viel Prozenz bereits gelöscht sind + PercentDone = Convert.ToInt32(100 / Convert.ToDouble(NumberOfFiles + NumberOfDirectories) * Convert.ToDouble(FileCounter + DirectoryCounter)); + OnEvent(PercentDone); + } + + return undeletableFiles; //Gibt die Liste der unlöschbaren Dateien und Verzeichnisse zurück + } + + /// + /// Counts all files in a specified folder. + /// + /// Full path of a folder. + /// The number of files. + public long CountFiles(string path) + { + long numberOfFiles = 0; //Anzahl der löschbaren Dateien + + foreach (var file in Directory.GetFiles(path)) + { + numberOfFiles++; //Zähler erhöhen + } + + return numberOfFiles; + } + + /// + /// Counts all files in a specified folder and all subfolders. + /// + /// Full path of a folder. + /// If true, then all files in all subdirectories are also counted. + /// The number of files. + public long CountFiles(string path, bool subFolder) + { + if (!Directory.Exists(path)) + { + return 0; //Wenn das Verzeichnis nicht existiert, dann 0 zurückgeben + } + + NumberOfFiles = 0; //Zähler zurücksetzen + + NumberOfFiles = CountAllFiles(path, subFolder); //Die Zählfunktion aufrufen + return NumberOfFiles; + } + + /// + /// Counts all files in a specified folder and subfolder with the declared extension. + /// + /// Full path of a folder. + /// If true, then all files in all subdirectories are also counted. + /// A valid file extension, e.g.: .txt + /// The number of files. + private long CountFile(string path, bool subFolder, string searchPattern) + { + long numberOfFiles = 0; //Anzahl der löschbaren Dateien + + foreach (var file in Directory.GetFiles(path)) + { + if (Path.GetExtension(file) == searchPattern) + { + numberOfFiles++; //Zähler erhöhen + } + } + if (subFolder) + { + foreach (var sFolder in Directory.GetDirectories(path)) + { + CountFile(sFolder, true, searchPattern); + } + } + + return numberOfFiles; + } + + private long CountAllFiles(string path, bool subFolder) + { + foreach (var file in Directory.GetFiles(path)) + { + NumberOfFiles++; //Zähler erhöhen + } + if (subFolder) + { + foreach (var sFolder in Directory.GetDirectories(path)) + { + CountAllFiles(sFolder, true); //Rekursiver Aufruf + } + } + + return NumberOfFiles; + } + + private long CountAllFiles(string path, bool subFolder, string searchPattern) + { + foreach (var file in Directory.GetFiles(path)) + { + if (Path.GetExtension(file) == searchPattern) + { + NumberOfFiles++; //Zähler erhöhen + } + } + if (subFolder) + { + foreach (var sFolder in Directory.GetDirectories(path)) + { + CountAllFiles(sFolder, true, searchPattern); //Rekursiver Aufruf + } + } + + return NumberOfFiles; + } + + /// + /// Counts all directoreis in a specified folder and all subfolders. + /// + /// Full path of a folder. + /// The number of directories. + public long CountDirectories(string path) + { + if (!Directory.Exists(path)) + { + return 0; //Wenn das Verzeichnis nicht existiert, dann 0 zurückgeben + } + + NumberOfDirectories = 0; //Zähler zurücksetzen + + NumberOfDirectories = CountAllDirectories(path) + 1; //Für das Root-Verzeichnis 1 dazu zählen + return NumberOfDirectories; + } + + private long CountAllDirectories(string path) + { + //Rekursive Aufruf + foreach (var sFolder in Directory.GetDirectories(path)) + { + CountAllDirectories(sFolder); + NumberOfDirectories++; + } + + return NumberOfDirectories; + } + + #region Event Handler + // Der Delegat muß die gleiche Signatur aufweisen wie die Eventhandler-Methode. + public delegate void EventDelegate(long result); + + // Das Event-Objekt ist vom Typ dieses Delegaten. + public event EventDelegate MyEvent; + + public void OnEvent(long result) + { + // Prüft ob das Event überhaupt einen Abonnenten hat. + if (MyEvent != null) + { + MyEvent(result); + } + } + #endregion + } +} diff --git a/DeleteFileFolder/DeleteFileFolder.csproj b/DeleteFileFolder/DeleteFileFolder.csproj new file mode 100644 index 0000000..a6e6921 --- /dev/null +++ b/DeleteFileFolder/DeleteFileFolder.csproj @@ -0,0 +1,49 @@ + + + + + Debug + AnyCPU + {9E1E89BE-2500-4B00-8179-6FCED03F07C9} + Library + Properties + DeleteFileFolder + DeleteFileFolder + v4.7.2 + 512 + false + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeleteFileFolder/Properties/AssemblyInfo.cs b/DeleteFileFolder/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0dce0e8 --- /dev/null +++ b/DeleteFileFolder/Properties/AssemblyInfo.cs @@ -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("DeleteFileFolder")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DeleteFileFolder")] +[assembly: AssemblyCopyright("Copyright © 2020 by Eugen Höglinger")] +[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("9e1e89be-2500-4b00-8179-6fced03f07c9")] + +// 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.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DeleteFileFolder/bin/Debug/DeleteFileFolder.dll b/DeleteFileFolder/bin/Debug/DeleteFileFolder.dll new file mode 100644 index 0000000..62e36f3 Binary files /dev/null and b/DeleteFileFolder/bin/Debug/DeleteFileFolder.dll differ diff --git a/DeleteFileFolder/bin/Debug/DeleteFileFolder.pdb b/DeleteFileFolder/bin/Debug/DeleteFileFolder.pdb new file mode 100644 index 0000000..52f1528 Binary files /dev/null and b/DeleteFileFolder/bin/Debug/DeleteFileFolder.pdb differ diff --git a/DeleteFileFolder/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/DeleteFileFolder/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/DeleteFileFolder/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/DeleteFileFolder/obj/Debug/DeleteFileFolder.csproj.CoreCompileInputs.cache b/DeleteFileFolder/obj/Debug/DeleteFileFolder.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..d52ad46 --- /dev/null +++ b/DeleteFileFolder/obj/Debug/DeleteFileFolder.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +99ea030e883342fe107d375c9fe986f9d159745f diff --git a/DeleteFileFolder/obj/Debug/DeleteFileFolder.csproj.FileListAbsolute.txt b/DeleteFileFolder/obj/Debug/DeleteFileFolder.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..e22485c --- /dev/null +++ b/DeleteFileFolder/obj/Debug/DeleteFileFolder.csproj.FileListAbsolute.txt @@ -0,0 +1,6 @@ +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\DeleteFileFolder\bin\Debug\DeleteFileFolder.dll +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\DeleteFileFolder\bin\Debug\DeleteFileFolder.pdb +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\DeleteFileFolder\obj\Debug\DeleteFileFolder.csprojAssemblyReference.cache +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\DeleteFileFolder\obj\Debug\DeleteFileFolder.csproj.CoreCompileInputs.cache +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\DeleteFileFolder\obj\Debug\DeleteFileFolder.dll +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\DeleteFileFolder\obj\Debug\DeleteFileFolder.pdb diff --git a/DeleteFileFolder/obj/Debug/DeleteFileFolder.csprojAssemblyReference.cache b/DeleteFileFolder/obj/Debug/DeleteFileFolder.csprojAssemblyReference.cache new file mode 100644 index 0000000..808afd0 Binary files /dev/null and b/DeleteFileFolder/obj/Debug/DeleteFileFolder.csprojAssemblyReference.cache differ diff --git a/DeleteFileFolder/obj/Debug/DeleteFileFolder.dll b/DeleteFileFolder/obj/Debug/DeleteFileFolder.dll new file mode 100644 index 0000000..62e36f3 Binary files /dev/null and b/DeleteFileFolder/obj/Debug/DeleteFileFolder.dll differ diff --git a/DeleteFileFolder/obj/Debug/DeleteFileFolder.pdb b/DeleteFileFolder/obj/Debug/DeleteFileFolder.pdb new file mode 100644 index 0000000..52f1528 Binary files /dev/null and b/DeleteFileFolder/obj/Debug/DeleteFileFolder.pdb differ diff --git a/DeleteFileFolder/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/DeleteFileFolder/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..dc2022f Binary files /dev/null and b/DeleteFileFolder/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Test_DeleteFileFolder/App.config b/Test_DeleteFileFolder/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Test_DeleteFileFolder/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Test_DeleteFileFolder/Form1.Designer.cs b/Test_DeleteFileFolder/Form1.Designer.cs new file mode 100644 index 0000000..51c3ded --- /dev/null +++ b/Test_DeleteFileFolder/Form1.Designer.cs @@ -0,0 +1,266 @@ +namespace Test_DeleteFileFolder +{ + partial class Form1 + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.labelFileName = new System.Windows.Forms.Label(); + this.textBoxFileName = new System.Windows.Forms.TextBox(); + this.groupBoxOptions = new System.Windows.Forms.GroupBox(); + this.groupBoxType = new System.Windows.Forms.GroupBox(); + this.groupBoxFiles = new System.Windows.Forms.GroupBox(); + this.radioButtonDirectory = new System.Windows.Forms.RadioButton(); + this.radioButtonFileOnly = new System.Windows.Forms.RadioButton(); + this.radioButtonSingleFile = new System.Windows.Forms.RadioButton(); + this.radioButtonAllFiles = new System.Windows.Forms.RadioButton(); + this.checkBoxSubdirectories = new System.Windows.Forms.CheckBox(); + this.checkBoxCountOnly = new System.Windows.Forms.CheckBox(); + this.labelDeletableFiles = new System.Windows.Forms.Label(); + this.labelDeletableDirectories = new System.Windows.Forms.Label(); + this.progressBar = new System.Windows.Forms.ProgressBar(); + this.buttonDelete = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.groupBoxOptions.SuspendLayout(); + this.groupBoxType.SuspendLayout(); + this.groupBoxFiles.SuspendLayout(); + this.SuspendLayout(); + // + // labelFileName + // + this.labelFileName.AutoSize = true; + this.labelFileName.Location = new System.Drawing.Point(12, 9); + this.labelFileName.Name = "labelFileName"; + this.labelFileName.Size = new System.Drawing.Size(104, 13); + this.labelFileName.TabIndex = 0; + this.labelFileName.Text = "File-/Directory-Name"; + // + // textBoxFileName + // + this.textBoxFileName.Location = new System.Drawing.Point(12, 25); + this.textBoxFileName.Name = "textBoxFileName"; + this.textBoxFileName.Size = new System.Drawing.Size(260, 20); + this.textBoxFileName.TabIndex = 1; + this.textBoxFileName.TextChanged += new System.EventHandler(this.textBoxFileName_TextChanged); + // + // groupBoxOptions + // + this.groupBoxOptions.Controls.Add(this.checkBoxCountOnly); + this.groupBoxOptions.Controls.Add(this.checkBoxSubdirectories); + this.groupBoxOptions.Controls.Add(this.groupBoxFiles); + this.groupBoxOptions.Controls.Add(this.groupBoxType); + this.groupBoxOptions.Location = new System.Drawing.Point(12, 52); + this.groupBoxOptions.Name = "groupBoxOptions"; + this.groupBoxOptions.Size = new System.Drawing.Size(260, 148); + this.groupBoxOptions.TabIndex = 2; + this.groupBoxOptions.TabStop = false; + this.groupBoxOptions.Text = "Options"; + // + // groupBoxType + // + this.groupBoxType.Controls.Add(this.radioButtonFileOnly); + this.groupBoxType.Controls.Add(this.radioButtonDirectory); + this.groupBoxType.Location = new System.Drawing.Point(6, 19); + this.groupBoxType.Name = "groupBoxType"; + this.groupBoxType.Size = new System.Drawing.Size(248, 47); + this.groupBoxType.TabIndex = 0; + this.groupBoxType.TabStop = false; + this.groupBoxType.Text = "Type"; + // + // groupBoxFiles + // + this.groupBoxFiles.Controls.Add(this.radioButtonAllFiles); + this.groupBoxFiles.Controls.Add(this.radioButtonSingleFile); + this.groupBoxFiles.Location = new System.Drawing.Point(6, 72); + this.groupBoxFiles.Name = "groupBoxFiles"; + this.groupBoxFiles.Size = new System.Drawing.Size(248, 47); + this.groupBoxFiles.TabIndex = 1; + this.groupBoxFiles.TabStop = false; + this.groupBoxFiles.Text = "Files"; + // + // radioButtonDirectory + // + this.radioButtonDirectory.AutoSize = true; + this.radioButtonDirectory.Checked = true; + this.radioButtonDirectory.Location = new System.Drawing.Point(7, 20); + this.radioButtonDirectory.Name = "radioButtonDirectory"; + this.radioButtonDirectory.Size = new System.Drawing.Size(67, 17); + this.radioButtonDirectory.TabIndex = 0; + this.radioButtonDirectory.TabStop = true; + this.radioButtonDirectory.Text = "Directory"; + this.radioButtonDirectory.UseVisualStyleBackColor = true; + this.radioButtonDirectory.CheckedChanged += new System.EventHandler(this.radioButtonDirectory_CheckedChanged); + // + // radioButtonFileOnly + // + this.radioButtonFileOnly.AutoSize = true; + this.radioButtonFileOnly.Location = new System.Drawing.Point(138, 20); + this.radioButtonFileOnly.Name = "radioButtonFileOnly"; + this.radioButtonFileOnly.Size = new System.Drawing.Size(62, 17); + this.radioButtonFileOnly.TabIndex = 1; + this.radioButtonFileOnly.TabStop = true; + this.radioButtonFileOnly.Text = "FileOnly"; + this.radioButtonFileOnly.UseVisualStyleBackColor = true; + this.radioButtonFileOnly.CheckedChanged += new System.EventHandler(this.radioButtonFileOnly_CheckedChanged); + // + // radioButtonSingleFile + // + this.radioButtonSingleFile.AutoSize = true; + this.radioButtonSingleFile.Checked = true; + this.radioButtonSingleFile.Location = new System.Drawing.Point(7, 20); + this.radioButtonSingleFile.Name = "radioButtonSingleFile"; + this.radioButtonSingleFile.Size = new System.Drawing.Size(70, 17); + this.radioButtonSingleFile.TabIndex = 0; + this.radioButtonSingleFile.TabStop = true; + this.radioButtonSingleFile.Text = "Single file"; + this.radioButtonSingleFile.UseVisualStyleBackColor = true; + this.radioButtonSingleFile.CheckedChanged += new System.EventHandler(this.radioButtonSingleFile_CheckedChanged); + // + // radioButtonAllFiles + // + this.radioButtonAllFiles.AutoSize = true; + this.radioButtonAllFiles.Location = new System.Drawing.Point(138, 20); + this.radioButtonAllFiles.Name = "radioButtonAllFiles"; + this.radioButtonAllFiles.Size = new System.Drawing.Size(57, 17); + this.radioButtonAllFiles.TabIndex = 1; + this.radioButtonAllFiles.TabStop = true; + this.radioButtonAllFiles.Text = "All files"; + this.radioButtonAllFiles.UseVisualStyleBackColor = true; + this.radioButtonAllFiles.CheckedChanged += new System.EventHandler(this.radioButtonAllFiles_CheckedChanged); + // + // checkBoxSubdirectories + // + this.checkBoxSubdirectories.AutoSize = true; + this.checkBoxSubdirectories.Location = new System.Drawing.Point(6, 125); + this.checkBoxSubdirectories.Name = "checkBoxSubdirectories"; + this.checkBoxSubdirectories.Size = new System.Drawing.Size(93, 17); + this.checkBoxSubdirectories.TabIndex = 2; + this.checkBoxSubdirectories.Text = "Subdirectories"; + this.checkBoxSubdirectories.UseVisualStyleBackColor = true; + this.checkBoxSubdirectories.CheckedChanged += new System.EventHandler(this.checkBoxSubdirectories_CheckedChanged); + // + // checkBoxCountOnly + // + this.checkBoxCountOnly.AutoSize = true; + this.checkBoxCountOnly.Location = new System.Drawing.Point(144, 125); + this.checkBoxCountOnly.Name = "checkBoxCountOnly"; + this.checkBoxCountOnly.Size = new System.Drawing.Size(76, 17); + this.checkBoxCountOnly.TabIndex = 3; + this.checkBoxCountOnly.Text = "Count only"; + this.checkBoxCountOnly.UseVisualStyleBackColor = true; + this.checkBoxCountOnly.CheckedChanged += new System.EventHandler(this.checkBoxCountOnly_CheckedChanged); + // + // labelDeletableFiles + // + this.labelDeletableFiles.Location = new System.Drawing.Point(12, 210); + this.labelDeletableFiles.Name = "labelDeletableFiles"; + this.labelDeletableFiles.Size = new System.Drawing.Size(260, 13); + this.labelDeletableFiles.TabIndex = 3; + this.labelDeletableFiles.Text = "Number of deletable files:"; + // + // labelDeletableDirectories + // + this.labelDeletableDirectories.Location = new System.Drawing.Point(12, 237); + this.labelDeletableDirectories.Name = "labelDeletableDirectories"; + this.labelDeletableDirectories.Size = new System.Drawing.Size(260, 23); + this.labelDeletableDirectories.TabIndex = 4; + this.labelDeletableDirectories.Text = "Number of deletable Directories"; + // + // progressBar + // + this.progressBar.Location = new System.Drawing.Point(12, 263); + this.progressBar.Name = "progressBar"; + this.progressBar.Size = new System.Drawing.Size(260, 23); + this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous; + this.progressBar.TabIndex = 5; + // + // buttonDelete + // + this.buttonDelete.Location = new System.Drawing.Point(12, 296); + this.buttonDelete.Name = "buttonDelete"; + this.buttonDelete.Size = new System.Drawing.Size(75, 23); + this.buttonDelete.TabIndex = 6; + this.buttonDelete.Text = "Delete"; + this.buttonDelete.UseVisualStyleBackColor = true; + this.buttonDelete.Click += new System.EventHandler(this.buttonDelete_Click); + // + // buttonCancel + // + this.buttonCancel.Location = new System.Drawing.Point(198, 296); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 7; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 331); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonDelete); + this.Controls.Add(this.progressBar); + this.Controls.Add(this.labelDeletableDirectories); + this.Controls.Add(this.labelDeletableFiles); + this.Controls.Add(this.groupBoxOptions); + this.Controls.Add(this.textBoxFileName); + this.Controls.Add(this.labelFileName); + this.Name = "Form1"; + this.Text = "Test_DeleteFileFolder"; + this.groupBoxOptions.ResumeLayout(false); + this.groupBoxOptions.PerformLayout(); + this.groupBoxType.ResumeLayout(false); + this.groupBoxType.PerformLayout(); + this.groupBoxFiles.ResumeLayout(false); + this.groupBoxFiles.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label labelFileName; + private System.Windows.Forms.TextBox textBoxFileName; + private System.Windows.Forms.GroupBox groupBoxOptions; + private System.Windows.Forms.CheckBox checkBoxCountOnly; + private System.Windows.Forms.CheckBox checkBoxSubdirectories; + private System.Windows.Forms.GroupBox groupBoxFiles; + private System.Windows.Forms.RadioButton radioButtonAllFiles; + private System.Windows.Forms.RadioButton radioButtonSingleFile; + private System.Windows.Forms.GroupBox groupBoxType; + private System.Windows.Forms.RadioButton radioButtonFileOnly; + private System.Windows.Forms.RadioButton radioButtonDirectory; + private System.Windows.Forms.Label labelDeletableFiles; + private System.Windows.Forms.Label labelDeletableDirectories; + private System.Windows.Forms.ProgressBar progressBar; + private System.Windows.Forms.Button buttonDelete; + private System.Windows.Forms.Button buttonCancel; + } +} + diff --git a/Test_DeleteFileFolder/Form1.cs b/Test_DeleteFileFolder/Form1.cs new file mode 100644 index 0000000..a28263b --- /dev/null +++ b/Test_DeleteFileFolder/Form1.cs @@ -0,0 +1,236 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Eugen.ESystem; + +namespace Test_DeleteFileFolder +{ + public partial class Form1 : Form + { + #region Version und Copyright + // Version und Copyright + string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen + string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + string copyright = GenerateCopyright(); + string icon = Application.StartupPath + "\\Info.bmp"; + //Assembly Datum und Zeit + static DateTime value = AssemblyDateTime(); + string date = value.ToShortDateString(); + string time = value.ToLongTimeString(); + private static DateTime AssemblyDateTime() + { + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision)); + //Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original) + return buildDateTime; + } + + private static string CurrentYear() + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + + private static string StartYear() + { + //string startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + //return startYear.Remove(0, startYear.LastIndexOf(" ") + 1); + string startYear = ""; + if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © ")) + { + startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", ""); + while (startYear.StartsWith(" ")) + { + startYear = startYear.Remove(0, 1); + } + startYear = startYear.Remove(startYear.IndexOf(" ")); + return startYear; + } + else + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + } + + private static string GenerateCopyright() + { + string startYear = StartYear(); + string currentYear = CurrentYear(); + + if (startYear == currentYear) + { + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + } + else + { + //return String.Concat(((AssemblyCopyrightAttribute)attributes[0]).Copyright, "-", currentYear); + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace(startYear, String.Concat(startYear, "-", currentYear)); + } + } + #endregion + + #region Programm-Info + /// + /// Contains the name of the program file + /// + public static string ProgramName { set; get; } + + /// + /// Contains the version of the program file + /// + public static string ProgramVersion { set; get; } + + /// + /// Contains the copyright notice + /// + public static string Copyright { set; get; } + + private void SetProgramInfo() + { + //Name, Version und Copyright setzen + ProgramName = programName; + ProgramVersion = programVersion; + Copyright = copyright; + } + #endregion + + public Form1() + { + SetProgramInfo(); + InitializeComponent(); + } + + string fileName = ""; + bool allFiles = false; + bool folders = false; + bool subFolders = false; + bool countOnly = false; + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void buttonDelete_Click(object sender, EventArgs e) + { + string undeletableFile = ""; + List undeletableFiles = new List(); + string message = ""; + + //In diesem Bereich wird das Löschen ausgeführt --------------------- + DeleteFileFolder Del = new DeleteFileFolder(); + // Hier wird das Event abonniert. + // Das kann jede Klasse auf die gleiche Weise machen. + Del.MyEvent += new DeleteFileFolder.EventDelegate(EventHandler); + + if (checkBoxCountOnly.Checked) + { + labelDeletableFiles.Text = "Number of deletable Files: " + Del.CountFiles(textBoxFileName.Text, checkBoxSubdirectories.Checked); + labelDeletableDirectories.Text = "Number of deletable Directories: \t" + Del.CountDirectories(textBoxFileName.Text); + } + else + { + if (radioButtonFileOnly.Checked) + { + //Dateien löschen + if (radioButtonSingleFile.Checked) + { + undeletableFile = Del.File(textBoxFileName.Text); //Eine einzelen Datei löschen + progressBar.Value = 100; + } + else + { + if (!checkBoxSubdirectories.Checked) + { + undeletableFiles = Del.AllFiles(textBoxFileName.Text); //Alle Dateien eines Verzeichnisses löschen + } + else + { + undeletableFiles = Del.AllFiles(textBoxFileName.Text, true); //Alle Dateien eines Verzeichnisses und aller Unterverzeichnisse löschen + } + } + } + else + { + undeletableFiles = Del.AllDirectories(textBoxFileName.Text); + } + } + + //Nicht löschbare Dateien und Verzeichnisse anzeigen + if (undeletableFiles != null & undeletableFiles.Any()) + { + message = "Undeleteable elements:\n"; + + foreach (var element in undeletableFiles) + { + message += element + "\n"; + } + MessageBox.Show(message); + } + } + + private void textBoxFileName_TextChanged(object sender, EventArgs e) + { + ClearProgressBar(); + fileName = textBoxFileName.Text; + } + + private void radioButtonDirectory_CheckedChanged(object sender, EventArgs e) + { + ClearProgressBar(); + } + + private void radioButtonFileOnly_CheckedChanged(object sender, EventArgs e) + { + ClearProgressBar(); + } + + private void radioButtonSingleFile_CheckedChanged(object sender, EventArgs e) + { + ClearProgressBar(); + } + + private void radioButtonAllFiles_CheckedChanged(object sender, EventArgs e) + { + ClearProgressBar(); + } + + private void checkBoxSubdirectories_CheckedChanged(object sender, EventArgs e) + { + ClearProgressBar(); + subFolders = !subFolders; + } + + private void checkBoxCountOnly_CheckedChanged(object sender, EventArgs e) + { + ClearProgressBar(); + countOnly = !countOnly; + } + + private void ClearProgressBar() + { + //Setzt die Progressbar auf 0% zurück + progressBar.Value = 0; + progressBar.Refresh(); + } + + #region Event Handler + void EventHandler(long value) + { + //Die ProgressBar updaten + progressBar.Value = Convert.ToInt32(value); + progressBar.Refresh(); + } + #endregion + } +} diff --git a/Test_DeleteFileFolder/Form1.resx b/Test_DeleteFileFolder/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Test_DeleteFileFolder/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Test_DeleteFileFolder/Program.cs b/Test_DeleteFileFolder/Program.cs new file mode 100644 index 0000000..1963294 --- /dev/null +++ b/Test_DeleteFileFolder/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Test_DeleteFileFolder +{ + static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Test_DeleteFileFolder/Properties/AssemblyInfo.cs b/Test_DeleteFileFolder/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..33a4499 --- /dev/null +++ b/Test_DeleteFileFolder/Properties/AssemblyInfo.cs @@ -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("Test_DeleteFileFolder")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Test_DeleteFileFolder")] +[assembly: AssemblyCopyright("Copyright © 2020 by Eugen Höglinger")] +[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("e3aead97-b7b5-4dde-92e6-06ebb0430676")] + +// 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.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Test_DeleteFileFolder/Properties/Resources.Designer.cs b/Test_DeleteFileFolder/Properties/Resources.Designer.cs new file mode 100644 index 0000000..133242a --- /dev/null +++ b/Test_DeleteFileFolder/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion: 4.0.30319.42000 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code neu generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Test_DeleteFileFolder.Properties +{ + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder-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 Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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() + { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test_DeleteFileFolder.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Test_DeleteFileFolder/Properties/Resources.resx b/Test_DeleteFileFolder/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Test_DeleteFileFolder/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Test_DeleteFileFolder/Properties/Settings.Designer.cs b/Test_DeleteFileFolder/Properties/Settings.Designer.cs new file mode 100644 index 0000000..04bf8f4 --- /dev/null +++ b/Test_DeleteFileFolder/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace Test_DeleteFileFolder.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; + } + } + } +} diff --git a/Test_DeleteFileFolder/Properties/Settings.settings b/Test_DeleteFileFolder/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Test_DeleteFileFolder/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Test_DeleteFileFolder/Test_DeleteFileFolder.csproj b/Test_DeleteFileFolder/Test_DeleteFileFolder.csproj new file mode 100644 index 0000000..f3ef853 --- /dev/null +++ b/Test_DeleteFileFolder/Test_DeleteFileFolder.csproj @@ -0,0 +1,89 @@ + + + + + Debug + AnyCPU + {E3AEAD97-B7B5-4DDE-92E6-06EBB0430676} + WinExe + Test_DeleteFileFolder + Test_DeleteFileFolder + v4.7.2 + 512 + true + false + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {9e1e89be-2500-4b00-8179-6fced03f07c9} + DeleteFileFolder + + + + \ No newline at end of file diff --git a/Test_DeleteFileFolder/bin/Debug/DeleteFileFolder.dll b/Test_DeleteFileFolder/bin/Debug/DeleteFileFolder.dll new file mode 100644 index 0000000..62e36f3 Binary files /dev/null and b/Test_DeleteFileFolder/bin/Debug/DeleteFileFolder.dll differ diff --git a/Test_DeleteFileFolder/bin/Debug/DeleteFileFolder.pdb b/Test_DeleteFileFolder/bin/Debug/DeleteFileFolder.pdb new file mode 100644 index 0000000..52f1528 Binary files /dev/null and b/Test_DeleteFileFolder/bin/Debug/DeleteFileFolder.pdb differ diff --git a/Test_DeleteFileFolder/bin/Debug/Test_DeleteFileFolder.exe b/Test_DeleteFileFolder/bin/Debug/Test_DeleteFileFolder.exe new file mode 100644 index 0000000..f82173e Binary files /dev/null and b/Test_DeleteFileFolder/bin/Debug/Test_DeleteFileFolder.exe differ diff --git a/Test_DeleteFileFolder/bin/Debug/Test_DeleteFileFolder.exe.config b/Test_DeleteFileFolder/bin/Debug/Test_DeleteFileFolder.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Test_DeleteFileFolder/bin/Debug/Test_DeleteFileFolder.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Test_DeleteFileFolder/bin/Debug/Test_DeleteFileFolder.pdb b/Test_DeleteFileFolder/bin/Debug/Test_DeleteFileFolder.pdb new file mode 100644 index 0000000..e32eeef Binary files /dev/null and b/Test_DeleteFileFolder/bin/Debug/Test_DeleteFileFolder.pdb differ diff --git a/Test_DeleteFileFolder/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/Test_DeleteFileFolder/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/Test_DeleteFileFolder/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/Test_DeleteFileFolder/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Test_DeleteFileFolder/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..e44d05b Binary files /dev/null and b/Test_DeleteFileFolder/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Test_DeleteFileFolder/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Test_DeleteFileFolder/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..06c41b4 Binary files /dev/null and b/Test_DeleteFileFolder/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.Form1.resources b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.Form1.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.Form1.resources differ diff --git a/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.Properties.Resources.resources b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.Properties.Resources.resources differ diff --git a/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.CopyComplete b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.CoreCompileInputs.cache b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..61d0517 --- /dev/null +++ b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +c4e283fec1f90225d9f29e25f0d7741febda89d6 diff --git a/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.FileListAbsolute.txt b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..3dc0203 --- /dev/null +++ b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.FileListAbsolute.txt @@ -0,0 +1,13 @@ +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\obj\Debug\Test_DeleteFileFolder.csprojAssemblyReference.cache +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\obj\Debug\Test_DeleteFileFolder.Form1.resources +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\obj\Debug\Test_DeleteFileFolder.Properties.Resources.resources +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\obj\Debug\Test_DeleteFileFolder.csproj.GenerateResource.cache +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\obj\Debug\Test_DeleteFileFolder.csproj.CoreCompileInputs.cache +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\bin\Debug\Test_DeleteFileFolder.exe.config +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\bin\Debug\Test_DeleteFileFolder.exe +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\bin\Debug\Test_DeleteFileFolder.pdb +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\bin\Debug\DeleteFileFolder.dll +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\bin\Debug\DeleteFileFolder.pdb +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\obj\Debug\Test_DeleteFileFolder.csproj.CopyComplete +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\obj\Debug\Test_DeleteFileFolder.exe +H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\DeleteFileFolder.git\Test_DeleteFileFolder\obj\Debug\Test_DeleteFileFolder.pdb diff --git a/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.GenerateResource.cache b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.GenerateResource.cache new file mode 100644 index 0000000..cb98167 Binary files /dev/null and b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csproj.GenerateResource.cache differ diff --git a/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csprojAssemblyReference.cache b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csprojAssemblyReference.cache new file mode 100644 index 0000000..89b013e Binary files /dev/null and b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.csprojAssemblyReference.cache differ diff --git a/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.exe b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.exe new file mode 100644 index 0000000..f82173e Binary files /dev/null and b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.exe differ diff --git a/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.pdb b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.pdb new file mode 100644 index 0000000..e32eeef Binary files /dev/null and b/Test_DeleteFileFolder/obj/Debug/Test_DeleteFileFolder.pdb differ