68 lines
2.7 KiB
C#
68 lines
2.7 KiB
C#
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.IO;
|
|
|
|
namespace Test_Delete
|
|
{
|
|
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 version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); // Die Programmversion auslesen
|
|
static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
|
string copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
|
string icon = Application.StartupPath + "\\Info.bmp";
|
|
// Assembly Datum und Zeit
|
|
static DateTime value = AssemblyDateTime();
|
|
string date = value.ToShortDateString();
|
|
string time = value.ToLongTimeString();
|
|
// Programmversion berechnen
|
|
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;
|
|
}
|
|
#endregion
|
|
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void buttonStart_Click(object sender, EventArgs e)
|
|
{
|
|
//TODO: Hier geht es los
|
|
List<string> undelFile = new List<string>();
|
|
string undelDir = "";
|
|
List<string> undelDirs = new List<string>();
|
|
string fileName = "C:\\temp\\test.txt";
|
|
// string folderName = "C:\\temp";
|
|
string folderName = "C:\\temp\\Test";
|
|
|
|
Count count = new Count();
|
|
|
|
Delete.NumberOfFiles = count.File(folderName, "", 0, true);
|
|
Delete.NumberOfDirectories = count.Directory(folderName, "", 0, true, true);
|
|
labelNumber.Text = Delete.NumberOfFiles.ToString() + " Dateien\n" + Delete.NumberOfDirectories.ToString() + " Verzeichnisse";
|
|
labelNumber.Refresh();
|
|
|
|
Delete del = new Delete();
|
|
|
|
// undelFile = del.File(folderName, "", 0, true);
|
|
undelDir = del.Directory(folderName);
|
|
}
|
|
}
|
|
}
|