init
This commit is contained in:
1
Common/DTS.Common.Licensing/.svn/entries
Normal file
1
Common/DTS.Common.Licensing/.svn/entries
Normal file
@@ -0,0 +1 @@
|
||||
12
|
||||
1
Common/DTS.Common.Licensing/.svn/format
Normal file
1
Common/DTS.Common.Licensing/.svn/format
Normal file
@@ -0,0 +1 @@
|
||||
12
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Licensing
|
||||
{
|
||||
public class DataProLicensingEnums
|
||||
{
|
||||
public enum LicenseType
|
||||
{
|
||||
Standard = 0,
|
||||
Enterprise = 1,
|
||||
EnterpriseSite = 2,
|
||||
TSRAir = 3,
|
||||
//FB 30628 Added StandardSite license type
|
||||
StandardSite = 4
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Licensing.SystemInformation
|
||||
{
|
||||
public static class ProcessorInfo
|
||||
{
|
||||
private static ManagementObjectSearcher cpuSearcher = new ManagementObjectSearcher("SELECT ProcessorID,DeviceID,SerialNumber,UniqueId FROM Win32_processor");
|
||||
static public string ProcessorID
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return cpuSearcher.Get().OfType<ManagementObject>().FirstOrDefault()["ProcessorID"].ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Licensing.SystemInformation
|
||||
{
|
||||
public static class SystemInformationXSD
|
||||
{
|
||||
private static readonly string _xsd = @"<xs:schema attributeFormDefault='unqualified' elementFormDefault='qualified' xmlns:xs='http://www.w3.org/2001/XMLSchema'><xs:element name ='SysInfo'><xs:complexType><xs:sequence><xs:element type ='xs:string' name='MainBoardSerialNumber'/><xs:element type = 'xs:string' name='ProcessorID'/><xs:element type = 'xs:string' name='SystemID'/><xs:element type ='xs:string' name='MachineName'/></xs:sequence><xs:attribute type ='xs:byte' name='Version'/><xs:attribute type ='xs:string' name='SystemInformationGuid'/></xs:complexType></xs:element></xs:schema>";
|
||||
public static string XSD { get; private set; } = _xsd;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace DTS.Common.Licensing.Messages
|
||||
{
|
||||
public class ValidationFailure
|
||||
{
|
||||
public string Message { get; set; }
|
||||
public string HowToResolve { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Licensing.SystemInformation
|
||||
{
|
||||
public static class ComputerSystemInfo
|
||||
{
|
||||
private static ManagementObjectSearcher systemSearcher = new ManagementObjectSearcher("SELECT UUID FROM Win32_ComputerSystemProduct");
|
||||
static public string SystemID
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return systemSearcher.Get().OfType<ManagementObject>().FirstOrDefault()["UUID"].ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
<?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>{8B169B1C-37CB-4B7C-8071-385036B96FAA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DTS.Common.Licensing</RootNamespace>
|
||||
<AssemblyName>DTS.Common.Licensing</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</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>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<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="Enums\DataProLicensingEnums.cs" />
|
||||
<Compile Include="Messages\LicenseKey.cs" />
|
||||
<Compile Include="Messages\ValidationFailure.cs" />
|
||||
<Compile Include="Messages\ValidationResult.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SystemInformation\ComputerSystemInfo.cs" />
|
||||
<Compile Include="SystemInformation\MachineInfo.cs" />
|
||||
<Compile Include="SystemInformation\MainBoardInfo.cs" />
|
||||
<Compile Include="SystemInformation\ProcessorInfo.cs" />
|
||||
<Compile Include="SystemInformation\SystemInformationXSD.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>if not exist "$(SolutionDir)..\LicensingDependency" mkdir "$(SolutionDir)..\LicensingDependency"
|
||||
copy "$(TargetPath)" "$(SolutionDir)..\LicensingDependency\$(TargetFileName)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using 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.
|
||||
[assembly: AssemblyTitle("DTS.Common.Licensing")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DTS.Common.Licensing")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("8b169b1c-37cb-4b7c-8071-385036b96faa")]
|
||||
|
||||
// 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")]
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Licensing.SystemInformation
|
||||
{
|
||||
public static class MachineInfo
|
||||
{
|
||||
static public string MachineName
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return System.Environment.MachineName;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Licensing.SystemInformation
|
||||
{
|
||||
public static class MainBoardInfo
|
||||
{
|
||||
private static ManagementObjectSearcher baseboardSearcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BaseBoard");
|
||||
static public string SerialNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return baseboardSearcher.Get().OfType<ManagementObject>().FirstOrDefault()["SerialNumber"].ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
namespace DTS.Common.Licensing.Messages
|
||||
{
|
||||
public class ValidationResult
|
||||
{
|
||||
public IEnumerable<ValidationFailure> ValidationFailures { get; set; }
|
||||
public bool IsLicenseExpired { get; set; }
|
||||
public bool IsLicenseVersionValid { get; set; }
|
||||
public Version ProductVersion { get; set; }
|
||||
public string LicenseVersion { get; set; }
|
||||
public DateTime? LicenseExpiration { get; set; }
|
||||
public bool IsValid { get; set; }
|
||||
//FB 25723 Specify if the license file exist or not
|
||||
public bool IsLicensed { get; set; } = true;
|
||||
public string LicensedTo { get; set; }
|
||||
public DataProLicensingEnums.LicenseType LicenseType { get; set; }
|
||||
public Guid LicenseId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Licensing
|
||||
{
|
||||
public class LicenseKey
|
||||
{
|
||||
public string KeyGuid { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
}
|
||||
}
|
||||
BIN
Common/DTS.Common.Licensing/.svn/wc.db
Normal file
BIN
Common/DTS.Common.Licensing/.svn/wc.db
Normal file
Binary file not shown.
0
Common/DTS.Common.Licensing/.svn/wc.db-journal
Normal file
0
Common/DTS.Common.Licensing/.svn/wc.db-journal
Normal file
Reference in New Issue
Block a user