Initial Commit

main
Stefan Hutter 2 years ago
commit c72fa4a586

Binary file not shown.

@ -0,0 +1,71 @@
{
"Version": 1,
"WorkspaceRootPath": "X:\\docdemo\\CLX_Archiver\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}|CLX_Archiver\\CLX_Archiver.csproj|x:\\docdemo\\clx_archiver\\clx_archiver\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}|CLX_Archiver\\CLX_Archiver.csproj|solutionrelative:clx_archiver\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{00000000-0000-0000-0000-000000000000}|\u003CSolution\u003E|CLX_Archiver||{04B8AB82-A572-4FEF-95CE-5222444B6B64}|"
},
{
"AbsoluteMoniker": "D:0:0:{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}|CLX_Archiver\\CLX_Archiver.csproj|X:\\docdemo\\CLX_Archiver\\clx_archiver\\app.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}",
"RelativeMoniker": "D:0:0:{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}|CLX_Archiver\\CLX_Archiver.csproj|solutionrelative:clx_archiver\\app.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 3,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "CLX_Archiver",
"DocumentMoniker": "X:\\docdemo\\CLX_Archiver\\CLX_Archiver\\CLX_Archiver.csproj",
"RelativeDocumentMoniker": "CLX_Archiver\\CLX_Archiver.csproj",
"ToolTip": "X:\\docdemo\\CLX_Archiver\\CLX_Archiver\\CLX_Archiver.csproj",
"RelativeToolTip": "CLX_Archiver\\CLX_Archiver.csproj",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-05-31T06:36:57.744Z"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "App.config",
"DocumentMoniker": "X:\\docdemo\\CLX_Archiver\\CLX_Archiver\\App.config",
"RelativeDocumentMoniker": "CLX_Archiver\\App.config",
"ToolTip": "X:\\docdemo\\CLX_Archiver\\CLX_Archiver\\App.config",
"RelativeToolTip": "CLX_Archiver\\App.config",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000601|",
"WhenOpened": "2024-05-29T15:35:33.184Z"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "X:\\docdemo\\CLX_Archiver\\CLX_Archiver\\Program.cs",
"RelativeDocumentMoniker": "CLX_Archiver\\Program.cs",
"ToolTip": "X:\\docdemo\\CLX_Archiver\\CLX_Archiver\\Program.cs",
"RelativeToolTip": "CLX_Archiver\\Program.cs",
"ViewState": "AQIAAGYAAAAAAAAAAAAewHMAAAA2AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-05-20T10:33:38.321Z",
"EditorCaption": ""
}
]
}
]
}
]
}

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34723.18
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLX_Archiver", "CLX_Archiver\CLX_Archiver.csproj", "{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {366A775B-1FC8-4123-8E16-8338886F2EA7}
EndGlobalSection
EndGlobal

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

@ -0,0 +1,58 @@
<?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>{7FA0D356-FBDA-4AED-AA84-BA165C1B7FB4}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>CLX_Archiver</RootNamespace>
<AssemblyName>CLX_Archiver</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<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>
<ItemGroup>
<Reference Include="Syncfusion.Compression.Base, Version=25.1462.35.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>E:\Software-Projekte\EDOKA\batch\EDKB09_DMS\bin\Syncfusion.Compression.Base.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>X:\clx\ x:\clxout\</StartArguments>
</PropertyGroup>
</Project>

@ -0,0 +1,168 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//using System.IO.Compression;
using System.Threading;
using System.Text.RegularExpressions;
using Syncfusion.Compression.Zip;
using System.Runtime.InteropServices;
using System.Data;
namespace CLX_Archiver
{
internal class Program
{
static void Main(string[] args)
{
DataSet ds = new DataSet();
string outpath = "";
string protocollpath = "";
string filenameind = "";
string ln = "";
string datum = "";
int jahr = 0;
if (args.Count() < 1)
{
return;
}
outpath = args[1];
protocollpath = args[1] + DateTime.Now.ToString("yyyyMMddhhmmss") + "_protokoll.log";
if (System.IO.File.Exists(args[1] + "inddone.xml"))
{
ds.ReadXml(args[1] + "inddone.xml");
}
else
{
DataTable dt = new DataTable();
dt.Columns.Add("indfile");
ds.Tables.Add(dt);
}
StreamWriter writer = new StreamWriter(protocollpath);
writer.WriteLine("DatumZeit;Dateiname;Datum;Jahr;ZIP Index;ZIP Daten;Resultat");
foreach (string filename in Directory.EnumerateFiles(args[0], "*.ind", SearchOption.AllDirectories))
{
Console.WriteLine(filename);
bool fertig = false;
while (fertig == false)
{
using (StreamReader file = new StreamReader(filename))
{
int counter = 0;
while ((ln = file.ReadLine()) != null && fertig == false)
{
if (ln.ToUpper() == "GROUP_FIELD_NAME:ARCHIVDATE")
{
ln = file.ReadLine();
Regex rgx = new Regex(@"\d{2}.\d{2}.\d{4}");
Match mat = rgx.Match(ln);
datum = mat.ToString();
jahr = Convert.ToInt32(datum.Substring((datum.Length - 4)));
datum = datum.Replace(".", "_");
fertig = true;
}
}
file.Close();
}
}
bool bereits_verarbeitet = false;
foreach (DataRow dr in ds.Tables[0].Rows)
{
if (dr[0].ToString() == System.IO.Path.GetFileName(filename))
{
bereits_verarbeitet = true;
}
}
string fn = "";
fn = System.IO.Path.GetFileName(filename);
if ((jahr > 2012) && (bereits_verarbeitet==false))
{
fn = System.IO.Path.GetFileName(filename);
string indfile = filename;
string indfilezip = args[1] + datum+"_"+System.IO.Path.GetFileName(indfile) + ".zip";
string outfile = indfile.Replace(".ind", ".out");
string outfilezip = args[1] + datum + "_"+System.IO.Path.GetFileName(outfile) + ".zip";
if (System.IO.File.Exists(indfile) && System.IO.File.Exists(outfile))
{
if (System.IO.File.Exists(indfilezip)){
indfilezip = newfilename(args[1], datum, System.IO.Path.GetFileName(indfile));
}
if (System.IO.File.Exists(outfilezip)){
outfilezip = newfilename(args[1], datum, System.IO.Path.GetFileName(outfile));
}
string res = "";
res = CompressFile(indfile, indfilezip);
if (res !="")
{
writer.WriteLine(DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss")+";"+ fn + ";" + datum + ";" + jahr.ToString() + ";" + System.IO.Path.GetFileName(indfilezip) + ";" + System.IO.Path.GetFileName(outfilezip) + ";Error ZIP");
}
res = CompressFile(outfile, outfilezip);
if (res != "")
{
writer.WriteLine(DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss") + ";" + fn + ";" + datum + ";" + jahr.ToString() + ";" + System.IO.Path.GetFileName(indfilezip) + ";" + System.IO.Path.GetFileName(outfilezip) + ";Error ZIP");
}
}
writer.WriteLine(DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss") + ";" + fn + ";" + datum + ";" + jahr.ToString() + ";" + System.IO.Path.GetFileName(indfilezip) + ";"+ System.IO.Path.GetFileName(outfilezip) +";done");
DataRow d = ds.Tables[0].NewRow();
d[0] = fn;
ds.Tables[0].Rows.Add(d);
}
else
{
if (bereits_verarbeitet == false)
{
writer.WriteLine(DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss") + ";" + fn + ";" + datum + ";" + jahr.ToString() + ";" + "" + ";" + "" + ";out of range");
}
}
}
writer.Close();
ds.WriteXml(args[1] + "inddone.xml");
}
private static string newfilename(string path, string datum, string filename)
{
string newfn = "";
int cnt = 0;
newfn = path + datum + "_" + filename + ".zip";
while (System.IO.File.Exists(newfn))
{
newfn = path + datum + "_" + cnt.ToString() + "_" + filename + ".zip";
cnt=cnt + 1;
}
return newfn;
}
private static string CompressFile(string sourceFileName, string destfilename)
{
try
{
ZipArchive zipArchive = new Syncfusion.Compression.Zip.ZipArchive();
zipArchive.DefaultCompressionLevel = Syncfusion.Compression.CompressionLevel.Best;
zipArchive.AddFile(sourceFileName);
zipArchive.Save(destfilename);
zipArchive = null;
return "";
}
catch (Exception e)
{
return "Error: " + e.Message;
}
}
}
}

@ -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("CLX_Archiver")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP Inc.")]
[assembly: AssemblyProduct("CLX_Archiver")]
[assembly: AssemblyCopyright("Copyright © HP Inc. 2024")]
[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("7fa0d356-fbda-4aed-aa84-ba165c1b7fb4")]
// 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")]

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

File diff suppressed because it is too large Load Diff

Binary file not shown.

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]

@ -0,0 +1 @@
9e70bfd8ef87d93dd5813316d5b0468aaff12b7e9bfa970c6c1b0591cf9adf3e

@ -0,0 +1,10 @@
X:\docdemo\CLX_Archiver\CLX_Archiver\bin\Debug\CLX_Archiver.exe.config
X:\docdemo\CLX_Archiver\CLX_Archiver\bin\Debug\CLX_Archiver.exe
X:\docdemo\CLX_Archiver\CLX_Archiver\bin\Debug\CLX_Archiver.pdb
X:\docdemo\CLX_Archiver\CLX_Archiver\obj\Debug\CLX_Archiver.csproj.AssemblyReference.cache
X:\docdemo\CLX_Archiver\CLX_Archiver\obj\Debug\CLX_Archiver.csproj.CoreCompileInputs.cache
X:\docdemo\CLX_Archiver\CLX_Archiver\obj\Debug\CLX_Archiver.exe
X:\docdemo\CLX_Archiver\CLX_Archiver\obj\Debug\CLX_Archiver.pdb
X:\docdemo\CLX_Archiver\CLX_Archiver\bin\Debug\Syncfusion.Compression.Base.dll
X:\docdemo\CLX_Archiver\CLX_Archiver\bin\Debug\Syncfusion.Compression.Base.xml
X:\docdemo\CLX_Archiver\CLX_Archiver\obj\Debug\CLX_Arch.F9BF4FDE.Up2Date

@ -0,0 +1,8 @@
touch README.md
git init
git checkout -b main
git add README.md
git commit -m "first commit"
git remote add origin https://gitea.shubweb.ch/shu/clx_archiver.git
git push -u origin main
pause
Loading…
Cancel
Save