Key von Syncfusion wird aus der Dongle nun gelesen

This commit is contained in:
HuskyTeufel
2022-03-25 15:47:46 +01:00
parent d96c618a21
commit d350791acc
10 changed files with 145 additions and 42 deletions

View File

@@ -45,7 +45,10 @@ namespace BerichtGen
{ {
InitializeComponent(); InitializeComponent();
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NDE3ODkzQDMxMzgyZTM0MmUzMFU4Zi9HelJVSzVxQXVLdlp6NTRuOXhwR1JtdzgybVBsdGNDeGZwdkhwNGM9"); Dongle dongle = new Dongle(60);
Trace.WriteLine("FrmOptions: " + dongle.SyncfusionKey);
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(dongle.SyncfusionKey);
dongle.CleanDongle();
this.firma = firma; this.firma = firma;

View File

@@ -97,7 +97,9 @@ namespace BerichtGen
/// <returns></returns> /// <returns></returns>
public static bool GetGraphics(List<UVcsvStrukture> struktures,string destinationPath) public static bool GetGraphics(List<UVcsvStrukture> struktures,string destinationPath)
{ {
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NDE3ODkzQDMxMzgyZTM0MmUzMFU4Zi9HelJVSzVxQXVLdlp6NTRuOXhwR1JtdzgybVBsdGNDeGZwdkhwNGM9"); Dongle dongle = new Dongle(60);
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(dongle.SyncfusionKey);
dongle.CleanDongle();
ChartControl tempChart = getGraph(struktures, "Temperatur"); ChartControl tempChart = getGraph(struktures, "Temperatur");
if (tempChart == null) return false; if (tempChart == null) return false;

60
Dongle/Dongle.csproj Normal file
View File

@@ -0,0 +1,60 @@
<?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>{3362303F-994B-412B-B50D-7C701D5751D6}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dongle</RootNamespace>
<AssemblyName>Dongle</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WibuCmNET, Version=7.40.4997.501, Culture=neutral, PublicKeyToken=01d86e1eb0c69c23, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\WibuCmNET.dll</HintPath>
</Reference>
<Reference Include="wupi.net, Version=9.20.8.500, Culture=neutral, PublicKeyToken=5f399135ee0c35d4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\wupi.net.dll</HintPath>
</Reference>
<Reference Include="WupiEngineNet, Version=11.0.4997.501, Culture=neutral, PublicKeyToken=8d0bd6872db0b9bb, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\WupiEngineNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Dongle.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -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("Dongle")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Dongle")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[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("3362303f-994b-412b-b50d-7c701d5751d6")]
// 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")]

View File

@@ -1,23 +1,19 @@
using CodeMeter; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using CodeMeter;
/* namespace SanShared
*
*
* 4e 6a 41 77 4e 6a 51 7a 51 44 4d 78 4d 7a 6b 79 5a 54 4d 30 4d 6d 55 7a 4d 47 35 4c 61 32 55 7a 51 31 46 30 52 33 64 46 5a 45 68 35 56 57 74 47 61 7a 5a 30 61 48 70 55 57 69 39 58 64 6b 78 4a 54 32 78 43 62 6b 74 58 52 58 46 57 63 30 5a 73 64 7a 41 39
*/
namespace SanSystem
{ {
class Dongle: IDisposable //4e 6a 41 77 4e 6a 51 7a 51 44 4d 78 4d 7a 6b 79 5a 54 4d 30 4d 6d 55 7a 4d 47 35 4c 61 32 55 7a 51 31 46 30 52 33 64 46 5a 45 68 35 56 57 74 47 61 7a 5a 30 61 48 70 55 57 69 39 58 64 6b 78 4a 54 32 78 43 62 6b 74 58 52 58 46 57 63 30 5a 73 64 7a 41 39
public class Dongle : IDisposable
{ {
uint FirmCode; uint FirmCode;
uint ProductCode; uint ProductCode;
public string SyncfusionKey =""; public string SyncfusionKey = "";
Api cmApi; Api cmApi;
CmCredential cmCred; CmCredential cmCred;
@@ -49,7 +45,7 @@ namespace SanSystem
hcmse = cmApi.CmAccess2(CmAccessOption.Local, cmAcc); hcmse = cmApi.CmAccess2(CmAccessOption.Local, cmAcc);
if(hcmse == null) if (hcmse == null)
{ {
ErrorCodes2 code = cmApi.CmGetLastErrorCode2(); ErrorCodes2 code = cmApi.CmGetLastErrorCode2();
string output = string.Format("{0}", code); string output = string.Format("{0}", code);
@@ -57,7 +53,7 @@ namespace SanSystem
} }
if (!CheckDongleVorhanden()) if (!CheckDongleVorhanden())
Trace.WriteLine("Dongle nicht vorhanden"); throw new Exception("Dongle not connected");
cmBoxInfo = new CmBoxInfo(); cmBoxInfo = new CmBoxInfo();
@@ -70,16 +66,21 @@ namespace SanSystem
CmEntryData[] pCmBoxEntry = (CmEntryData[])cmApi.CmGetInfo(hcmse, CmGetInfoOption.EntryData); CmEntryData[] pCmBoxEntry = (CmEntryData[])cmApi.CmGetInfo(hcmse, CmGetInfoOption.EntryData);
for(int i = 0; i < pCmBoxEntry.Length; i++) for (int i = 0; i < pCmBoxEntry.Length; i++)
{ {
switch(pCmBoxEntry[i].Ctrl & 0x0ffff) switch (pCmBoxEntry[i].Ctrl & 0x0ffff)
{ {
case (uint)CodeMeter.GlobalEntryOption.ProtectedData: case (uint)CodeMeter.GlobalEntryOption.ProtectedData:
//var s = pCmBoxEntry[i].Data; // Transfer to transformed byte
SyncfusionKey = Encoding.ASCII.GetString(pCmBoxEntry[i].Data); uint length = pCmBoxEntry[i].DataLen;
//var len = pCmBoxEntry[i].DataLen; byte[] datas = new byte[length];
//var stringer = Encoding.ASCII.GetString(s); for(uint f = 0; f < length; f++)
//Debugger.Break(); {
datas[f] = pCmBoxEntry[i].Data[f];
}
SyncfusionKey = Encoding.ASCII.GetString(datas);
break; break;
} }
} }
@@ -161,6 +162,5 @@ namespace SanSystem
CleanDongle(); CleanDongle();
} }
} }
} }

