added legacy code for reference
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
2026-06-04 14:56:43 +02:00
parent dbe6cd8653
commit c8a4d18f1a
93 changed files with 18065 additions and 0 deletions
Binary file not shown.
+131
View File
@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="fds.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="fuchs_ConnectionString" connectionString="Data Source=MSSQL4.NBG4.DOMAINXYZ.DE,10439;Initial Catalog=site_fuchs;Persist Security Info=False;TrustServerCertificate=true;Encrypt=true;User ID=fuchs_web;password='Bt5pL/cJg9oxb5';Connect Timeout=60;Load Balance Timeout=240;Max Pool Size=500;" providerName="System.Data.SqlClient" />
<add name="fuchs_fds_ConnectionString" connectionString="Data Source=MSSQL4.NBG4.DOMAINXYZ.DE,10439;Initial Catalog=site_fuchs;Persist Security Info=False;TrustServerCertificate=true;Encrypt=true;User ID=fuchs_fds;password='!Po@cGZ5bUn37khO';Connect Timeout=60;Load Balance Timeout=240;Max Pool Size=500;" providerName="System.Data.SqlClient" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<applicationSettings>
<fds.My.MySettings>
<setting name="ExecutionFrequency_Minutes" serializeAs="String">
<value>15</value>
</setting>
<setting name="DebugDetails" serializeAs="String">
<value>True</value>
</setting>
<setting name="MFR_UserName" serializeAs="String">
<value>system@sebastian-fuchs---bad-und-heizung-gmbh-und-co-kg.com</value>
</setting>
<setting name="MFR_Password" serializeAs="String">
<value>0oT4G3H2</value>
</setting>
<setting name="MFR_host" serializeAs="String">
<value>portal.mobilefieldreport.com</value>
</setting>
</fds.My.MySettings>
</applicationSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.2" newVersion="7.0.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Azure.Services.AppAuthentication" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.6.2.0" newVersion="1.6.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.2.0" newVersion="7.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.2.0" newVersion="7.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.11.0.0" newVersion="6.11.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.JsonWebTokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.11.0.0" newVersion="6.11.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IO.RecyclableMemoryStream" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.2.0" newVersion="2.3.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MimeKit" publicKeyToken="bede1c8a46c66814" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.Infrastructure" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+186
View File
@@ -0,0 +1,186 @@
<?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>{7A56E271-A6BE-4C34-A859-DADEBC4C7A54}</ProjectGuid>
<OutputType>Exe</OutputType>
<StartupObject>Sub Main</StartupObject>
<RootNamespace>fds</RootNamespace>
<AssemblyName>Fuchs_DataService</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Console</MyType>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>Fuchs_DataService.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>Fuchs_DataService.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Web.Infrastructure, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\NugetPackages\Microsoft.Web.Infrastructure.2.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\NugetPackages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SevenZipSharp, Version=1.6.1.23, Culture=neutral, PublicKeyToken=c8ff6ba0184838bb, processorArchitecture=MSIL">
<HintPath>..\..\..\NugetPackages\Squid-Box.SevenZipSharp.1.6.1.23\lib\net472\SevenZipSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\NugetPackages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\NugetPackages\Microsoft.AspNet.Razor.3.2.9\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="Topshelf, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b800c4cfcdeea87b, processorArchitecture=MSIL">
<HintPath>..\..\..\NugetPackages\Topshelf.4.3.0\lib\net452\Topshelf.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="fds_zip.vb" />
<Compile Include="fds_debug.vb" />
<Compile Include="fds_mfr.vb" />
<Compile Include="fds_shared.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="fds_main.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="install.bat" />
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="App.config" />
<None Include="packages.config" />
<Content Include="un-install.bat" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\WebProjectComponents\OCMS\OCMS.vbproj">
<Project>{ac8cba60-d786-48fd-a9f0-8b045a7bd505}</Project>
<Name>OCMS</Name>
</ProjectReference>
<ProjectReference Include="..\MFR_RESTClient\MFR_RESTClient.vbproj">
<Project>{00c70b53-516d-4d56-ad25-6757094b4335}</Project>
<Name>MFR_RESTClient</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="7z.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>
+13
View File
@@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <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>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>2</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>
@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("Fuchs_DataService")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("Fuchs_DataService")>
<Assembly: AssemblyCopyright("Copyright © 2021")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("b4650e09-34ae-4c0f-b973-63439b8a22f0")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
+63
View File
@@ -0,0 +1,63 @@
'------------------------------------------------------------------------------
' <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>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("fds.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace
@@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+118
View File
@@ -0,0 +1,118 @@
'------------------------------------------------------------------------------
' <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>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("15")> _
Public ReadOnly Property ExecutionFrequency_Minutes() As String
Get
Return CType(Me("ExecutionFrequency_Minutes"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("True")> _
Public ReadOnly Property DebugDetails() As Boolean
Get
Return CType(Me("DebugDetails"),Boolean)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("system@sebastian-fuchs---bad-und-heizung-gmbh-und-co-kg.com")> _
Public ReadOnly Property MFR_UserName() As String
Get
Return CType(Me("MFR_UserName"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("0oT4G3H2")> _
Public ReadOnly Property MFR_Password() As String
Get
Return CType(Me("MFR_Password"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("portal.mobilefieldreport.com")> _
Public ReadOnly Property MFR_host() As String
Get
Return CType(Me("MFR_host"),String)
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.fds.My.MySettings
Get
Return Global.fds.My.MySettings.Default
End Get
End Property
End Module
End Namespace
@@ -0,0 +1,21 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
<Profiles />
<Settings>
<Setting Name="ExecutionFrequency_Minutes" Type="System.String" Scope="Application">
<Value Profile="(Default)">15</Value>
</Setting>
<Setting Name="DebugDetails" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="MFR_UserName" Type="System.String" Scope="Application">
<Value Profile="(Default)">system@sebastian-fuchs---bad-und-heizung-gmbh-und-co-kg.com</Value>
</Setting>
<Setting Name="MFR_Password" Type="System.String" Scope="Application">
<Value Profile="(Default)">0oT4G3H2</Value>
</Setting>
<Setting Name="MFR_host" Type="System.String" Scope="Application">
<Value Profile="(Default)">portal.mobilefieldreport.com</Value>
</Setting>
</Settings>
</SettingsFile>
+134
View File
@@ -0,0 +1,134 @@
Option Explicit On
Partial Friend Module fds_debug
<Diagnostics.DebuggerStepThrough>
Public Function LogFile(FileName As String) As IO.FileInfo
Return New IO.FileInfo(AppBaseDirectory().FullName & FileName)
End Function
<Diagnostics.DebuggerStepThrough>
Public Function AppBaseDirectory() As IO.DirectoryInfo
Dim path As String = AppDomain.CurrentDomain.BaseDirectory + "tmp\"
Dim di As New IO.DirectoryInfo(path)
If di.Exists = True Then
Return di
ElseIf My.Computer.FileSystem.DirectoryExists(AppDomain.CurrentDomain.BaseDirectory) = True Then
di.Create()
Return di
Else : Return Nothing
End If
End Function
<Diagnostics.DebuggerStepThrough>
Public Sub DebugLog_async(CodeReference As String, SQLConnectionString As String, Optional exc As Exception = Nothing, Optional data As String = "", Optional context As Object = Nothing)
If CodeReference = "" OrElse SQLConnectionString = "" Then Exit Sub
Try
Threading.Tasks.Task.Run(Sub() Call DebugLog_sync(CodeReference:=CodeReference, SQLConnectionString:=SQLConnectionString, exc:=exc, data:=data, context:=context))
Catch ex As Exception
Call DebugLog_sync(CodeReference:="fds_debug DebugLog_async", SQLConnectionString:=SQLConnectionString, exc:=ex, data:="", context:=Nothing)
End Try
End Sub
<Diagnostics.DebuggerStepThrough>
Public Sub DebugLog_sync(CodeReference As String, SQLConnectionString As String, Optional exc As Exception = Nothing, Optional data As String = "", Optional context As Object = Nothing)
If CodeReference = "" OrElse SQLConnectionString = "" Then Exit Sub
Using con As New SqlClient.SqlConnection(SQLConnectionString)
Call DebugLog(CodeReference:=CodeReference, SQLConnection:=con, exc:=exc, data:=data, context:=context)
End Using
End Sub
<Diagnostics.DebuggerStepThrough>
Public Sub DebugLog(CodeReference As String, SQLConnection As SqlClient.SqlConnection, Optional exc As Exception = Nothing, Optional data As String = "", Optional context As Object = Nothing)
If CodeReference = "" OrElse IsNothing(SQLConnection) = True Then Exit Sub
Dim note As String = Now.ToString("yyyy.MM.dd HH:mm:ss") & " - " & CodeReference
Try
Try
If IsNothing(SQLConnection) = False Then
Dim pl As New List(Of SqlClient.SqlParameter) From {
New SqlClient.SqlParameter("@CodeReference", CodeReference),
New SqlClient.SqlParameter("@ExceptionMessage", If(IsNothing(exc), DBNull.Value, exc.Message)),
New SqlClient.SqlParameter("@StackTrace", If(IsNothing(exc), DBNull.Value, exc.StackTrace.ToString)),
New SqlClient.SqlParameter("@data", If(data, DBNull.Value))
}
Try
Dim w As Integer = 0
If SQLConnection.State = ConnectionState.Broken Then SQLConnection.Close()
If SQLConnection.State = ConnectionState.Connecting Then
w = 0
While SQLConnection.State = ConnectionState.Connecting And w < 10
System.Threading.Thread.Sleep(100)
w += 1
End While
ElseIf Not SQLConnection.State = ConnectionState.Open Then
SQLConnection.Open()
End If
w = 0
While Not SQLConnection.State = ConnectionState.Open And w < 10
System.Threading.Thread.Sleep(100)
w += 1
End While
Dim cmd As New SqlClient.SqlCommand("EXECUTE [dbo].[fds__admin_logdebug] @CodeReference,@ExceptionMessage,@StackTrace,@Data;", SQLConnection)
cmd.Parameters.AddRange(pl.ToArray)
Call cmd.ExecuteNonQuery()
'SQLConnection.Close()
cmd.Parameters.Clear()
Catch sqlex As Exception
End Try
End If
Catch dbex As Exception
End Try
If IsNothing(exc) = False Then
note &= (vbCrLf & "Exception:" & exc.Message & vbCrLf & "Stack:" & exc.StackTrace.ToString).Replace(vbLf, vbLf & " ")
End If
If data <> "" Then
note &= (vbCrLf & "Data:" & data).Replace(vbLf, vbLf & " ")
End If
note &= vbCrLf
Dim DebugLogfile As IO.FileInfo = LogFile("DebugLog.txt")
If DebugLogfile.Directory.Exists = True Then
IO.File.AppendAllText(DebugLogfile.FullName, note)
End If
Catch logex As Exception
Finally
Console.Write(note)
Debug.Print(note)
End Try
End Sub
Public Sub DebugToFile(note As String, Optional filename As String = "DebugLog.txt")
Try
Dim DebugLogfile As IO.FileInfo = LogFile(filename)
If DebugLogfile.Directory.Exists = True Then
IO.File.AppendAllText(DebugLogfile.FullName, Now.ToString & ": " & note & vbCrLf)
End If
Catch ex As Exception
End Try
End Sub
Public Sub DebugToFile(CodeReference As String, exc As Exception, data As String, Optional filename As String = "DebugLog.txt")
Dim note As String = CodeReference
If IsNothing(exc) = False Then
note &= (vbCrLf & "Exception:" & exc.Message & vbCrLf & "Stack:" & exc.StackTrace.ToString).Replace(vbLf, vbLf & " ")
End If
If data <> "" Then
note &= (vbCrLf & "Data:" & data).Replace(vbLf, vbLf & " ")
End If
Call DebugToFile(note, filename:=filename)
End Sub
End Module
+146
View File
@@ -0,0 +1,146 @@
Imports Topshelf
Imports json = Newtonsoft.Json.JsonConvert
Public Class fds_service
Implements Topshelf.ServiceControl
Dim WithEvents _timer As System.Timers.Timer
Public Sub New()
Me._timer = New System.Timers.Timer(My.Settings.ExecutionFrequency_Minutes * 60 * 1000) With {.AutoReset = True}
End Sub
Public Function Start(hostControl As HostControl) As Boolean Implements ServiceControl.Start
Me._timer.Start()
Return True
End Function
Public Function StartImmediately(hostControl As HostControl) As Boolean
Me._timer.Start()
System.Threading.Tasks.Task.Run(Sub()
If My.Settings.DebugDetails = True Then Call DebugToFile("fds__data_service - timer started with interval " & _timer.Interval.ToString, filename:="DebugDetail.txt")
Call update_mfr() 'start right away and do not wait until first intervall period is over
End Sub)
'do not wait and immediately return
Return True
End Function
Public Function [Stop](hostControl As HostControl) As Boolean Implements ServiceControl.Stop
Me._timer.Stop()
If My.Settings.DebugDetails = True Then System.Threading.Tasks.Task.Run(Sub() Call DebugToFile("fds__data_service - timer stopped", filename:="DebugDetail.txt"))
Return True
End Function
Public Sub timerElapsed() Handles _timer.Elapsed
Call update_mfr()
End Sub
Friend Shared Sub update_mfr()
If My.Settings.DebugDetails = True Then Call DebugToFile("fds__data_service update_mfr UpdateIfNecessary - timer elapsed", filename:="DebugDetail.txt")
'call update to data if necessary
Try
Dim t As Threading.Tasks.Task = Threading.Tasks.Task.Run(Async Function()
'Await UpdateIfNecessary_Single_async(et:=MFR_RESTClient.generic._generic.EntityTypes.Report, DebugDetails:=My.Settings.DebugDetails)
Await UpdateIfNecessary_async(DebugDetails:=My.Settings.DebugDetails)
Await UpdateRequested_async(DebugDetails:=My.Settings.DebugDetails)
Await GetInvoiceFiles_async(DebugDetails:=My.Settings.DebugDetails)
'Await getDatevZip()
End Function)
t.Wait()
Catch ex As Exception
Call DebugLog("fds__data_service update_mfr UpdateIfNecessary", SQLConnection:=Nothing, exc:=ex)
If My.Settings.DebugDetails = True Then Call DebugToFile("fds__data_service update_mfr UpdateIfNecessary", exc:=ex, data:="", filename:="DebugDetail.txt")
End Try
End Sub
End Class
Public Module fds_main
Sub Main()
Dim clArgs() As String = Environment.GetCommandLineArgs()
If (New String() {"digital-pc", "digital-dpc"}).Contains(Environment.MachineName.ToLower) = False Then
HostFactory.Run(Sub(x)
x.Service(Of fds_service)(AddressOf ServiceConfiguratorCallback)
x.EnablePauseAndContinue()
x.StartAutomatically()
x.RunAsLocalSystem()
x.SetDescription("MFR Data Sync")
x.SetDisplayName("MFR Data Sync")
x.SetServiceName("MFR Data Sync")
End Sub)
Else
Call fds_service.update_mfr()
'Call DEv()
End If
End Sub
Private Sub ServiceConfiguratorCallback(s As ServiceConfigurators.ServiceConfigurator(Of fds_service))
s.ConstructUsing(Function(name) New fds_service())
s.WhenStarted(Function(tc, Host)
Return tc.Start(Host)
End Function)
s.WhenStopped(Function(tc, Host)
Return tc.Stop(Host)
End Function)
s.BeforeStoppingService(Sub(HostStopContext)
If My.Settings.DebugDetails = True Then System.Threading.Tasks.Task.Run(Sub() Call DebugToFile("fds__data_service - beforestop", filename:="DebugDetail.txt"))
End Sub)
s.WhenPaused(Function(tc, Host)
Return tc.Stop(Host)
End Function)
s.WhenContinued(Function(tc, Host)
Return tc.StartImmediately(Host)
End Function)
End Sub
Public Sub DEv()
Using MFR As New fds_MFR_Client()
'Diagnostics.Debug.Print(MFR.ReadAnything(address:="https://portal.mobilefieldreport.com/odata/$metadata"))
'Diagnostics.Debug.Print(MFR.ReadAnything(address:="https://portal.mobilefieldreport.com/odata/Companies?$top=5&$expand=Contacts,Tags,ServiceObjects,MainContact"))
'Diagnostics.Debug.Print(MFR.ReadAnything(address:="https://portal.mobilefieldreport.com/odata/ServiceObjects?$expand=WarehouseManager,CustomValueSteps,Company,Product,Tags,ChildServiceObject,Contacts,Items"))
'Diagnostics.Debug.Print(MFR.ReadAnything(address:="https://portal.mobilefieldreport.com/odata/Contacts/$count"))
'Diagnostics.Debug.Print(MFR.getEntities())
Dim fle As Byte()
Try
fle = MFR.GetFile("https://portal.mobilefieldreport.com/mfr/Report/19584712737/Content/")
System.IO.File.WriteAllBytes("C:\Users\sailo\Desktop\Test.pdf", fle)
Catch ex As Exception
End Try
End Using
End Sub
End Module
Partial Friend Module fds_debug
Public Sub DebugLog(CodeReference As String, Optional exc As Exception = Nothing, Optional data As String = "", Optional context As Object = Nothing, Optional execute_async As Boolean = True)
If execute_async = True Then
Call DebugLog_async(CodeReference:=CodeReference, SQLConnectionString:=FDSConnectionString(), exc:=exc, data:=data, context:=context)
Else
Call DebugLog_sync(CodeReference:=CodeReference, SQLConnectionString:=FDSConnectionString(), exc:=exc, data:=data, context:=context)
End If
End Sub
End Module
File diff suppressed because it is too large Load Diff
+226
View File
@@ -0,0 +1,226 @@
Friend Module fds_shared
Friend Function SQLConnectionString() As String
Return Configuration.ConfigurationManager.ConnectionStrings("fuchs_ConnectionString").ConnectionString
End Function
Friend Function FDSConnectionString() As String
Return Configuration.ConfigurationManager.ConnectionStrings("fuchs_fds_ConnectionString").ConnectionString
End Function
Friend Function SqlCon() As SqlClient.SqlConnection
Return New SqlClient.SqlConnection(Configuration.ConfigurationManager.ConnectionStrings("fuchs_ConnectionString").ConnectionString)
End Function
Public Function RandomString(rs_length As Byte) As String
Dim r As New Random()
Dim s As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
Dim sb As New Text.StringBuilder
For i As Byte = 1 To rs_length
Dim idx As Integer = r.Next(0, s.Length)
sb.Append(s.Substring(idx, 1))
Next
Return sb.ToString()
End Function
'''' <summary>
'''' Returns a delimited <see cref="String" /> containing the field values from a <see cref="DataRow" />.
'''' </summary>
'''' <param name="source">
'''' The input <see cref="DataRow" />.
'''' </param>
'''' <param name="delimiter">
'''' The delimiter placed between field values. the default value is a comma.
'''' </param>
'''' <returns>
'''' A <see cref="String"/> containing the field values from the row separated by the specified delimiter.
'''' </returns>
'<Runtime.CompilerServices.Extension>
'Public Function ToCsv(source As DataRow,
' Optional delimiter As String = ",") As String
' Return String.Join(delimiter, source.ItemArray)
'End Function
''' <summary>
''' Returns a delimited <see cref="String" /> containing the field values from a <see cref="DataRow" />.
''' </summary>
''' <param name="source">
''' The input <see cref="DataRow" />.
''' </param>
''' <param name="quoteStrings">
''' <b>True</b> to wrap <see cref="String"/> values in double-quotes; otherwise, <b>False</b>.
''' If double-quotes are added, double-quotes within text are escaped with another double-quote.
''' </param>
''' <param name="delimiter">
''' The delimiter placed between field values. the default value is a comma.
''' </param>
''' <returns>
''' A <see cref="String"/> containing the field values from the row separated by the specified delimiter.
''' </returns>
<Runtime.CompilerServices.Extension>
Public Function ToCsv(source As DataRow,
quoteStrings As Boolean,
cultureinfo As Globalization.CultureInfo,
Optional delimiter As String = ",") As String
Dim fieldValues = source.ItemArray
Dim rx As New Text.RegularExpressions.Regex("(\"")")
'Wrap any String values in double-quotes and also escape any double-quotes in the String with another double-quote.
'replace array by converted array
fieldValues = fieldValues.Select(Function(o)
If IsNothing(o) OrElse IsDBNull(o) Then
Return ""
ElseIf o.GetType = GetType(String) Then
If quoteStrings = True Then
Return Microsoft.VisualBasic.ChrW(34) & rx.Replace(o.ToString, Microsoft.VisualBasic.ChrW(34) & Microsoft.VisualBasic.ChrW(34)) & Microsoft.VisualBasic.ChrW(34)
Else
Return o.ToString
End If
Else
Select Case o.GetType
Case GetType(Decimal)
Return DirectCast(o, Decimal).ToString(cultureinfo)
Case GetType(Single)
Return DirectCast(o, Single).ToString(cultureinfo)
Case GetType(Double)
Return DirectCast(o, Double).ToString(cultureinfo)
Case GetType(Boolean)
Return DirectCast(o, Boolean).ToString(cultureinfo)
Case GetType(System.DateTime)
Return DirectCast(o, DateTime).ToUniversalTime.ToString("U")
Case Else
Return o.ToString()
End Select
End If
End Function).ToArray()
Return String.Join(delimiter, fieldValues)
End Function
''' <summary>
''' Returns a delimited <see cref="String" /> containing the field values from the rows a <see cref="DataTable" />.
''' </summary>
''' <param name="source">The input <see cref="DataTable" />.</param>
''' <param name="includeHeaders"><b>True</b> to include a row of column headers; otherwise, <b>False</b></param>
''' <param name="quoteStrings"><b>True</b> to wrap <see cref="String"/> values in double-quotes; otherwise, <b>False</b>.
''' If double-quotes are added, double-quotes within text are escaped with another double-quote.</param>
''' <param name="rowDelimiter">The delimiter placed between rows. the default value is a line break comprising a carriage return and a line feed.</param>
''' <param name="fieldDelimiter">The delimiter placed between field values. the default value is a comma.</param>
''' <param name="cultureinfo">The culture that is used to convert float-point numbers like <see cref="Decimal" /> or <see cref="Double"/> to string. <br/>This falls back to InvariantCulture, if not provided.</param>
''' <param name="quoteHeader"><b>True</b> to wrap <see cref="String"/> column header names in double-quotes; otherwise, <b>False</b>.<br />
''' If no value is provided, the settings falls back to <b>quoteStrings</b> parameter.</param>
''' <returns>A <see cref="String"/> containing the field values from the rows of the table separated by the specified delimiters.</returns>
<Runtime.CompilerServices.Extension>
Public Function ToCsv(source As DataTable,
includeHeaders As Boolean,
quoteStrings As Boolean,
Optional rowDelimiter As String = ControlChars.CrLf,
Optional fieldDelimiter As String = ",",
Optional cultureinfo As Globalization.CultureInfo = Nothing,
Optional quoteHeader As Boolean? = Nothing) As String
If quoteHeader.HasValue = False Then quoteHeader = quoteStrings
cultureinfo = If(cultureinfo, Globalization.CultureInfo.InvariantCulture) 'fallback if not provided
Dim rows = source.Rows.
Cast(Of DataRow)().
Select(Function(row) row.ToCsv(quoteStrings:=quoteStrings, cultureinfo:=cultureinfo, delimiter:=fieldDelimiter))
If includeHeaders = True Then
Dim rx As New Text.RegularExpressions.Regex("(\"")")
Dim headers = String.Join(fieldDelimiter,
source.Columns.
Cast(Of DataColumn)().
Select(Function(column) If(quoteHeader.Value,
Microsoft.VisualBasic.ChrW(34) & rx.Replace(column.ColumnName.ToString, Microsoft.VisualBasic.ChrW(34) & Microsoft.VisualBasic.ChrW(34)) & Microsoft.VisualBasic.ChrW(34),
column.ColumnName)))
rows = {headers}.Concat(rows)
End If
Return String.Join(rowDelimiter, rows)
End Function
''' <summary>
''' Returns a text-file containing the string, created by streamwriter.
''' </summary>
''' <param name="input">The input <see cref="String"/>.</param>
''' <param name="encoding">The encoding used with streamwriter for the textfile. This falls back to <see cref="System.Text.Encoding.utf8"/>, if not provided.</param>
''' <returns>A file as byte-array.</returns>
<Runtime.CompilerServices.Extension>
Public Function ToByteArray(input As String, Optional encoding As System.Text.Encoding = Nothing) As Byte()
Dim content As Byte() = Nothing
Using ms As New IO.MemoryStream
Using sw As New IO.StreamWriter(ms, encoding:=If(encoding, System.Text.Encoding.UTF8))
sw.Write(input)
sw.Flush()
ms.Position = 0
content = ms.ToArray()
End Using
End Using
Return content
End Function
Public Function WriteStreamToDisk(ByVal StreamToWrite As IO.Stream, ByVal FilePath As String) As Boolean
'Dim tmpFilePath As String = Left(FilePath, Len(FilePath) - 4) & ".tmp"
Dim cnt = 0
restart:
Try
If My.Computer.FileSystem.FileExists(FilePath) Then My.Computer.FileSystem.DeleteFile(FilePath)
Using FleStream As System.IO.FileStream = New System.IO.FileStream(FilePath, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.Delete)
ReadWriteStream(StreamToWrite, FleStream, True)
End Using
Catch ex As Exception
System.Diagnostics.Debug.WriteLine($"{"WriteStreamToDisk - " & ex.Message}")
cnt += 1
If cnt = 6 Then
Return False
Exit Function
Else
Threading.Thread.Sleep(500)
GoTo restart
End If
End Try
Return True
End Function
Public Function ReadWriteStream(ByVal readStream As IO.Stream, ByVal writeStream As IO.Stream, ByVal closeWriteStream As Boolean) As Boolean
Try
Dim Length As Integer = 256
Dim buffer(Length - 1) As Byte
readStream.Seek(0, System.IO.SeekOrigin.Begin)
Dim bytesRead As Integer = readStream.Read(buffer, 0, Length)
'write the required bytes
While (bytesRead > 0)
writeStream.Write(buffer, 0, bytesRead)
bytesRead = readStream.Read(buffer, 0, Length)
End While
readStream.Close()
If closeWriteStream = True Then writeStream.Close()
Return True
Catch ex As Exception
System.Diagnostics.Debug.WriteLine($"{"ReadWriteStream - " & ex.Message}")
Call OCMS.debug_log("files_folders ReadWriteStream", ex)
Return False
End Try
End Function
<System.Diagnostics.DebuggerStepThrough()>
<Runtime.CompilerServices.Extension()>
Public Function NameBase(ByVal FI As System.IO.FileInfo) As String
Return FI.Name.Substring(startIndex:=0, length:=FI.Name.Length - FI.Extension.Length)
End Function
<System.Diagnostics.DebuggerStepThrough()>
<Runtime.CompilerServices.Extension()>
Public Function MimeType(ByVal FI As System.IO.FileInfo) As String
Return System.Web.MimeMapping.GetMimeMapping(FI.Name)
End Function
End Module
+500
View File
@@ -0,0 +1,500 @@
Imports SevenZip 'Squid-Box.SevenZipSharp
Imports System.IO
Namespace Global.fds
Public Class Archive
Implements IDisposable
'Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
'Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'Public Enum Timeunit As Long
' Milliseconds = 0
' Seconds = 1000
' Minutes = 60000
'End Enum
'Public Sub Wait(ByVal No As Integer, ByVal unit As Timeunit)
' Dim tme As Long = CLng(No * unit)
' Sleep(tme)
'End Sub
Public Event Saving()
Public Event FileSaved()
Public Event FileStreamCreated()
Private _ArchiveFile As FileInfo
Private _ArchivePassword As String
Private _ArchiveFormat As OutArchiveFormat
Public TempPath As String = System.AppDomain.CurrentDomain.BaseDirectory
Public Property ArchiveFileStream As IO.Stream
Private ZipOut As SevenZipExtractor
Private ZipIn As SevenZipCompressor
Public ZipAppend As Boolean = True
Public ExitOK As Boolean = False
Public ZipInOK As Boolean = False
Public Sub New(ByVal ArchiveFile As FileInfo, Optional ByVal ArchivePassword As String = "", Optional ByVal INIT As Boolean = True, Optional ByVal Type As OutArchiveFormat = OutArchiveFormat.SevenZip)
Me._ArchiveFormat = Type
Me._ArchiveFile = New FileInfo(ArchiveFile.FullName.Replace(ArchiveFile.Extension, If(Type = OutArchiveFormat.SevenZip, ".7z", ArchiveFile.Extension)))
Me._ArchivePassword = ArchivePassword
If INIT = True Then Call InitZipIn(Type)
End Sub
Private Sub InitZipIn(ByVal Type As OutArchiveFormat)
Dim assemblydirectory As IO.DirectoryInfo
If Zipping.SevenZipPath = "" Then
Try
assemblydirectory = New IO.DirectoryInfo(New Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)).LocalPath)
Dim zip As IO.FileInfo = assemblydirectory.GetFiles("7z.dll", SearchOption.AllDirectories).FirstOrDefault
Zipping.SevenZipPath = If(IsNothing(zip), "", zip.FullName)
Finally
If Zipping.SevenZipPath = "" Then
assemblydirectory = New IO.DirectoryInfo(System.AppDomain.CurrentDomain.BaseDirectory)
Dim zip As IO.FileInfo = assemblydirectory.GetFiles("7z.dll", SearchOption.AllDirectories).FirstOrDefault
Zipping.SevenZipPath = If(IsNothing(zip), "", zip.FullName)
End If
End Try
If Zipping.SevenZipPath = "" Then
OCMS.debug_log("DDA.intranet.Zipping Archive InitZipIn", error:="SevenZipPath not found")
End If
End If
SevenZipCompressor.SetLibraryPath(SevenZipPath)
Me.ZipIn = New SevenZipCompressor
With Me.ZipIn
If Type = OutArchiveFormat.SevenZip AndAlso Me._ArchiveFile.Extension.ToLower.Contains("7z") = True Then
.ArchiveFormat = OutArchiveFormat.SevenZip
Else
.ArchiveFormat = Type
End If
.CompressionLevel = SevenZip.CompressionLevel.Ultra
Select Case .ArchiveFormat
Case OutArchiveFormat.SevenZip
.CompressionMethod = SevenZip.CompressionMethod.Lzma2
Case OutArchiveFormat.Zip, OutArchiveFormat.GZip
.CompressionMethod = CompressionMethod.Deflate
Case Else
.CompressionMethod = CompressionMethod.Default
End Select
If ZipAppend = True Then
.CompressionMode = SevenZip.CompressionMode.Append
Else
.CompressionMode = SevenZip.CompressionMode.Create
End If
.DirectoryStructure = False
End With
Me.ZipInOK = True
End Sub
Public Sub Extract(ByVal DataArchiveFilePath As FileInfo, ByVal TgtDirectory As DirectoryInfo, Optional ByVal Type As OutArchiveFormat = Nothing)
If DataArchiveFilePath.Exists Then
If IsNothing(Type) = True AndAlso DataArchiveFilePath.Extension.ToLower.Contains("7z") = True Then
Type = OutArchiveFormat.SevenZip
ElseIf IsNothing(Type) = True Then
Type = OutArchiveFormat.Zip
End If
If Me.ZipInOK = False Then Call InitZipIn(Type)
If Me._ArchivePassword = "" Then
Me.ZipOut = New SevenZipExtractor(DataArchiveFilePath.FullName)
Else
Me.ZipOut = New SevenZipExtractor(DataArchiveFilePath.FullName, Me._ArchivePassword)
End If
Try
If Me.ZipOut.ArchiveFileData(0).Encrypted = False And Not Me._ArchivePassword = "" Then
Me._ArchivePassword = ""
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine($"{"zip Extract - " & ex.Message}")
OCMS.debug_log("DDA.intranet.Zipping Archive InitZipIn", ex:=ex, data:=New With {.DataArchiveFilePath = DataArchiveFilePath.FullName, .TgtDirectory = TgtDirectory.FullName})
Exit Sub
End Try
If Not ZipOut Is Nothing Then
Me.ZipOut.ExtractArchive(TgtDirectory.FullName)
Me.ZipOut.Dispose()
End If
End If
End Sub
Public Function FileInfo_to_Filepaths_Converter() As Converter(Of FileInfo, String)
Return New Converter(Of FileInfo, String)(Function(filepath As FileInfo) filepath.FullName())
End Function
Public Function Filepaths_to_FileInfo_Converter() As Converter(Of String, FileInfo)
Return New Converter(Of String, FileInfo)(Function(filepath As String) New FileInfo(filepath))
End Function
Public Function Compress(ByVal FilePaths As List(Of String), Optional ByVal ArchiveFilePath As String = Nothing, Optional ByVal ArchivePass As String = Nothing, Optional ByVal Type As OutArchiveFormat = OutArchiveFormat.SevenZip) As Boolean
Return Compress(Files:=FilePaths.ConvertAll(Filepaths_to_FileInfo_Converter()), ArchiveFile:=If(IsNothing(ArchiveFilePath), Nothing, New FileInfo(ArchiveFilePath)), ArchivePass:=ArchivePass, Type:=Type)
End Function
Public Function Compress(ByVal Files As List(Of FileInfo), Optional ByVal ArchiveFile As FileInfo = Nothing, Optional ByVal ArchivePass As String = Nothing, Optional ByVal Type As OutArchiveFormat = OutArchiveFormat.SevenZip) As Boolean
If Files.Count = 0 Then Return True
If Me.ZipInOK = False Then Call InitZipIn(Type)
If IsNothing(ArchiveFile) = True Then ArchiveFile = Me._ArchiveFile
If If(IsNothing(ArchivePass), "", ArchivePass) = "" Then ArchivePass = Me._ArchivePassword
If ArchiveFile.Exists() AndAlso Me.ZipAppend = True Then
Me.ZipIn.CompressionMode = CompressionMode.Append
Else
If ArchiveFile.Exists = True Then ArchiveFile.Delete()
Me.ZipIn.CompressionMode = CompressionMode.Create
End If
Try
Dim FilesVerified As FileInfo() = Files.Where(Function(f As FileInfo) f.Exists).ToArray()
Dim FilePaths As String() = Array.ConvertAll(Of FileInfo, String)(FilesVerified, FileInfo_to_Filepaths_Converter())
If ArchivePass = "" Then
Me.ZipIn.CompressFiles(ArchiveFile.FullName, FilePaths)
Else
Me.ZipIn.EncryptHeaders = True
Me.ZipIn.ZipEncryptionMethod = ZipEncryptionMethod.Aes256
Me.ZipIn.CompressFilesEncrypted(ArchiveFile.FullName, ArchivePass, FilePaths)
End If
RaiseEvent FileSaved()
'Debug.Print("Saved: " & Now().ToString)
Me.ExitOK = True
'Disposing...
Me.ZipIn = Nothing
Me.ZipInOK = False
Catch ex As Exception
'Debug.Print("NOT Saved: " & Now().ToString)
Me.ExitOK = False
End Try
Return Me.ExitOK AndAlso ArchiveFile.Exists
End Function
Public Function Compress(ByVal FilePath As String) As Boolean
Dim FL As New List(Of String) From {
FilePath
}
Call Compress(FL)
Return True
End Function
Public Function CompressToStream(ByVal FilePath As String) As Boolean
Dim FL As New List(Of String) From {
FilePath
}
Call CompressToStream(FL)
Return True
End Function
Public Function CompressToStream(ByVal FilePaths As List(Of String)) As Boolean
Return CompressToStream(Files:=FilePaths.ConvertAll(Filepaths_to_FileInfo_Converter()))
End Function
Public Function CompressToStream(ByVal Files As List(Of FileInfo)) As Boolean
If Files.Count = 0 Then Return True
If Me.ZipInOK = False Then Call InitZipIn(Me._ArchiveFormat)
If IsNothing(_ArchiveFileStream) Then 'nur wenn der interne leer ist...
Me.ZipIn.CompressionMode = CompressionMode.Create
Me._ArchiveFileStream = New MemoryStream
Else
Me.ZipIn.CompressionMode = CompressionMode.Append
End If
Try
Dim FilesVerified As FileInfo() = Files.Where(Function(f As FileInfo) f.Exists).ToArray()
Dim FilePaths As String() = Array.ConvertAll(Of FileInfo, String)(FilesVerified, FileInfo_to_Filepaths_Converter())
If Me._ArchivePassword = "" Then
Me.ZipIn.CompressFiles(Me._ArchiveFileStream, FilePaths)
Else
Me.ZipIn.EncryptHeaders = True
Me.ZipIn.ZipEncryptionMethod = ZipEncryptionMethod.Aes256
Me.ZipIn.CompressFilesEncrypted(Me._ArchiveFileStream, Me._ArchivePassword, FilePaths)
End If
Me._ArchiveFileStream.Seek(0, SeekOrigin.Begin)
RaiseEvent FileStreamCreated()
'Debug.Print("Saved: " & Now().ToString)
Me.ExitOK = True
'Disposing...
Me.ZipIn = Nothing
Me.ZipInOK = False
Catch ex As Exception
'Debug.Print("NOT Saved: " & Now().ToString)
Me.ExitOK = False
End Try
Return Me.ExitOK
End Function
Public Function CompressToStream(ByVal Files As List(Of FileInfo), ByRef TargetStream As IO.Stream) As Boolean
If Files.Count = 0 Then Return True
If Me.ZipInOK = False Then Call InitZipIn(Me._ArchiveFormat)
If IsNothing(TargetStream) = True Then
TargetStream = New MemoryStream
End If
Me.ZipIn.CompressionMode = CompressionMode.Create
Dim FilePaths As String() = New String() {}
Try
Dim FilesVerified As FileInfo() = Files.Where(Function(f As FileInfo) f.Exists).ToArray()
FilePaths = Array.ConvertAll(Of FileInfo, String)(FilesVerified, FileInfo_to_Filepaths_Converter())
If Me._ArchivePassword = "" Then
Me.ZipIn.CompressFiles(TargetStream, FilePaths)
Else
Me.ZipIn.EncryptHeaders = True
Me.ZipIn.ZipEncryptionMethod = ZipEncryptionMethod.Aes256
Me.ZipIn.CompressFilesEncrypted(TargetStream, Me._ArchivePassword, FilePaths)
End If
TargetStream.Seek(0, SeekOrigin.Begin)
'Debug.Print("Saved: " & Now().ToString)
Me.ExitOK = True
'Disposing...
Me.ZipIn = Nothing
Me.ZipInOK = False
Catch ex As Exception
'Debug.Print("NOT Saved: " & Now().ToString)
OCMS.debug_log("IntranetController zip", ex, data:=New With {.filepaths = FilePaths})
Me.ExitOK = False
End Try
Return Me.ExitOK
End Function
Public Function CompressToStream(ByVal Files As Dictionary(Of String, IO.Stream)) As Boolean
If Files.Count = 0 Then Return True
If Me.ZipInOK = False Then Call InitZipIn(Me._ArchiveFormat)
If IsNothing(_ArchiveFileStream) Then 'nur wenn der interne leer ist...
Me.ZipIn.CompressionMode = CompressionMode.Create
Me._ArchiveFileStream = New MemoryStream
Else
Me.ZipIn.CompressionMode = CompressionMode.Append
End If
Try
If Me._ArchivePassword = "" Then
Me.ZipIn.CompressStreamDictionary(streamDictionary:=Files, Me._ArchiveFileStream)
Else
Me.ZipIn.EncryptHeaders = True
Me.ZipIn.ZipEncryptionMethod = ZipEncryptionMethod.Aes256
Me.ZipIn.CompressStreamDictionary(streamDictionary:=Files, Me._ArchiveFileStream, password:=Me._ArchivePassword)
End If
Me._ArchiveFileStream.Seek(0, SeekOrigin.Begin)
RaiseEvent FileStreamCreated()
'Debug.Print("Saved: " & Now().ToString)
Me.ExitOK = True
'Disposing...
Me.ZipIn = Nothing
Me.ZipInOK = False
Catch ex As Exception
'Debug.Print("NOT Saved: " & Now().ToString)
Me.ExitOK = False
End Try
Return Me.ExitOK
End Function
Public Function CompressToStream(ByVal Files As Dictionary(Of String, Byte()), Optional targetstream As IO.Stream = Nothing) As Boolean
If Files.Count = 0 Then Return True
If Me.ZipInOK = False Then Call InitZipIn(Me._ArchiveFormat)
If IsNothing(_ArchiveFileStream) Then 'nur wenn der interne leer ist...
Me.ZipIn.CompressionMode = CompressionMode.Create
Me._ArchiveFileStream = New MemoryStream
Else
Me.ZipIn.CompressionMode = CompressionMode.Append
End If
Try
Dim FilesStreams As New Dictionary(Of String, IO.Stream)
For Each fy As String In Files.Keys
FilesStreams.Add(fy, New IO.MemoryStream(Files(fy)))
Next
If Me._ArchivePassword = "" Then
Me.ZipIn.CompressStreamDictionary(streamDictionary:=FilesStreams, If(IsNothing(targetstream), Me._ArchiveFileStream, targetstream))
Else
Me.ZipIn.EncryptHeaders = True
Me.ZipIn.ZipEncryptionMethod = ZipEncryptionMethod.Aes256
Me.ZipIn.CompressStreamDictionary(streamDictionary:=FilesStreams, If(IsNothing(targetstream), Me._ArchiveFileStream, targetstream), password:=Me._ArchivePassword)
End If
Me._ArchiveFileStream.Seek(0, SeekOrigin.Begin)
RaiseEvent FileStreamCreated()
'Debug.Print("Saved: " & Now().ToString)
Me.ExitOK = True
'Disposing...
Me.ZipIn = Nothing
Me.ZipInOK = False
Catch ex As Exception
'Debug.Print("NOT Saved: " & Now().ToString)
Me.ExitOK = False
End Try
Return Me.ExitOK
End Function
Public Function WriteArchiveStreamToDisk(Optional ByVal ArchiveFile As IO.FileInfo = Nothing) As Boolean
Try
If Me._ArchiveFile.Exists() Then Me._ArchiveFile.Delete()
Catch ex As Exception
End Try
If IsNothing(ArchiveFile) = False Then 'Wenn ein DateiPfad hier übergeben wurde...
WriteStreamToDisk(Me._ArchiveFileStream, ArchiveFile.FullName)
Else ' sonst wird der interne genommen
WriteStreamToDisk(Me._ArchiveFileStream, Me._ArchiveFile.FullName)
End If
Return Me._ArchiveFile.Exists
End Function
'Private ArchiveMail As EMail = Nothing
'Public Function SendZip(Optional ByVal Subject As String = Nothing, Optional ByVal BodyText As String = Nothing) As Boolean
' Try
' If ArchiveMail Is Nothing Then Exit Function
' If Not Subject = Nothing Then
' ArchiveMail.Subject = Subject
' End If
' If Not BodyText = Nothing Then
' ArchiveMail.Body = BodyText
' End If
' 'Send with archive as attachment
' Return ArchiveMail.Send(_ArchivePath.Path)
' Catch ex As Exception
' Return False
' End Try
'End Function
'Public Function SendZipStream(Optional ByVal Subject As String = Nothing, Optional ByVal BodyText As String = Nothing) As Boolean
' Try
' If ArchiveMail Is Nothing Then Exit Function
' If Not Subject = Nothing Then
' ArchiveMail.Subject = Subject
' End If
' If Not BodyText = Nothing Then
' ArchiveMail.Body = BodyText
' End If
' 'Send with archive as attachment
' Return ArchiveMail.Send(_ArchivePath.Name, _ArchiveFileStream)
' Catch ex As Exception
' Return False
' End Try
'End Function
'Public Sub SetMailSettings(ByVal SMTP As MailServer_Settings, ByVal MAIL As Mail_Settings)
' ArchiveMail = New EMail(SMTP, MAIL)
'End Sub
#Region "IDisposable Support"
Private disposedValue As Boolean ' To detect redundant calls
' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
Try
If IsNothing(Me._ArchiveFileStream) = False Then Me._ArchiveFileStream.Dispose()
If IsNothing(Me.ZipOut) = False Then Me.ZipOut.Dispose()
Me.ZipIn = Nothing
Catch ex As Exception
End Try
End If
' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
disposedValue = True
End Sub
' TODO: override Finalize() only if Dispose(disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub
' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
Dispose(True)
' TODO: uncomment the following line if Finalize() is overridden above.
' GC.SuppressFinalize(Me)
End Sub
#End Region
End Class
Public Module Zipping
Public SevenZipPath As String = ""
Public Sub FastAppend(ByVal FileToZip As FileInfo, ByVal ArchiveFile As FileInfo)
If FileToZip.Exists AndAlso IsNothing(ArchiveFile) = False AndAlso ArchiveFile.Exists Then
Dim Zip As New Archive(ArchiveFile) With {
.ZipAppend = True
}
Dim FL As New List(Of String) From {
FileToZip.FullName
}
Zip.Compress(FL)
End If
End Sub
Public Sub FastAppend(ByVal FileToZip As FileInfo, ByVal TgtArchiveDirectory As DirectoryInfo, ByVal ArchiveName As String)
Dim ArchiveFile As New FileInfo(TgtArchiveDirectory.FullName & If(Strings.Right(TgtArchiveDirectory.FullName, 1) = "\", "", "\") & ArchiveName)
If ArchiveFile.Exists Then Call FastAppend(FileToZip, ArchiveFile:=ArchiveFile)
End Sub
Public Sub FastAppend(ByVal FileToZip As FileInfo, ByVal TgtArchiveDirectoryPath As String, ByVal ArchiveName As String)
Dim ArchiveFile As New FileInfo(TgtArchiveDirectoryPath & If(Strings.Right(TgtArchiveDirectoryPath, 1) = "\", "", "\") & ArchiveName)
If ArchiveFile.Exists Then Call FastAppend(FileToZip, ArchiveFile:=ArchiveFile)
End Sub
Public Function FastZip(ByVal DirectoryToZip As DirectoryInfo, Optional ByVal Append As Boolean = True) As IO.FileInfo
If DirectoryToZip.Exists Then
Dim ZipFile As New FileInfo(DirectoryToZip.Name + ".7z"), cnt As Integer = 0
If Append = False Then
Do Until ZipFile.Exists = False
cnt += 1
ZipFile = New FileInfo(DirectoryToZip.Name & "_" & CStr(cnt) & ".7z")
Loop
End If
Dim Zip As New Archive(ZipFile) With {
.ZipAppend = Append
}
Zip.Compress(New List(Of FileInfo)(DirectoryToZip.GetFiles))
Return If(ZipFile.Exists, ZipFile, Nothing)
Else
Return Nothing
End If
End Function
Public Function FastZip(ByVal FileToZip As IO.FileInfo, Optional ByVal Append As Boolean = True) As IO.FileInfo
If FileToZip.Exists Then
Dim ZipFile As New FileInfo(FileToZip.Name.Replace("." & FileToZip.Extension, "") + ".7z"), cnt As Integer = 0
If Append = False Then
Do Until ZipFile.Exists = False
cnt += 1
ZipFile = New FileInfo(FileToZip.Name.Replace("." & FileToZip.Extension, "") & "_" & CStr(cnt) & ".7z")
Loop
End If
Dim Zip As New Archive(ZipFile) With {
.ZipAppend = Append
}
Dim FL As New List(Of FileInfo) From {
FileToZip
}
Zip.Compress(FL)
Return If(ZipFile.Exists, ZipFile, Nothing)
Else
Return Nothing
End If
End Function
Public Function FastZip(ByVal TgtDirectory As String, ByVal Filename As String, Optional ByVal Append As Boolean = True) As IO.FileInfo
Return FastZip(New FileInfo(TgtDirectory & If(Strings.Right(TgtDirectory, 1) = "\", "", "\") & Filename), Append)
End Function
End Module
End Namespace
+1
View File
@@ -0,0 +1 @@
Fuchs_Dataservice.exe install --autostart
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.Razor" version="3.2.9" targetFramework="net48" />
<package id="Microsoft.Web.Infrastructure" version="2.0.0" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="Squid-Box.SevenZipSharp" version="1.6.1.23" targetFramework="net48" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net48" />
<package id="Topshelf" version="4.3.0" targetFramework="net48" />
</packages>
+1
View File
@@ -0,0 +1 @@
Fuchs_Dataservice.exe uninstall