View File

@@ -41,6 +41,18 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WibuCmNET, Version=7.40.4997.501, Culture=neutral, PublicKeyToken=01d86e1eb0c69c23, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\WibuCmNET.dll</HintPath>
</Reference>
<Reference Include="wupi.net, Version=9.20.8.500, Culture=neutral, PublicKeyToken=5f399135ee0c35d4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\wupi.net.dll</HintPath>
</Reference>
<Reference Include="WupiEngineNet, Version=11.0.4997.501, Culture=neutral, PublicKeyToken=8d0bd6872db0b9bb, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\WupiEngineNet.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BerichtWorker.cs" /> <Compile Include="BerichtWorker.cs" />
@@ -55,6 +67,7 @@
<Compile Include="IReadCSVData.cs" /> <Compile Include="IReadCSVData.cs" />
<Compile Include="ITemperature.cs" /> <Compile Include="ITemperature.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Dongle.cs" />
<Compile Include="UVcsvStrukture.cs" /> <Compile Include="UVcsvStrukture.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@@ -1,4 +1,5 @@
using System; using SanShared;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;

View File

@@ -1,4 +1,5 @@
#define LAPTOP #define LAPTOP
using SanShared;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -6,6 +7,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace SanSystem namespace SanSystem
{ {
static class Program static class Program

View File

@@ -104,22 +104,9 @@
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WibuCmNET, Version=6.80.274.500, Culture=neutral, PublicKeyToken=01d86e1eb0c69c23, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\WibuCmNET.dll</HintPath>
</Reference>
<Reference Include="wupi.net, Version=9.20.8.500, Culture=neutral, PublicKeyToken=5f399135ee0c35d4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\wupi.net.dll</HintPath>
</Reference>
<Reference Include="WupiEngineNet, Version=9.20.11.500, Culture=neutral, PublicKeyToken=8d0bd6872db0b9bb, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\3rdPackage\WupiEngineNet.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BüroExporter.cs" /> <Compile Include="BüroExporter.cs" />
<Compile Include="Dongle.cs" />
<Compile Include="Einstellungen\ObjecteListSetting.cs" /> <Compile Include="Einstellungen\ObjecteListSetting.cs" />
<Compile Include="Einstellungen\Settings.cs" /> <Compile Include="Einstellungen\Settings.cs" />
<Compile Include="Einstellungen\StreetListSettings.cs" /> <Compile Include="Einstellungen\StreetListSettings.cs" />

View File

@@ -15,7 +15,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using WupiEngine;
namespace SanSystem namespace SanSystem
{ {