This commit is contained in:
2018-06-29 19:47:36 +00:00
commit be7f501333
3769 changed files with 1425961 additions and 0 deletions

177
keys/Generator/ALRequests.Designer.cs generated Normal file
View File

@@ -0,0 +1,177 @@
namespace GroundZero.KeyCodes
{
partial class ALRequests
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.abortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.checkForRequestsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.grid = new System.Windows.Forms.DataGridView();
this.index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Request = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Process = new System.Windows.Forms.DataGridViewButtonColumn();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit();
this.SuspendLayout();
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1,
this.toolStripProgressBar1});
this.statusStrip1.Location = new System.Drawing.Point(0, 660);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(1305, 22);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17);
//
// toolStripProgressBar1
//
this.toolStripProgressBar1.Name = "toolStripProgressBar1";
this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 16);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.abortToolStripMenuItem,
this.checkForRequestsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(1305, 24);
this.menuStrip1.TabIndex = 2;
this.menuStrip1.Text = "menuStrip1";
//
// abortToolStripMenuItem
//
this.abortToolStripMenuItem.Name = "abortToolStripMenuItem";
this.abortToolStripMenuItem.Size = new System.Drawing.Size(49, 20);
this.abortToolStripMenuItem.Text = "&Abort";
this.abortToolStripMenuItem.Visible = false;
this.abortToolStripMenuItem.Click += new System.EventHandler(this.abortToolStripMenuItem_Click);
//
// checkForRequestsToolStripMenuItem
//
this.checkForRequestsToolStripMenuItem.Name = "checkForRequestsToolStripMenuItem";
this.checkForRequestsToolStripMenuItem.Size = new System.Drawing.Size(117, 20);
this.checkForRequestsToolStripMenuItem.Text = "&Check for requests";
this.checkForRequestsToolStripMenuItem.Click += new System.EventHandler(this.checkForRequestsToolStripMenuItem_Click);
//
// grid
//
this.grid.AllowUserToAddRows = false;
this.grid.AllowUserToDeleteRows = false;
this.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.grid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.index,
this.Request,
this.Process});
this.grid.Dock = System.Windows.Forms.DockStyle.Fill;
this.grid.Location = new System.Drawing.Point(0, 24);
this.grid.MultiSelect = false;
this.grid.Name = "grid";
this.grid.ReadOnly = true;
this.grid.RowHeadersVisible = false;
this.grid.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.grid.Size = new System.Drawing.Size(1305, 636);
this.grid.TabIndex = 3;
this.grid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grid_CellClick);
//
// index
//
this.index.HeaderText = "index";
this.index.Name = "index";
this.index.ReadOnly = true;
this.index.Visible = false;
//
// Request
//
this.Request.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.Request.DefaultCellStyle = dataGridViewCellStyle1;
this.Request.HeaderText = "Request";
this.Request.Name = "Request";
this.Request.ReadOnly = true;
this.Request.Resizable = System.Windows.Forms.DataGridViewTriState.False;
//
// Process
//
this.Process.HeaderText = "Process";
this.Process.Name = "Process";
this.Process.ReadOnly = true;
this.Process.Text = "Process";
this.Process.UseColumnTextForButtonValue = true;
//
// ALRequests
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1305, 682);
this.Controls.Add(this.grid);
this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.statusStrip1);
this.Name = "ALRequests";
this.Text = "Trial license request processor";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.ALRequests_Load);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.grid)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem abortToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem checkForRequestsToolStripMenuItem;
private System.Windows.Forms.DataGridView grid;
private System.Windows.Forms.DataGridViewTextBoxColumn index;
private System.Windows.Forms.DataGridViewTextBoxColumn Request;
private System.Windows.Forms.DataGridViewButtonColumn Process;
}
}

View File

@@ -0,0 +1,280 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace GroundZero.KeyCodes
{
public partial class ALRequests : Form
{
private bool _xmlMode=true;
public ALRequests(bool XMLMode)
{
InitializeComponent();
_xmlMode=XMLMode;
}
private bool m_abortAtNextHeartbeat = false;
private Chilkat.EmailBundle bundle=null;
private void checkForRequestsToolStripMenuItem_Click(object sender, EventArgs e)
{
GetRequestsFromImapServer();
}
private void GetRequestsFromImapServer()
{
abortToolStripMenuItem.Visible = true;
// Any IMAP method call may be progress monitored and aborted.
// This example demonstrates how to do it.
Chilkat.Imap imap = new Chilkat.Imap();
bool success;
toolStripStatusLabel1.Text = "Unlock Chilkat...";
// Anything unlocks the component and begins a fully-functional 30-day trial.
success = imap.UnlockComponent("SAyanovaIMAPMAIL_Es9JHNMSlUlb");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
// IMPORTANT: To enable events, make sure the EnableEvents property is set to true.
imap.EnableEvents = true;
// This example describes two event callbacks: AbortCheck and PercentDone:
imap.OnAbortCheck += new Chilkat.Imap.AbortCheckEventHandler(imap_OnAbortCheck);
imap.OnPercentDone += new Chilkat.Imap.PercentDoneEventHandler(imap_OnPercentDone);
// The AbortCheck event is fired periodically during any method call that communicates
// with the IMAP server. The rate of firing is controlled by the HeartbeatMs property.
// If set to 0 (the default), then no AbortCheck events are fired. Otherwise,
// the HeartbeatMs property is the number of milliseconds between AbortCheck events.
imap.HeartbeatMs = 100; // Set it to 100 milliseconds.
// NOTE: The PercentDone event is only fired for methods where it makes sense.
// For example, the AbortCheck event is fired during a Connect method call,
// but the PercentDone is not. (It's not really possible to know the percentage
// completion for a Connect -- the IMAP client simply waits for the server to accept
// the connection. However, when downloading 100 email headers, it's 50% done
// when 50 email headers have been downloaded, and that makes sense. When downloading
// a single email that is 100K in size, it's 50% done when 50K has been downloaded,
// again -- it makes sense. If the PercentDone event does not fire -- ask yourself
// if it even make sense.)
// Now that events have been enabled, and event handlers are set,
// the remainder of the code is identical to code that does not use events.
// Skip down to review the OnPercentDone and OnAbortCheck events.
// If you have an "Abort" button in your user-interface, you may wish
// to give it focus prior to calling progress-monitored methods:
menuStrip1.Focus();
// Connect to an IMAP server.
toolStripStatusLabel1.Text = "Connecting to mail.ayanova.com ...";
//Use SSL case 1973
imap.Ssl = true;
imap.Port = 993;
success = imap.Connect("mail.ayanova.com");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
// Login
toolStripStatusLabel1.Text = "Logging in...";
success = imap.Login("support@ayanova.com", "RLdUP6758a6191H");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
// Select an IMAP mailbox
toolStripStatusLabel1.Text = "Selecting Inbox...";
success = imap.SelectMailbox("Inbox");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
Chilkat.MessageSet messageSet = null;
// We can choose to fetch UIDs or sequence numbers.
bool fetchUids;
fetchUids = true;
// Get the message IDs for all emails with "SSL" in the subject.
toolStripStatusLabel1.Text = "Searching ...";
//Tested oct 3 2011 this now works and only gathers new requests and now doesn't pick up people's replies to the keycode message
messageSet = imap.Search("UNANSWERED UNDELETED TEXT \"noreply@ayanova.com\" SUBJECT \"Request for 30 day temporary\"", fetchUids);
//messageSet = imap.Search("UNANSWERED SUBJECT \"Request for 30 day temporary\"", fetchUids);
//noreply@ayanova.com
// Fetch the email headers into an email bundle.
toolStripStatusLabel1.Text = "Fetching...";
bundle = imap.FetchBundle(messageSet);
if (bundle == null)
{
MessageBox.Show("Failed to fetch mail bundle!");
imap.SaveLastError("errorLog.xml");
return;
}
bundle.SortByDate(false);
// Loop over the bundle and display the FROM and SUBJECT of each.
grid.Rows.Clear();
int i;
for (i = 0; i <= bundle.MessageCount - 1; i++)
{
Chilkat.Email email = null;
email = bundle.GetEmail(i);
grid.Rows.Add(email.GetImapUid().ToString(), email.FromAddress + ": " + email.Subject + " - " + email.LocalDate.ToString());
}
// Disconnect from the IMAP server.
imap.Disconnect();
abortToolStripMenuItem.Visible = false;
toolStripStatusLabel1.Text = "Done...";
toolStripProgressBar1.Value = 0;
}
void imap_OnPercentDone(object sender, Chilkat.PercentDoneEventArgs args)
{
// Update the progress bar.
// args.PercentDone is an integer value that has a value from 0 to 100.
toolStripProgressBar1.Value = args.PercentDone;
}
// This is called periodically according to the HeartbeatMs
void imap_OnAbortCheck(object sender, Chilkat.AbortCheckEventArgs args)
{
// To abort any Chilkat IMAP method call, simply set the
// args.Abort property to true:
if (m_abortAtNextHeartbeat)
{
args.Abort = true;
m_abortAtNextHeartbeat = false;
abortToolStripMenuItem.Visible = false;
toolStripStatusLabel1.Text = "Abort!";
}
// Keep the user-interface responsive by allowing UI events to be processed:
Application.DoEvents();
}
private void abortToolStripMenuItem_Click(object sender, EventArgs e)
{
m_abortAtNextHeartbeat = true;
}
private void grid_CellClick(object sender, DataGridViewCellEventArgs e)
{
// Ignore clicks that are not on button cells.
if (e.RowIndex < 0 || e.ColumnIndex !=
grid.Columns["Process"].Index) return;
// Retrieve the task ID.
string msgID = grid[0, e.RowIndex].Value.ToString();
Chilkat.Email em=bundle.GetEmail(e.RowIndex);
if (em.Uidl==msgID)
MessageBox.Show("Error UIDL not equal to message ID from grid. Tell Johnny.");
else
{
string s = "";
if (!string.IsNullOrWhiteSpace(em.GetPlainTextBody()))
s = em.GetPlainTextBody();
else
s = em.Body;
ALResponse alr = new ALResponse(em,_xmlMode);
if(alr.ShowDialog()== System.Windows.Forms.DialogResult.Yes)
FlagImapEmailAnswered(em);
GetRequestsFromImapServer();
}
}
public static void FlagImapEmailAnswered(Chilkat.Email em)
{
Chilkat.Imap imap = new Chilkat.Imap();
bool success;
success = imap.UnlockComponent("SAyanovaIMAPMAIL_Es9JHNMSlUlb");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
//Use SSL case 1973
imap.Ssl = true;
imap.Port = 993;
success = imap.Connect("mail.ayanova.com");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
// Login
success = imap.Login("support@ayanova.com", "RLdUP6758a6191H");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
// Select an IMAP mailbox
success = imap.SelectMailbox("Inbox");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
success = imap.SetMailFlag(em, "Answered", 1);
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
}
imap.Logout();
imap.Disconnect();
}
private void ALRequests_Load(object sender, EventArgs e)
{
GetRequestsFromImapServer();
}
//mailman.UnlockComponent("SAyanovaMAILQ_46WCmUg3lQ1i");
}
}

View File

@@ -0,0 +1,135 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>248, 17</value>
</metadata>
<metadata name="index.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Request.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Process.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

217
keys/Generator/ALResponse.Designer.cs generated Normal file
View File

@@ -0,0 +1,217 @@
namespace GroundZero.KeyCodes
{
partial class ALResponse
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabs = new System.Windows.Forms.TabControl();
this.tpRequest = new System.Windows.Forms.TabPage();
this.edRequest = new System.Windows.Forms.TextBox();
this.tpGreeting = new System.Windows.Forms.TabPage();
this.edGreeting = new System.Windows.Forms.TextBox();
this.tpKey = new System.Windows.Forms.TabPage();
this.edKeyCode = new System.Windows.Forms.TextBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.sendToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.regenerateMessagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.cancelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabs.SuspendLayout();
this.tpRequest.SuspendLayout();
this.tpGreeting.SuspendLayout();
this.tpKey.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// tabs
//
this.tabs.Controls.Add(this.tpRequest);
this.tabs.Controls.Add(this.tpGreeting);
this.tabs.Controls.Add(this.tpKey);
this.tabs.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabs.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabs.Location = new System.Drawing.Point(0, 26);
this.tabs.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabs.Name = "tabs";
this.tabs.SelectedIndex = 0;
this.tabs.Size = new System.Drawing.Size(983, 533);
this.tabs.TabIndex = 4;
//
// tpRequest
//
this.tpRequest.Controls.Add(this.edRequest);
this.tpRequest.Location = new System.Drawing.Point(4, 27);
this.tpRequest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tpRequest.Name = "tpRequest";
this.tpRequest.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tpRequest.Size = new System.Drawing.Size(975, 502);
this.tpRequest.TabIndex = 0;
this.tpRequest.Text = "Request";
this.tpRequest.UseVisualStyleBackColor = true;
//
// edRequest
//
this.edRequest.AcceptsReturn = true;
this.edRequest.AcceptsTab = true;
this.edRequest.Dock = System.Windows.Forms.DockStyle.Fill;
this.edRequest.Location = new System.Drawing.Point(4, 4);
this.edRequest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.edRequest.MaxLength = 132767;
this.edRequest.Multiline = true;
this.edRequest.Name = "edRequest";
this.edRequest.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.edRequest.Size = new System.Drawing.Size(967, 494);
this.edRequest.TabIndex = 1;
//
// tpGreeting
//
this.tpGreeting.Controls.Add(this.edGreeting);
this.tpGreeting.Location = new System.Drawing.Point(4, 27);
this.tpGreeting.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tpGreeting.Name = "tpGreeting";
this.tpGreeting.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tpGreeting.Size = new System.Drawing.Size(975, 498);
this.tpGreeting.TabIndex = 1;
this.tpGreeting.Text = "Greeting message";
this.tpGreeting.UseVisualStyleBackColor = true;
//
// edGreeting
//
this.edGreeting.AcceptsReturn = true;
this.edGreeting.AcceptsTab = true;
this.edGreeting.Dock = System.Windows.Forms.DockStyle.Fill;
this.edGreeting.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.edGreeting.Location = new System.Drawing.Point(4, 4);
this.edGreeting.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.edGreeting.MaxLength = 132767;
this.edGreeting.Multiline = true;
this.edGreeting.Name = "edGreeting";
this.edGreeting.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.edGreeting.Size = new System.Drawing.Size(963, 485);
this.edGreeting.TabIndex = 2;
//
// tpKey
//
this.tpKey.Controls.Add(this.edKeyCode);
this.tpKey.Location = new System.Drawing.Point(4, 27);
this.tpKey.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tpKey.Name = "tpKey";
this.tpKey.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tpKey.Size = new System.Drawing.Size(975, 498);
this.tpKey.TabIndex = 2;
this.tpKey.Text = "Keycode message";
this.tpKey.UseVisualStyleBackColor = true;
//
// edKeyCode
//
this.edKeyCode.AcceptsReturn = true;
this.edKeyCode.AcceptsTab = true;
this.edKeyCode.Dock = System.Windows.Forms.DockStyle.Fill;
this.edKeyCode.Location = new System.Drawing.Point(4, 4);
this.edKeyCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.edKeyCode.MaxLength = 132767;
this.edKeyCode.Multiline = true;
this.edKeyCode.Name = "edKeyCode";
this.edKeyCode.ReadOnly = true;
this.edKeyCode.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.edKeyCode.Size = new System.Drawing.Size(963, 485);
this.edKeyCode.TabIndex = 3;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.sendToolStripMenuItem,
this.regenerateMessagesToolStripMenuItem,
this.cancelToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2);
this.menuStrip1.Size = new System.Drawing.Size(983, 26);
this.menuStrip1.TabIndex = 5;
this.menuStrip1.Text = "menuStrip1";
//
// sendToolStripMenuItem
//
this.sendToolStripMenuItem.Name = "sendToolStripMenuItem";
this.sendToolStripMenuItem.Size = new System.Drawing.Size(201, 22);
this.sendToolStripMenuItem.Text = "&Email reponses to customer";
this.sendToolStripMenuItem.Click += new System.EventHandler(this.sendToolStripMenuItem_Click);
//
// regenerateMessagesToolStripMenuItem
//
this.regenerateMessagesToolStripMenuItem.Name = "regenerateMessagesToolStripMenuItem";
this.regenerateMessagesToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.regenerateMessagesToolStripMenuItem.Text = "&Regenerate messages";
this.regenerateMessagesToolStripMenuItem.Click += new System.EventHandler(this.regenerateMessagesToolStripMenuItem_Click);
//
// cancelToolStripMenuItem
//
this.cancelToolStripMenuItem.Name = "cancelToolStripMenuItem";
this.cancelToolStripMenuItem.Size = new System.Drawing.Size(62, 22);
this.cancelToolStripMenuItem.Text = "&Cancel";
this.cancelToolStripMenuItem.Click += new System.EventHandler(this.cancelToolStripMenuItem_Click);
//
// ALResponse
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(983, 559);
this.Controls.Add(this.tabs);
this.Controls.Add(this.menuStrip1);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "ALResponse";
this.Text = "License request response emails";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.tabs.ResumeLayout(false);
this.tpRequest.ResumeLayout(false);
this.tpRequest.PerformLayout();
this.tpGreeting.ResumeLayout(false);
this.tpGreeting.PerformLayout();
this.tpKey.ResumeLayout(false);
this.tpKey.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TabControl tabs;
private System.Windows.Forms.TabPage tpRequest;
private System.Windows.Forms.TextBox edRequest;
private System.Windows.Forms.TabPage tpGreeting;
private System.Windows.Forms.TextBox edGreeting;
private System.Windows.Forms.TabPage tpKey;
private System.Windows.Forms.TextBox edKeyCode;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem sendToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem cancelToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem regenerateMessagesToolStripMenuItem;
}
}

View File

@@ -0,0 +1,257 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace GroundZero.KeyCodes
{
public partial class ALResponse : Form
{
private Chilkat.Email em=null;
bool bLite = false;
bool _xmlMode = true;
public ALResponse(Chilkat.Email ALRequestEmail, bool XMLMode)
{
InitializeComponent();
_xmlMode = XMLMode;
if (ALRequestEmail == null)
{
MessageBox.Show("No request email found - tell Johnny");
this.Close();
return;
}
em = ALRequestEmail;
string s = "";
if (!string.IsNullOrWhiteSpace(em.GetPlainTextBody()))
s = em.GetPlainTextBody();
else
s = em.Body;
edRequest.Text = s;
sendToolStripMenuItem.Text = "&Send to " + em.FromAddress;
Generate(_xmlMode);
}
private void sendToolStripMenuItem_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Send both response emails to customer now?", "Email now", MessageBoxButtons.YesNo) != DialogResult.Yes) return;
//smtp send responses
string sEmailTo = em.FromAddress;
if (string.IsNullOrWhiteSpace(sEmailTo))
{
MessageBox.Show("Error, the return email address is empty, no one to reply to!");
return;
}
//Send the greeting message first
string sLastError=SendMessage(sEmailTo, "re: " + em.Subject, edGreeting.Text, "");
if ( sLastError != null)
{
MessageBox.Show("Error sending greeting message:\r\n" + sLastError);
return;
}
string sKeyEmailSubject = "";
if (bLite)
sKeyEmailSubject = "AyaNova Lite and optional add-ons temporary 30 day Activation key";
else
sKeyEmailSubject = "AyaNova and optional add-on's temporary 30 day Activation key";
sLastError = SendMessage(sEmailTo, sKeyEmailSubject,this.edKeyCode.Text, "");
if (sLastError != null)
{
MessageBox.Show("Error sending keycode message:\r\n" + sLastError);
return;
}
this.DialogResult = System.Windows.Forms.DialogResult.Yes;
this.Close();
}
/// <summary>
/// Send a message with optional attachment
/// </summary>
/// <param name="sTo"></param>
/// <param name="sSubject"></param>
/// <param name="sBody"></param>
/// <param name="sAttach"></param>
/// <returns>null on success otherwise the error message</returns>
private string SendMessage(string sTo, string sSubject, string sBody, string sAttach)
{
//attempt delivery
// Create a mailman object for sending email.
Chilkat.MailMan mailman = new Chilkat.MailMan();
mailman.UnlockComponent("SAyanovaMAILQ_46WCmUg3lQ1i");
// Set the SMTP server hostname.
mailman.SmtpHost = "smtp.ayanova.com";
//Case 515
//mailman.SmtpPort = 587;
//SSL case 1973
mailman.SmtpSsl = true;
mailman.SmtpPort = 465;
mailman.SmtpUsername = "support@ayanova.com";
mailman.SmtpPassword = "RLdUP6758a6191H";
// Create a simple email.
Chilkat.Email email = new Chilkat.Email();
email.Body = sBody;
email.Subject = sSubject;
email.AddTo("", sTo);
email.From = "support@ayanova.com";
// Send mail.
bool success;
success = mailman.SendEmail(email);
if (success)
{
CopyToSentFolder(email);
return null;
}
else
{
return mailman.LastErrorText;
}
}
public static void CopyToSentFolder(Chilkat.Email em)
{
Chilkat.Imap imap = new Chilkat.Imap();
bool success;
success = imap.UnlockComponent("SAyanovaIMAPMAIL_Es9JHNMSlUlb");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
//Use SSL case 1973
imap.Ssl = true;
imap.Port = 993;
success = imap.Connect("mail.ayanova.com");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
// Login
success = imap.Login("support@ayanova.com", "RLdUP6758a6191H");
if (success != true)
{
MessageBox.Show(imap.LastErrorText);
return;
}
//put in sent mail folder
success = imap.AppendMail("Sent", em);
if (success != true)
{
MessageBox.Show("Error copying to sent folder: \r\n"+imap.LastErrorText);
return;
}
imap.Logout();
imap.Disconnect();
}
private void cancelToolStripMenuItem_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Close();
}
void Generate(bool XMLFormat)
{
string s= edRequest.Text;
//make keycode
bLite = em.Subject.Contains("AyaNova Lite");
int nNameStart = s.IndexOf("Name:\r\n")+7;
int nNameEnd = s.IndexOf("Company:\r\n");
int nCompanyStart = nNameEnd + 10;
int nCompanyEnd = s.IndexOf("Referrer:\r\n");
string sName = s.Substring(nNameStart, nNameEnd - nNameStart).Trim();
if (sName.Contains(" "))
sName=sName.Split(' ')[0];
string sRegTo = s.Substring(nCompanyStart, nCompanyEnd - nCompanyStart).Trim();
edKeyCode.Text = MsgGen.TrialKeyMessage(bLite, sRegTo, XMLFormat);
//Latest format:
//Name:
//Joyce
//Company:
//Ground Zero
//Additional:
//-
//Requested from:
//96.54.96.232
//Original format:
//Name:
//Emin PEKEL
//Company:
//ECSTURKEY
//Postal address:
//1370 SOK. NO: 7 KONAK / CANKAYA - IZMIR (TURKEY)
//Other:
//-
//Requested from:
//88.247.204.81
//make greeting message
edGreeting.Text = MsgGen.TrialGreetingMessage(bLite, sName);
edGreeting.Text = edGreeting.Text + "\r\n\r\nOn " + em.LocalDate + ", " + em.From + " wrote:\r\n" + edRequest.Text.Replace("\r\n","\r\n>");
}
private void regenerateMessagesToolStripMenuItem_Click(object sender, EventArgs e)
{
edKeyCode.Text = "";
edGreeting.Text = "";
Generate(_xmlMode);
}
}
}

View File

@@ -0,0 +1,123 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

BIN
keys/Generator/App.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,58 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// 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("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,58 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// 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("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

View File

@@ -0,0 +1,660 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Infragistics.Win;
using Infragistics.Win.UltraWinEditors;
using System.Text;
namespace GroundZero.KeyCodes
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TextBox edOut;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox edRegTo;
private System.Windows.Forms.CheckBox ckWebInterface;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox edSchedUsers;
private System.Windows.Forms.CheckBox ckQuickBooksInterface;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem mnGenerateKey;
private System.Windows.Forms.MenuItem mnuReadKey;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Button btn31Days;
private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor dtExpires;
private Infragistics.Win.UltraWinEditors.UltraOptionSet setType;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem();
Infragistics.Win.ValueListItem valueListItem3 = new Infragistics.Win.ValueListItem();
this.panel1 = new System.Windows.Forms.Panel();
this.setType = new Infragistics.Win.UltraWinEditors.UltraOptionSet();
this.btn31Days = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.dtExpires = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
this.ckQuickBooksInterface = new System.Windows.Forms.CheckBox();
this.edSchedUsers = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.ckWebInterface = new System.Windows.Forms.CheckBox();
this.edRegTo = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.edOut = new System.Windows.Forms.TextBox();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.mnGenerateKey = new System.Windows.Forms.MenuItem();
this.mnuReadKey = new System.Windows.Forms.MenuItem();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.setType)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dtExpires)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.setType);
this.panel1.Controls.Add(this.btn31Days);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.dtExpires);
this.panel1.Controls.Add(this.ckQuickBooksInterface);
this.panel1.Controls.Add(this.edSchedUsers);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.ckWebInterface);
this.panel1.Controls.Add(this.edRegTo);
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(704, 232);
this.panel1.TabIndex = 0;
//
// setType
//
this.setType.CheckedIndex = 0;
this.setType.FlatMode = true;
this.setType.ItemAppearance = appearance1;
valueListItem1.DataValue = "NEW";
valueListItem1.DisplayText = "New license";
valueListItem2.DataValue = "ADD";
valueListItem2.DisplayText = "Add on";
valueListItem3.DataValue = "LICENSETRIAL";
valueListItem3.DisplayText = "Licensed trial";
this.setType.Items.Add(valueListItem1);
this.setType.Items.Add(valueListItem2);
this.setType.Items.Add(valueListItem3);
this.setType.ItemSpacingVertical = 5;
this.setType.Location = new System.Drawing.Point(8, 16);
this.setType.Name = "setType";
this.setType.Size = new System.Drawing.Size(272, 56);
this.setType.TabIndex = 11;
this.setType.Text = "New license";
//
// btn31Days
//
this.btn31Days.Location = new System.Drawing.Point(176, 200);
this.btn31Days.Name = "btn31Days";
this.btn31Days.TabIndex = 10;
this.btn31Days.Text = "31 days";
this.btn31Days.Click += new System.EventHandler(this.btn31Days_Click);
//
// label4
//
this.label4.Location = new System.Drawing.Point(8, 184);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(312, 16);
this.label4.TabIndex = 9;
this.label4.Text = "Expires: (leave blank for no expiry)";
//
// dtExpires
//
this.dtExpires.Location = new System.Drawing.Point(8, 200);
this.dtExpires.Name = "dtExpires";
this.dtExpires.TabIndex = 8;
this.dtExpires.Value = null;
//
// ckQuickBooksInterface
//
this.ckQuickBooksInterface.Location = new System.Drawing.Point(456, 40);
this.ckQuickBooksInterface.Name = "ckQuickBooksInterface";
this.ckQuickBooksInterface.Size = new System.Drawing.Size(184, 24);
this.ckQuickBooksInterface.TabIndex = 6;
this.ckQuickBooksInterface.Text = "QuickBooks interface";
//
// edSchedUsers
//
this.edSchedUsers.Location = new System.Drawing.Point(8, 144);
this.edSchedUsers.Name = "edSchedUsers";
this.edSchedUsers.TabIndex = 5;
this.edSchedUsers.Text = "5";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 128);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(312, 16);
this.label3.TabIndex = 4;
this.label3.Text = "Scheduleable users:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(456, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(100, 16);
this.label2.TabIndex = 3;
this.label2.Text = "Options:";
//
// ckWebInterface
//
this.ckWebInterface.Location = new System.Drawing.Point(456, 16);
this.ckWebInterface.Name = "ckWebInterface";
this.ckWebInterface.Size = new System.Drawing.Size(184, 24);
this.ckWebInterface.TabIndex = 2;
this.ckWebInterface.Text = "Web interface";
//
// edRegTo
//
this.edRegTo.Location = new System.Drawing.Point(8, 96);
this.edRegTo.Name = "edRegTo";
this.edRegTo.Size = new System.Drawing.Size(360, 20);
this.edRegTo.TabIndex = 1;
this.edRegTo.Text = "Unregistered trial";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 80);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(100, 16);
this.label1.TabIndex = 0;
this.label1.Text = "Registered to:";
//
// edOut
//
this.edOut.Dock = System.Windows.Forms.DockStyle.Fill;
this.edOut.Location = new System.Drawing.Point(0, 232);
this.edOut.Multiline = true;
this.edOut.Name = "edOut";
this.edOut.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.edOut.Size = new System.Drawing.Size(704, 321);
this.edOut.TabIndex = 1;
this.edOut.Text = "";
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnGenerateKey,
this.mnuReadKey});
//
// mnGenerateKey
//
this.mnGenerateKey.Index = 0;
this.mnGenerateKey.Text = "Generate key to clipboard";
this.mnGenerateKey.Click += new System.EventHandler(this.mnGenerateKey_Click);
//
// mnuReadKey
//
this.mnuReadKey.Index = 1;
this.mnuReadKey.Text = "Validate key";
this.mnuReadKey.Click += new System.EventHandler(this.mnuReadKey_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(704, 553);
this.Controls.Add(this.edOut);
this.Controls.Add(this.panel1);
this.Menu = this.mainMenu1;
this.Name = "Form1";
this.Text = "Keymaster (25-April-2006)";
this.Load += new System.EventHandler(this.Form1_Load);
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.setType)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dtExpires)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void mnGenerateKey_Click(object sender, System.EventArgs e)
{
if(setType.CheckedItem==null)
{
MessageBox.Show("Select a license type to proceed");
return;
}
string SelectedLicenseType=setType.CheckedItem.DataValue.ToString();
KeyGen kg=new KeyGen();
kg.FeatureQuickBooksInterface=this.ckQuickBooksInterface.Checked;
kg.FeatureWebInterface=this.ckWebInterface.Checked;
kg.RegisteredTo=this.edRegTo.Text;
kg.ScheduleableUsers=System.Convert.ToInt32(this.edSchedUsers.Text);
bool bWillExpire=false;
if(dtExpires.Value!=null && dtExpires.Value!=DBNull.Value)
{
kg.Expires=dtExpires.DateTime;
bWillExpire=true;
}
else
kg.Expires=DateTime.Today;
string strKey="";
#region format message
if(SelectedLicenseType=="NEW")
{
#region New
strKey="Thank you for your purchase and welcome to the \r\n" +
"world-wide community of AyaNova users! \r\n" +
" \r\n" +
"Below is your activation key with instructions for entry into the \r\n" +
"trial of AyaNova v3 that you previously downloaded from our website, \r\n" +
"installed and tested for suitability. \r\n" +
" \r\n" +
"Reminder: no physical product will be shipped to you, this license key \r\n" +
"fulfills your order in full. \r\n" +
" \r\n" +
" \r\n" +
"HELP AND SUPPORT RESOURCES: \r\n" +
"AyaNova web site: \r\n" +
"http://www.ayanova.com \r\n" +
"Users manual: \r\n" +
"http://www.ayanova.com/download.htm \r\n" +
"Answers to frequently asked questions: \r\n" +
"http://www.ayanova.com/faqAnswers.htm \r\n" +
"Technical support forum: \r\n" +
"http://forum.ayanova.com \r\n" +
"Latest AyaNova version update information: \r\n" +
"http://forum.ayanova.com \r\n" +
" \r\n" +
" \r\n" +
LicenseInfo(kg,setType.Value.ToString())+
"HOW TO ENTER YOUR ACTIVATION KEY \r\n" +
" \r\n" +
"1. Copy only all the text from between the -=-=-=-=-=- below to the Windows clip board \r\n" +
"(highlight the text, right-click, select Copy) \r\n" +
" \r\n" +
"Do not edit any of the key text, AyaNova will not accept an altered key. \r\n" +
" \r\n" +
"2. Ensure no other users are accessing AyaNova v3 \r\n" +
" \r\n" +
"3. Log into the trial AyaNova v3 as the AyaNova Administrator \r\n" +
"(default is manager with password letmein ) \r\n" +
"(no quotation marks and in lowercase) \r\n" +
" \r\n" +
"4. Select Help->License from the main menu to bring up the keycode window. \r\n" +
" \r\n" +
"5. Select the menu option Paste license key \r\n" +
" \r\n" +
"6. Close AyaNova \r\n" +
" \r\n" +
"7. Log back into AyaNova v3 as manager with password letmein \r\n" +
"(no quotation marks and in lowercase) \r\n" +
" \r\n" +
"8. As the trial AyaNova v3 has 5 sample scheduleable users, if the number of licenses \r\n" +
"purchased are less than 5, you will receive a message that 5 are set to Active, and \r\n" +
"the number of licenses do not match the number set Active. \r\n" +
"If you receive this message and are not going to erase the trial data, you will need \r\n" +
"to manually delete or close all workorders where sample scheduleable users are \r\n" +
"selected. Then open the Administration pane, open the Users grid, \r\n" +
"and set the sample scheduleable users to In-active. \r\n" +
" \r\n" +
"9. To erase all trial entered data and users, select Help->License from the main menu \r\n" +
"to bring up the keycode window. Select the menu option to erase sample data. \r\n" +
" \r\n" +
"10. Refer to the AyaNova v3 Manual for details on all features, tutorials, tips on use, \r\n" +
"and for installing and configuring for a network environment \r\n" +
" \r\n" +
" =-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=- \r\n" +
kg.Generate() + " \r\n" +
"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= \r\n" +
" \r\n" ;
#endregion new
}
else if(SelectedLicenseType=="ADD") //Add on
{
#region Add on
strKey="Thank you for your additional license purchase! \r\n" +
"\r\n" +
"Below is your replacement activation key with \r\n" +
"instructions for entering it. \r\n" +
"\r\n" +
"Your previous key is no longer licensed and is no \r\n" +
"longer required as this key supersedes all \r\n" +
"previous keys purchased. \r\n" +
"\r\n" +
"Reminder: no physical product will be shipped to you, this license key \r\n" +
"fulfills your order in full. \r\n" +
"\r\n" +
"\r\n" +
"HELP AND SUPPORT RESOURCES: \r\n" +
"AyaNova web site: \r\n" +
"http://www.ayanova.com \r\n" +
"Users manual: \r\n" +
"http://www.ayanova.com/download.htm \r\n" +
"Answers to frequently asked questions: \r\n" +
"http://www.ayanova.com/faqAnswers.htm \r\n" +
"Technical support forum: \r\n" +
"http://forum.ayanova.com \r\n" +
"\r\n" +
"\r\n " +
LicenseInfo(kg,setType.Value.ToString())+
"PURCHASING ADDITIONAL LICENSES \r\n" +
"If you wish to purchase additional licenses in future you must use the \r\n" +
"same registration name and registered email address used when you purchased this key. \r\n" +
" \r\n" +
" \r\n" +
"HOW TO ENTER YOUR ACTIVATION KEY \r\n" +
" \r\n" +
"1. Copy only all the text from between the -=-=-=-=-=- below to the Windows clip board \r\n" +
"(highlight the text, right-click, select Copy) \r\n" +
" \r\n" +
"Do not edit any of the key text, AyaNova will not accept an altered key. \r\n" +
" \r\n" +
"2. Ensure no other users are accessing AyaNova v3 \r\n" +
" \r\n" +
"3. Log into AyaNova v3 as the AyaNova Administrator \r\n" +
"(default is manager with password letmein ) \r\n" +
"(no quotation marks and in lowercase) \r\n" +
" \r\n" +
"4. Select Help->License from the main menu to bring up the keycode window. \r\n" +
" \r\n" +
"5. Select the menu option Paste license key \r\n" +
" \r\n" +
"6. Close AyaNova \r\n" +
" \r\n" +
" \r\n" +
" =-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=- \r\n" +
kg.Generate() + " \r\n" +
"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= \r\n" +
" \r\n" ;
#endregion add on
}
else//Licensed trial
{
if(!bWillExpire)
MessageBox.Show("WARNING: A licensed trial should have an expiry date");
#region Licensed trial
strKey="Thank you for evaluating AyaNova \r\n" +
" \r\n" +
"Below is your temporary activation key with instructions for entry into the \r\n" +
"trial of AyaNova v3 that you previously downloaded from our website. \r\n" +
" \r\n" +
" \r\n" +
"HELP AND SUPPORT RESOURCES: \r\n" +
"AyaNova web site: \r\n" +
"http://www.ayanova.com \r\n" +
"Users manual: \r\n" +
"http://www.ayanova.com/download.htm \r\n" +
"Answers to frequently asked questions: \r\n" +
"http://www.ayanova.com/faqAnswers.htm \r\n" +
"Technical support forum: \r\n" +
"http://forum.ayanova.com \r\n" +
"Latest AyaNova version update information: \r\n" +
"http://forum.ayanova.com \r\n" +
" \r\n" +
" \r\n" +
LicenseInfo(kg,setType.Value.ToString())+
"HOW TO ENTER YOUR ACTIVATION KEY \r\n" +
" \r\n" +
"1. Copy only all the text from between the -=-=-=-=-=- below to the Windows clip board \r\n" +
"(highlight the text, right-click, select Copy) \r\n" +
" \r\n" +
"Do not edit any of the key text, AyaNova will not accept an altered key. \r\n" +
" \r\n" +
"2. Ensure no other users are accessing AyaNova v3 \r\n" +
" \r\n" +
"3. Log into the trial AyaNova v3 as the AyaNova Administrator \r\n" +
"(default is manager with password letmein ) \r\n" +
"(no quotation marks and in lowercase) \r\n" +
" \r\n" +
"4. Select Help->License from the main menu to bring up the keycode window. \r\n" +
" \r\n" +
"5. Select the menu option Paste license key \r\n" +
" \r\n" +
"6. Close AyaNova \r\n" +
" \r\n" +
"7. Log back into AyaNova v3 as manager with password letmein \r\n" +
"(no quotation marks and in lowercase) \r\n" +
" \r\n" +
"8. As the trial AyaNova v3 has 5 sample scheduleable users, if the number of licenses \r\n" +
"purchased are less than 5, you will receive a message that 5 are set to Active, and \r\n" +
"the number of licenses do not match the number set Active. \r\n" +
"If you receive this message and are not going to erase the trial data, you will need \r\n" +
"to manually delete or close all workorders where sample scheduleable users are \r\n" +
"selected. Then open the Administration pane, open the Users grid, \r\n" +
"and set the sample scheduleable users to In-active. \r\n" +
" \r\n" +
"9. To erase all trial entered data and users, select Help->License from the main menu \r\n" +
"to bring up the keycode window. Select the menu option to erase sample data. \r\n" +
" \r\n" +
"10. Refer to the AyaNova v3 Manual for details on all features, tutorials, tips on use, \r\n" +
"importing AyaNova CE 1.9.4.4 data, and for installing and configuring \r\n" +
"for a network environment \r\n" +
" \r\n"+
" =-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=- \r\n" +
kg.Generate() + " \r\n" +
"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= \r\n" +
" \r\n" ;
//
// strKey="Thank you for evaluating AyaNova \r\n" +
// " \r\n" +
// "Below is your temporary activation key with instructions for entry into the\r\n" +
// "trial of AyaNova that you previously downloaded from our website. \r\n" +
// " \r\n" +
// " \r\n" +
// "HELP AND SUPPORT RESOURCES: \r\n" +
// "AyaNova web site: \r\n" +
// "http://www.ayanova.com \r\n" +
// "Users manual: \r\n" +
// "http://www.ayanova.com/download.htm \r\n" +
// "Answers to frequently asked questions: \r\n" +
// "http://www.ayanova.com/faqAnswers.htm \r\n" +
// "Technical support forum: \r\n" +
// "http://forum.ayanova.com \r\n" +
// " \r\n" +
// " \r\n" +
// LicenseInfo(kg,setType.Value.ToString())+
// "HOW TO ENTER YOUR ACTIVATION KEY \r\n" +
// " \r\n" +
// "1. Copy only all the text from between the -=-=-=-=-=- below to the Windows clip board \r\n" +
// "(highlight the text, right-click, select Copy) \r\n" +
// "\r\n" +
// "Do not edit any of the key text, AyaNova will not accept an altered key. " +
// " \r\n" +
// "2. Ensure no other users are accessing AyaNova v3 \r\n" +
// " \r\n" +
// "3. Log into the trial AyaNova v3 as \"manager\" with password \"letmein\" \r\n" +
// "(no quotation marks and in lowercase) \r\n" +
// " \r\n" +
// "4. Select Help->License from the main menu to bring up the keycode window. \r\n" +
// " \r\n" +
// "5. Select the menu option Paste license key \r\n" +
// " \r\n" +
// "6. Close AyaNova \r\n" +
// " \r\n" +
// "7. Log back into AyaNova v3 as \"manager\" with password \"letmein\" \r\n" +
// "(no quotation marks and in lowercase) \r\n" +
// " \r\n" +
// "8. As the trial AyaNova v3 has 5 sample scheduleable users, if the number of licenses provided are less than 5, \r\n" +
// "you will receive a message that 5 are set to Active, and the number of licenses do not match the number set Active. \r\n" +
// "If you receive this message and are not going to erase the trial data, open the Administration pane, open the Users \r\n" +
// "grid, and set the sample scheduleable users to In-active . \r\n" +
// " \r\n" +
// "9. Refer to the AyaNova v3 Manual Technical section for installing and configuring for a network environment, \r\n" +
// " importing your AyaNova CE 1.9.4.4 data and for erasing the trial sample data and users. \r\n" +
// " \r\n" +
// " \r\n" +
//
// " =-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=- \r\n" +
// kg.Generate() + " \r\n" +
// "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= \r\n" +
// " \r\n" ;
#endregion licensed trial
}
#endregion
edOut.Text=strKey;
edOut.SelectAll();
edOut.Copy();
}
/// <summary>
/// Extra info to display about key at top of key message
/// </summary>
/// <param name="kg"></param>
/// <returns></returns>
private string LicenseInfo(KeyGen kg, string stype)
{
StringBuilder sb = new StringBuilder();
sb.Append("LICENSE DETAILS\r\n");
sb.Append("This key must be installed by: ");
sb.Append(System.DateTime.Today.AddDays(3).ToString());
sb.Append("\r\n");
if(!System.DateTime.Today.Date.Equals(kg.Expires.Date))
{
if(stype=="LICENSEDTRIAL")
{
sb.Append("*** This has been provided for temporary evaluation purposes only *** \r\n");
sb.Append("This key will stop working after: " + kg.Expires.ToString() + "\r\n");
}
else
{
sb.Append("This license key is provided for temporary use pending payment.\r\n");
sb.Append("The key will stop working after: " + kg.Expires.ToString() + "\r\n");
sb.Append("\r\n");
sb.Append("A permanent license key will be sent to you when payment \r\n" +
"has been received and processed. There will be no extensions or \r\n" +
"exceptions. Please send in payment early enough to allow for \r\n" +
"mail and processing time to ensure uninterrupted use of AyaNova. \r\n");
}
sb.Append("\r\n");
}
sb.Append("Registered to: ");
sb.Append(kg.RegisteredTo);
sb.Append("\r\n");
sb.Append("Schedulable users: ");
sb.Append(kg.ScheduleableUsers);
sb.Append("\r\n");
sb.Append("QuickBooks interface optional add on: ");
sb.Append(kg.FeatureQuickBooksInterface?"YES":" Not purchased");
sb.Append("\r\n");
sb.Append("Web interface optional add on: ");
sb.Append(kg.FeatureWebInterface?"YES":" Not purchased");
sb.Append("\r\n\r\n");
return sb.ToString();
}
private void mnuReadKey_Click(object sender, System.EventArgs e)
{
KeyReader kr=new KeyReader(edOut.Text);
if(!kr.IsValid)
MessageBox.Show(kr.Status);
else
{
string strExpiry="Expires: n/a";
if(kr.Expires!=null) strExpiry="Expires: " + ((DateTime)kr.Expires).ToString();
MessageBox.Show(
"Key is OK:\r\n" +
strExpiry + "\r\n" +
kr.RegisteredTo+"\r\n"+
kr.ScheduleableUsers.ToString() +
"\r\n" + kr.Generated.ToString()+
"\r\nInstallable: " +
kr.Installable.ToString());
}
}
private void btn31Days_Click(object sender, System.EventArgs e)
{
dtExpires.Value=System.DateTime.Now.AddDays(31);
}
private void Form1_Load(object sender, System.EventArgs e)
{
dtExpires.Value=DBNull.Value;
}
}
}

View File

@@ -0,0 +1,277 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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 forserialized 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="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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="panel1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="panel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="panel1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="panel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="panel1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="panel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="setType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="setType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="setType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btn31Days.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="btn31Days.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="btn31Days.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label4.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="dtExpires.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="dtExpires.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="dtExpires.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ckQuickBooksInterface.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="ckQuickBooksInterface.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ckQuickBooksInterface.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="edSchedUsers.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="edSchedUsers.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="edSchedUsers.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ckWebInterface.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="ckWebInterface.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ckWebInterface.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="edRegTo.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="edRegTo.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="edRegTo.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="edOut.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="edOut.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="edOut.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="mainMenu1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="mainMenu1.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</data>
<data name="mainMenu1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="mnGenerateKey.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="mnGenerateKey.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="mnuReadKey.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="mnuReadKey.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.Name">
<value>Form1</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
</root>

View File

@@ -0,0 +1,37 @@
<VisualStudioProject>
<CSHARP ProjectType="Local" ProductVersion="7.10.3077" SchemaVersion="2.0" ProjectGuid="{D875D014-6185-404B-B5AF-09B61959DF2D}">
<Build>
<Settings ApplicationIcon="App.ico" AssemblyKeyContainerName="" AssemblyName="Generator" AssemblyOriginatorKeyFile="" DefaultClientScript="JScript" DefaultHTMLPageLayout="Grid" DefaultTargetSchema="IE50" DelaySign="false" OutputType="WinExe" PreBuildEvent="" PostBuildEvent="" RootNamespace="Generator" RunPostBuildEvent="OnBuildSuccess" StartupObject="">
<Config Name="Debug" AllowUnsafeBlocks="false" BaseAddress="285212672" CheckForOverflowUnderflow="false" ConfigurationOverrideFile="" DefineConstants="DEBUG;TRACE" DocumentationFile="" DebugSymbols="true" FileAlignment="4096" IncrementalBuild="false" NoStdLib="false" NoWarn="" Optimize="false" OutputPath="bin\Debug\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="4" />
<Config Name="Release" AllowUnsafeBlocks="false" BaseAddress="285212672" CheckForOverflowUnderflow="false" ConfigurationOverrideFile="" DefineConstants="TRACE" DocumentationFile="" DebugSymbols="false" FileAlignment="4096" IncrementalBuild="false" NoStdLib="false" NoWarn="" Optimize="true" OutputPath="bin\Release\" RegisterForComInterop="false" RemoveIntegerChecks="false" TreatWarningsAsErrors="false" WarningLevel="4" />
</Settings>
<References>
<Reference Name="System" AssemblyName="System" HintPath="..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" />
<Reference Name="System.Data" AssemblyName="System.Data" HintPath="..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" />
<Reference Name="System.Drawing" AssemblyName="System.Drawing" HintPath="..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll" />
<Reference Name="System.Windows.Forms" AssemblyName="System.Windows.Forms" HintPath="..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll" />
<Reference Name="System.XML" AssemblyName="System.Xml" HintPath="..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" />
<Reference Name="System.Security" AssemblyName="System.Security" HintPath="..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Security.dll" />
<Reference Name="Infragistics.Win.UltraWinEditors.v5.3" AssemblyName="Infragistics.Win.UltraWinEditors.v5.3" HintPath="..\..\..\..\Program Files\Infragistics\NetAdvantage 2005 Volume 3 CLR 1.0\Windows Forms\Bin\Infragistics.Win.UltraWinEditors.v5.3.dll" AssemblyFolderKey="hklm\infragistics.winassemblies.20053" Private="False" />
<Reference Name="Infragistics.Win.v5.3" AssemblyName="Infragistics.Win.v5.3" HintPath="..\..\..\..\Program Files\Infragistics\NetAdvantage 2005 Volume 3 CLR 1.0\Windows Forms\Bin\Infragistics.Win.v5.3.dll" AssemblyFolderKey="hklm\infragistics.winassemblies.20053" Private="False" />
<Reference Name="Infragistics.Shared.v5.3" AssemblyName="Infragistics.Shared.v5.3" HintPath="..\..\..\..\Program Files\Infragistics\NetAdvantage 2005 Volume 3 CLR 1.0\Windows Forms\Bin\Infragistics.Shared.v5.3.dll" AssemblyFolderKey="hklm\infragistics.winassemblies.20053" Private="False" />
<Reference Name="System.Design" AssemblyName="System.Design" HintPath="..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Design.dll" />
<Reference Name="Microsoft.VisualBasic" AssemblyName="Microsoft.VisualBasic" HintPath="..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Microsoft.VisualBasic.dll" />
<Reference Name="Infragistics.Win.Misc.v5.3" AssemblyName="Infragistics.Win.Misc.v5.3" HintPath="..\..\..\..\Program Files\Infragistics\NetAdvantage 2005 Volume 3 CLR 1.0\Windows Forms\Bin\Infragistics.Win.Misc.v5.3.dll" AssemblyFolderKey="hklm\infragistics.winassemblies.20053" Private="False" />
</References>
</Build>
<Files>
<Include>
<File RelPath="App.ico" BuildAction="Content" />
<File RelPath="AssemblyInfo.cs" SubType="Code" BuildAction="Compile" />
<File RelPath="Form1.cs" SubType="Form" BuildAction="Compile" />
<File RelPath="Form1.resx" DependentUpon="Form1.cs" BuildAction="EmbeddedResource" />
<File RelPath="KeyGen.cs" SubType="Code" BuildAction="Compile" />
<File RelPath="KeyRead.cs" SubType="Code" BuildAction="Compile" />
<File RelPath="licenses.licx" BuildAction="EmbeddedResource" />
<File RelPath="pubkey.xml" BuildAction="EmbeddedResource" />
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="Windows-1252"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D875D014-6185-404B-B5AF-09B61959DF2D}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>App.ico</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Generator</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>WinExe</OutputType>
<RootNamespace>Generator</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic">
<Name>Microsoft.VisualBasic</Name>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Design">
<Name>System.Design</Name>
</Reference>
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
</Reference>
<Reference Include="System.Security">
<Name>System.Security</Name>
</Reference>
<Reference Include="System.Windows.Forms">
<Name>System.Windows.Forms</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
<Reference Include="Infragistics2.Shared.v6.2, Version=6.2.20062.1038, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
<HintPath>C:\Program Files\Infragistics\NetAdvantage 2006 Volume 2 CLR 2.0\windows forms\bin\Infragistics2.Shared.v6.2.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
<Reference Include="Infragistics2.Win.Misc.v6.2, Version=6.2.20062.1038, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
<HintPath>C:\Program Files\Infragistics\NetAdvantage 2006 Volume 2 CLR 2.0\windows forms\bin\Infragistics2.Win.Misc.v6.2.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
<Reference Include="Infragistics2.Win.UltraWinEditors.v6.2, Version=6.2.20062.1038, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
<HintPath>C:\Program Files\Infragistics\NetAdvantage 2006 Volume 2 CLR 2.0\windows forms\bin\Infragistics2.Win.UltraWinEditors.v6.2.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
<Reference Include="Infragistics2.Win.v6.2, Version=6.2.20062.1038, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
<HintPath>C:\Program Files\Infragistics\NetAdvantage 2006 Volume 2 CLR 2.0\windows forms\bin\Infragistics2.Win.v6.2.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="App.ico" />
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="KeyGen.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="KeyRead.cs">
<SubType>Code</SubType>
</Compile>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="licenses.licx" />
<EmbeddedResource Include="pubkey.xml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,48 @@
<VisualStudioProject>
<CSHARP LastOpenVersion = "7.10.3077" >
<Build>
<Settings ReferencePath = "" >
<Config
Name = "Debug"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "true"
/>
<Config
Name = "Release"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "true"
/>
</Settings>
</Build>
<OtherProjectSettings
CopyProjectDestinationFolder = ""
CopyProjectUncPath = ""
CopyProjectOption = "0"
ProjectView = "ProjectFiles"
ProjectTrust = "0"
/>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator", "Generator.csproj", "{D875D014-6185-404B-B5AF-09B61959DF2D}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{D875D014-6185-404B-B5AF-09B61959DF2D}.Debug.ActiveCfg = Debug|.NET
{D875D014-6185-404B-B5AF-09B61959DF2D}.Debug.Build.0 = Debug|.NET
{D875D014-6185-404B-B5AF-09B61959DF2D}.Release.ActiveCfg = Release|.NET
{D875D014-6185-404B-B5AF-09B61959DF2D}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@@ -0,0 +1,212 @@
using System;
using System.IO;
using System.Xml;
using System.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
namespace GroundZero.KeyCodes
{
/// <summary>
/// AyaNova .net key generator
/// </summary>
public class KeyGen
{
private string _RegisteredTo;
private int _ScheduleableUsers;
private bool _FeatureWebInterface;
System.DateTime _Expires;
private bool _FeatureQuickBooksInterface;
public KeyGen()
{
_FeatureWebInterface=false;
_FeatureQuickBooksInterface=false;
_Expires=System.DateTime.Today;
}
public string RegisteredTo
{
get
{
return _RegisteredTo;
}
set
{
_RegisteredTo=value;
}
}
public int ScheduleableUsers
{
get
{
return _ScheduleableUsers;
}
set
{
_ScheduleableUsers=value;
}
}
public bool FeatureWebInterface
{
get
{
return _FeatureWebInterface;
}
set
{
_FeatureWebInterface=value;
}
}
public DateTime Expires
{
get
{
return _Expires;
}
set
{
_Expires=value;
}
}
public bool FeatureQuickBooksInterface
{
get
{
return _FeatureQuickBooksInterface;
}
set
{
_FeatureQuickBooksInterface=value;
}
}
/// <summary>
/// Generate keycode based on passed in data
/// </summary>
/// <returns></returns>
public string Generate()
{
if(_RegisteredTo==null || _RegisteredTo=="")
throw new ArgumentException("RegisteredTo is required","RegisteredTo");
System.Text.StringBuilder sb = new System.Text.StringBuilder();
System.Xml.XmlTextWriter w = new System.Xml.XmlTextWriter(new StringWriter(sb));
w.Formatting = System.Xml.Formatting.Indented;
w.WriteStartDocument(true);
//w.WriteDocType("KeyDocument",null,null,null);
double dSchemaVersion=1.1;
w.WriteStartElement("AyaNovaLicenseKey");
w.WriteElementString("SchemaVersion",XmlConvert.ToString(dSchemaVersion));
w.WriteElementString("Created",XmlConvert.ToString(System.DateTime.Now));
w.WriteElementString("RegisteredTo",_RegisteredTo);
w.WriteElementString("InstallableUntil",XmlConvert.ToString(System.DateTime.Today.AddDays(7)));
w.WriteElementString("TotalScheduleableUsers",XmlConvert.ToString(_ScheduleableUsers));
if(!System.DateTime.Today.Date.Equals(_Expires.Date))
w.WriteElementString("Expires",XmlConvert.ToString(_Expires.Date));
//w.WriteElementString("PermanentKey",XmlConvert.ToString(_TemporaryKey));
w.WriteElementString("FeatureWebBrowserInterface",XmlConvert.ToString(_FeatureWebInterface));
w.WriteElementString("FeatureQuickBooksInterface",XmlConvert.ToString(_FeatureQuickBooksInterface));
w.WriteEndElement();
w.WriteEndDocument();
w.Flush();
w.Close();
// Load the license request file.
XmlDocument xmldoc = new XmlDocument();
try
{
xmldoc.LoadXml(sb.ToString());
}
catch(Exception ex)
{
return (ex.Message + ":\r\n\r\n" + sb.ToString());
}
// Get the key pair from the key store.
CspParameters parms = new CspParameters(1); // PROV_RSA_FULL
parms.Flags = CspProviderFlags.UseMachineKeyStore; // Use Machine store
parms.KeyContainerName = "AyaNovaLicenseContainer"; // "CodeProject" container
parms.KeyNumber = 2; // AT_SIGNATURE
try{
RSACryptoServiceProvider csp = new RSACryptoServiceProvider(parms);
// Creating the XML signing object.
SignedXml sxml = new SignedXml(xmldoc);
sxml.SigningKey = csp;
// Set the canonicalization method for the document.
sxml.SignedInfo.CanonicalizationMethod =
SignedXml.XmlDsigCanonicalizationUrl; // No comments.
// Create an empty reference (not enveloped) for the XPath
// transformation.
Reference r = new Reference("");
// Create the XPath transform and add it to the reference list.
r.AddTransform(new XmlDsigEnvelopedSignatureTransform(false));
// Add the reference to the SignedXml object.
sxml.AddReference(r);
// Compute the signature.
sxml.ComputeSignature();
// Get the signature XML and add it to the document element.
XmlElement sig = sxml.GetXml();
xmldoc.DocumentElement.AppendChild(sig);
// Write-out formatted signed XML to console (allow for redirection).
System.Text.StringBuilder sbFinal = new System.Text.StringBuilder();
XmlTextWriter writer = new XmlTextWriter(new StringWriter(sbFinal));
writer.Formatting = Formatting.Indented;
try
{
xmldoc.WriteTo(writer);
}
finally
{
writer.Flush();
writer.Close();
}
return sbFinal.ToString();
}
catch(Exception ex)
{
return (ex.Message + ":\r\n\r\n" + sb.ToString());
}
}
}
}

View File

@@ -0,0 +1,296 @@
using System;
using System.IO;
using System.Xml;
using System.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
namespace GroundZero.KeyCodes
{
/// <summary>
/// AyaNova .net key reader and validator
/// </summary>
public class KeyReader
{
private bool _IsValid;
private string _RegisteredTo;
private int _ScheduleableUsers;
private bool _FeatureWebInterface;
private object _Expires;
private bool _FeatureQuickBooksInterface;
private string _status;
private DateTime _Generated;
private DateTime _InstallableUntil;
private bool _Installable;
private double _SchemaVersion;
public string RegisteredTo
{
get
{
return _RegisteredTo;
}
}
public string Status
{
get
{
return _status;
}
}
public int ScheduleableUsers
{
get
{
return _ScheduleableUsers;
}
}
public bool FeatureWebInterface
{
get
{
return _FeatureWebInterface;
}
}
public bool FeatureQuickBooksInterface
{
get
{
return _FeatureQuickBooksInterface;
}
}
public bool IsValid
{
get
{
return _IsValid;
}
}
public DateTime Generated
{
get
{
return _Generated;
}
}
public object Expires
{
get
{
return _Expires;
}
}
public DateTime InstallableUntil
{
get
{
return _InstallableUntil;
}
}
public bool Installable
{
get
{
return _Installable;
}
}
public double SchemaVersion
{
get
{
return _SchemaVersion;
}
}
public KeyReader(string Key)
{
_IsValid=false;
_FeatureWebInterface=false;
_FeatureQuickBooksInterface=false;
_Installable=false;
//Ensure we have a key and strip out any unnecessary text
int nStart=Key.IndexOf("<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>");
int nEnd=Key.IndexOf("</AyaNovaLicenseKey>");
if(nEnd==-1 || nStart==-1 || nEnd<nStart)
{
_IsValid=false;
_status="Error: could not find license XML in text.";
return;
}
Key=Key.Substring(nStart,(nEnd+("</AyaNovaLicenseKey>".Length))-nStart);
//validate key signature then get settings within key
// Get the XML content from the embedded XML public key.
Stream s = null;
string xmlkey = string.Empty;
try
{
// System.Reflection.Assembly ass=System.Reflection.Assembly.GetExecutingAssembly();
// string [] items=ass.GetManifestResourceNames();
// foreach(string ss in items)
// {
// string xy=ss;
// string ab=xy;
//
// }
s = typeof(KeyReader).Assembly.GetManifestResourceStream(
"Generator.pubkey.xml");
// Read-in the XML content.
StreamReader reader = new StreamReader(s);
xmlkey = reader.ReadToEnd();
reader.Close();
}
catch (Exception ex)
{
_IsValid=false;
_status="Error: could not import public key. " + ex.Message + "\r\n" + ex.InnerException;
return;
}
// Create an RSA crypto service provider from the embedded
// XML document resource (the public key).
RSACryptoServiceProvider csp = new RSACryptoServiceProvider();
csp.FromXmlString(xmlkey);
// Load the signed XML license file.
XmlDocument xmldoc = new XmlDocument();
try
{
xmldoc.LoadXml(Key);
}
catch(Exception ex)
{
_IsValid=false;
_status="Error: exception in LoadXml:\r\n." + ex.Message + "\r\n" + ex.InnerException;
return;
}
// Create the signed XML object.
SignedXml sxml = new SignedXml(xmldoc);
try
{
// Get the XML Signature node and load it into the signed XML object.
XmlNode dsig = xmldoc.GetElementsByTagName("Signature",
SignedXml.XmlDsigNamespaceUrl)[0];
sxml.LoadXml((XmlElement)dsig);
}
catch(Exception ex)
{
_IsValid=false;
_status="Error: no signature found." + ex.Message + "\r\n" + ex.InnerException;
return;
}
// Verify the signature.
if (!sxml.CheckSignature(csp))
{
_IsValid=false;
_status="Error: Signature not valid, key has been tampered with.";
return;
}
_IsValid=true;
try
{
_SchemaVersion=XmlConvert.ToDouble(xmldoc.SelectSingleNode("/AyaNovaLicenseKey/SchemaVersion").InnerText);
_RegisteredTo=xmldoc.SelectSingleNode("/AyaNovaLicenseKey/RegisteredTo").InnerText;
_ScheduleableUsers=XmlConvert.ToInt32(xmldoc.SelectSingleNode("/AyaNovaLicenseKey/TotalScheduleableUsers").InnerText);
_Generated=XmlConvert.ToDateTime(xmldoc.SelectSingleNode("/AyaNovaLicenseKey/Created").InnerText);
_InstallableUntil=XmlConvert.ToDateTime(xmldoc.SelectSingleNode("/AyaNovaLicenseKey/InstallableUntil").InnerText);
if(xmldoc.SelectSingleNode("/AyaNovaLicenseKey/Expires")!=null)
_Expires=XmlConvert.ToDateTime(xmldoc.SelectSingleNode("/AyaNovaLicenseKey/Expires").InnerText);
else
_Expires=null;
_FeatureQuickBooksInterface=XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/AyaNovaLicenseKey/FeatureQuickBooksInterface").InnerText);
_FeatureWebInterface=XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/AyaNovaLicenseKey/FeatureWebBrowserInterface").InnerText);
if(System.DateTime.Now > _InstallableUntil)
{
_Installable=false;
_status="Error: Installation key has expired.";
return;
}
_Installable=true;
//FUTURE: Here is an example of new items in a hypothetical future schema version...
// if(_SchemaVersion>1.1)
// {
// _FeatureNew=XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/AyaNovaLicenseKey/FeatureNew").InnerText);
// }
//
// if(_SchemaVersion>1.2)
// {
// }
// ETC
}
catch(Exception ex)
{
_IsValid=false;
_status="Error: Signature not valid - exception processing fields:\r\n." + ex.Message + "\r\n" + ex.InnerException;
return;
}
}
}
}

View File

@@ -0,0 +1,2 @@
Infragistics.Win.UltraWinEditors.UltraDateTimeEditor, Infragistics.Win.UltraWinEditors.v5.3, Version=5.3.20053.50, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb
Infragistics.Win.UltraWinEditors.UltraOptionSet, Infragistics.Win.UltraWinEditors.v5.3, Version=5.3.20053.50, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb

View File

@@ -0,0 +1,2 @@
Infragistics.Win.UltraWinEditors.UltraOptionSet, Infragistics2.Win.UltraWinEditors.v6.2, Version=6.2.20062.1038, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb
Infragistics.Win.UltraWinEditors.UltraDateTimeEditor, Infragistics2.Win.UltraWinEditors.v6.2, Version=6.2.20062.1038, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb

View File

@@ -0,0 +1 @@
<RSAKeyValue><Modulus>vyqf5yWWe1xguhmNbxqrMQi5xdPVsFkEg5N8v2o027rcd8ciU8ZWsNDnxDO1pXqDZFDG74B+HiAbFzLxfl7goyASItWAENnGOMgebJqpqX3JLlTt20spyDGsI4K4zSsdELhT3Q2nRt34MdWu1gMN6NIcUWrYMfoiz6UEzyBczHM=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

1501
keys/Generator/Form1.cs Normal file

File diff suppressed because it is too large Load Diff

151
keys/Generator/Form1.resx Normal file
View File

@@ -0,0 +1,151 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="mainMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>34</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAn8fgUC+P0F8AAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcIjQD0+w4N8QsODAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT4fPf0Cv4M8wqODAD8fw/2Cw
4DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCo39AfoPDQQKDfvx/I
7/A/r+CfcJffLwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPj9B/P6/v4C+w
7+8vv+/vULfw/zBoz48AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAn7/gT0+3
4NAwsO/vULjw/zB439CPp+AwAAAAAAAAAAAAAAAAAAAAAC9gwFA/h9CvMH/Qj4+w4C8AAAAAAAAAAJC3
4E9Pp+DQT6jv/zBw0MCgsOAQAAAAAAAAAAAAAAAAAAAAAKCw4A8/n+DvP7///z+///9AqO/PoLDgD3CX
0D9Qp9/fT6Dv/y9v0L+PoN8gAAAAAAAAAAAAAAAAAAAAAAAAAABwj9BAT8Dw/zCo8P9Pn+D/QLfw/0CY
399Pr+/gT5jg/z930LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcJDQT1DP8P9QoO//n7/g/0Cn
7/9Qt+//QJjv/y9o0KCPp98fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHCI0C9Qx/D/T6Dv/8DY
8P9PmOD/P5Dv/y9v0LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwiNAPX7fv/zCv
8P+/yO//f7jg/zCf7/8wiN+vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE+Q
0LBAuPD/n7fg/5/H7/8wn+//MJ/v0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AACQuOBfUL/v8ECY7/9fj9//MKDv/y+Q4L8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAz9jwD1CQ348wt/D/IK///y+g8O9fj99QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADQ2PAQL3fPgC940J9fj99P4O//DwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA/88AAP+PAAD/BwAA/wMAAP8DAAD/AwAAwwcAAIAPAACAPwAAgD8AAID/AACA/wAAwP8AAMD/
AADA/wAA4P8AAA==
</value>
</data>
</root>

View File

@@ -0,0 +1,202 @@
<?xml version="1.0" encoding="Windows-1252"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D875D014-6185-404B-B5AF-09B61959DF2D}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>App.ico</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>v7SubscriptionKeyGenerator</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>WinExe</OutputType>
<RootNamespace>GroundZero.KeyCodes</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<PublishUrl>http://localhost/Generator/</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</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>
<IsWebBootstrapper>true</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\..\3rdprtylibs\crypt\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="ChilkatDotNet4">
<HintPath>..\..\3rdprtylibs\chilkat\ChilkatDotNet4.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic">
<Name>Microsoft.VisualBasic</Name>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\3rdprtylibs\json.net.40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
</Reference>
<Reference Include="System.Security">
<Name>System.Security</Name>
</Reference>
<Reference Include="System.Windows.Forms">
<Name>System.Windows.Forms</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ALRequests.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ALRequests.Designer.cs">
<DependentUpon>ALRequests.cs</DependentUpon>
</Compile>
<Compile Include="MsgEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MsgEditor.Designer.cs">
<DependentUpon>MsgEditor.cs</DependentUpon>
</Compile>
<Compile Include="MsgGen.cs" />
<Content Include="App.ico" />
<Compile Include="ALResponse.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ALResponse.Designer.cs">
<DependentUpon>ALResponse.cs</DependentUpon>
</Compile>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="KeyGen.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="KeyRead.cs">
<SubType>Code</SubType>
</Compile>
<Content Include="key info.txt" />
<EmbeddedResource Include="ALRequests.resx">
<DependentUpon>ALRequests.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ALResponse.resx">
<DependentUpon>ALResponse.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="MsgEditor.resx">
<DependentUpon>MsgEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="pubkey.xml" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="Windows-1252"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastOpenVersion>7.10.3077</LastOpenVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>
</ReferencePath>
<CopyProjectDestinationFolder>
</CopyProjectDestinationFolder>
<CopyProjectUncPath>
</CopyProjectUncPath>
<CopyProjectOption>0</CopyProjectOption>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
<PublishUrlHistory>http://localhost/Generator/</PublishUrlHistory>
<InstallUrlHistory>
</InstallUrlHistory>
<SupportUrlHistory>
</SupportUrlHistory>
<UpdateUrlHistory>
</UpdateUrlHistory>
<BootstrapperUrlHistory>
</BootstrapperUrlHistory>
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>true</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>true</StartWithIE>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<EnableASPDebugging>false</EnableASPDebugging>
<EnableASPXDebugging>false</EnableASPXDebugging>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<RemoteDebugMachine>
</RemoteDebugMachine>
<StartAction>Project</StartAction>
<StartArguments>
</StartArguments>
<StartPage>
</StartPage>
<StartProgram>
</StartProgram>
<StartURL>
</StartURL>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWithIE>true</StartWithIE>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator", "Generator.csproj", "{D875D014-6185-404B-B5AF-09B61959DF2D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D875D014-6185-404B-B5AF-09B61959DF2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D875D014-6185-404B-B5AF-09B61959DF2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D875D014-6185-404B-B5AF-09B61959DF2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D875D014-6185-404B-B5AF-09B61959DF2D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

808
keys/Generator/KeyGen.cs Normal file
View File

@@ -0,0 +1,808 @@
using System;
using System.IO;
using System.Xml;
using System.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using System.Data;
//TESTING
//already have: using System;
using System.Text;
//already have: using System.IO;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.OpenSsl;
namespace GroundZero.KeyCodes
{
/// <summary>
/// AyaNova .net key generator
/// </summary>
public class KeyGen
{
private string _RegisteredTo;
private int _ScheduleableUsers;
System.DateTime _Expires;
private bool _RequestedTrial;
System.DateTime _InstallableUntil;
private bool _Lite;//case 1172
private DataTable dtPlugins;
//case 2094
private bool _LockOut;
System.DateTime _LockOutDate;
public KeyGen()
{
_Expires = System.DateTime.Today;
_InstallableUntil = System.DateTime.Today.AddDays(31);
WillExpire = false;
_LockOut = false;
}
public bool WillExpire { get; set; }
public string SelectedLicenseType { get; set; }
public string RegisteredTo
{
get
{
return _RegisteredTo;
}
set
{
_RegisteredTo = value;
}
}
public int ScheduleableUsers
{
get
{
return _ScheduleableUsers;
}
set
{
_ScheduleableUsers = value;
}
}
public DateTime Expires
{
get
{
return _Expires;
}
set
{
_Expires = value;
}
}
public DateTime LockoutDate
{
get
{
return _LockOutDate;
}
set
{
_LockOutDate = value;
}
}
public bool LockOut
{
get
{
return _LockOut;
}
set
{
_LockOut = value;
}
}
public DateTime InstallableUntil
{
get
{
return _InstallableUntil;
}
set
{
_InstallableUntil = value;
}
}
//case 1172
public bool Lite
{
get
{
return _Lite;
}
set
{
_Lite = value;
}
}
public bool RequestedTrial
{
get
{
return _RequestedTrial;
}
set
{
_RequestedTrial = value;
}
}
public DataTable Plugins
{
get
{
return dtPlugins;
}
set
{
dtPlugins = value;
}
}
/// <summary>
/// Generate a key in selected mode
/// </summary>
/// <param name="XMLMode"></param>
/// <returns></returns>
public string Generate(bool XMLMode)
{
if (XMLMode)
return GenerateXML();
else
return GenerateJS();
}
/// <summary>
/// Generate XML keycode based on passed in data
/// </summary>
/// <returns></returns>
public string GenerateXML()
{
if (_RegisteredTo == null || _RegisteredTo == "")
throw new ArgumentException("RegisteredTo is required", "RegisteredTo");
System.Text.StringBuilder sb = new System.Text.StringBuilder();
System.Xml.XmlTextWriter w = new System.Xml.XmlTextWriter(new StringWriter(sb));
w.Formatting = System.Xml.Formatting.Indented;
w.WriteStartDocument(true);
//w.WriteDocType("KeyDocument",null,null,null);
double dSchemaVersion = 7;
if (_Lite)
w.WriteStartElement("AyaNovaLiteLicenseKey");
else
w.WriteStartElement("AyaNovaLicenseKey");
w.WriteElementString("SchemaVersion", XmlConvert.ToString(dSchemaVersion));
w.WriteElementString("Created", XmlConvert.ToString(System.DateTime.Now, XmlDateTimeSerializationMode.Local));
//case 2094
//all licenses are now subscriptions
w.WriteElementString("Sub", XmlConvert.ToString(true));
//case 2094
//TrialExpire
w.WriteElementString("RegisteredTo", _RegisteredTo);
//case 3187 - Source here
//rockfish
//var buffer = new Buffer('Rockfish - IP: ' + req.ip + ' USER: ' + req.apitoken.id);
w.WriteElementString("Source", ToHexString("KeyGen - USER: " + System.Environment.UserName +
" MACHINE: " + System.Environment.UserDomainName));
w.WriteElementString("InstallableUntil", XmlConvert.ToString(_InstallableUntil, XmlDateTimeSerializationMode.Local));
w.WriteElementString("TotalScheduleableUsers", XmlConvert.ToString(_ScheduleableUsers));
//if(!System.DateTime.Today.Date.Equals(_Expires.Date))
//case 2094 always has an expiry date now
w.WriteElementString("Expires", XmlConvert.ToString(_Expires.Date, XmlDateTimeSerializationMode.Local));
//case 2094 now has a separate hard stop date for ayanova to stop entirely
//used for licensed and web requested trials
if (_LockOut)
w.WriteElementString("LockDate", XmlConvert.ToString(_LockOutDate.Date, XmlDateTimeSerializationMode.Local));
//case 2094 all plugins now
//w.WriteElementString("FeatureWebBrowserInterface",XmlConvert.ToString(_FeatureWebInterface));
//w.WriteElementString("FeatureMBIInterface", XmlConvert.ToString(_FeatureMBIInterface));
w.WriteElementString("RequestedTrial", XmlConvert.ToString(_RequestedTrial));
//plugins
w.WriteStartElement("Plugins");
foreach (DataRow dr in dtPlugins.Rows)
{
w.WriteStartElement("Plugin");
w.WriteElementString("Item", dr["Plugin"].ToString());
//w.WriteElementString("Version",dr["Version"].ToString());
//case 2094
DateTime dtTemp = DateTime.Parse(dr["SubscriptionExpires"].ToString());
w.WriteElementString("SubscriptionExpires", XmlConvert.ToString(dtTemp, XmlDateTimeSerializationMode.Local));
w.WriteEndElement();
}
w.WriteEndElement();
w.WriteEndElement();
w.WriteEndDocument();
w.Flush();
w.Close();
// Load the license request file.
XmlDocument xmldoc = new XmlDocument();
try
{
xmldoc.LoadXml(sb.ToString());
}
catch (Exception ex)
{
return (ex.Message + ":\r\n\r\n" + sb.ToString());
}
// Get the key pair from the key store.
CspParameters parms = new CspParameters(1); // PROV_RSA_FULL
parms.Flags = CspProviderFlags.UseMachineKeyStore; // Use Machine store
parms.KeyContainerName = "AyaNovaLicenseContainer"; // "CodeProject" container
parms.KeyNumber = 2; // AT_SIGNATURE
try
{
RSACryptoServiceProvider csp = new RSACryptoServiceProvider(parms);
// Creating the XML signing object.
SignedXml sxml = new SignedXml(xmldoc);
sxml.SigningKey = csp;
// Set the canonicalization method for the document.
sxml.SignedInfo.CanonicalizationMethod =
SignedXml.XmlDsigCanonicalizationUrl; // No comments.
// Create an empty reference (not enveloped) for the XPath
// transformation.
Reference r = new Reference("");
// Create the XPath transform and add it to the reference list.
r.AddTransform(new XmlDsigEnvelopedSignatureTransform(false));
// Add the reference to the SignedXml object.
sxml.AddReference(r);
// Compute the signature.
sxml.ComputeSignature();
// Get the signature XML and add it to the document element.
XmlElement sig = sxml.GetXml();
xmldoc.DocumentElement.AppendChild(sig);
// Write-out formatted signed XML to console (allow for redirection).
System.Text.StringBuilder sbFinal = new System.Text.StringBuilder();
XmlTextWriter writer = new XmlTextWriter(new StringWriter(sbFinal));
writer.Formatting = Formatting.Indented;
try
{
xmldoc.WriteTo(writer);
}
finally
{
writer.Flush();
writer.Close();
}
return sbFinal.ToString();
}
catch (Exception ex)
{
return (ex.Message + ":\r\n\r\n" + sb.ToString());
}
}
/// <summary>
/// Generate keycode based on passed in data
/// </summary>
/// <returns></returns>
public string GenerateJS()
{
if (_RegisteredTo == null || _RegisteredTo == "")
throw new ArgumentException("RegisteredTo is required", "RegisteredTo");
try
{
StringBuilder sbKey = new StringBuilder();
StringWriter sw = new StringWriter(sbKey);
#region ## BUILD JSON
using (Newtonsoft.Json.JsonWriter w = new Newtonsoft.Json.JsonTextWriter(sw))
{
w.Formatting = Newtonsoft.Json.Formatting.Indented;
//outer object start
w.WriteStartObject();
if (_Lite)
w.WritePropertyName("AyaNovaLiteLicenseKey");
else
w.WritePropertyName("AyaNovaLicenseKey");
w.WriteStartObject();//start of key object
w.WritePropertyName("SchemaVersion");
w.WriteValue("7");
//stamp a unique value in the key so it can be revoked later
//used to use the digest value of the key for this with xml key
//whole unix timestamp seconds but kept as a double to work beyond 2038
w.WritePropertyName("Id");
var vv = Math.Truncate((DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds);
string sId = vv.ToString();
if (sId.Contains(","))
sId = sId.Split('.')[0];
w.WriteValue(sId);
w.WritePropertyName("Created");
w.WriteValue(System.DateTime.Now);
w.WritePropertyName("Sub");
w.WriteValue("true");
w.WritePropertyName("RegisteredTo");
w.WriteValue(_RegisteredTo);//unicode test string
//case 3187 - Source here
//rockfish
//var buffer = new Buffer('Rockfish - IP: ' + req.ip + ' USER: ' + req.apitoken.id);
w.WritePropertyName("Source");
w.WriteValue(ToHexString("KeyGen - USER: " + System.Environment.UserName +
" MACHINE: " + System.Environment.UserDomainName));
w.WritePropertyName("InstallableUntil");
w.WriteValue(_InstallableUntil);
w.WritePropertyName("TotalScheduleableUsers");
w.WriteValue(_ScheduleableUsers.ToString());//Needs to be a string to match rockfish format
w.WritePropertyName("Expires");
w.WriteValue(_Expires.Date);
if (_LockOut)
{
w.WritePropertyName("LockDate");
w.WriteValue(_LockOutDate.Date);
}
w.WritePropertyName("RequestedTrial");
w.WriteValue(_RequestedTrial.ToString());
//PLUGINS
w.WritePropertyName("Plugins");
w.WriteStartObject();//start of key object
w.WritePropertyName("Plugin");
w.WriteStartArray();
foreach (DataRow dr in dtPlugins.Rows)
{
//----PLUGIN------
w.WriteStartObject();
w.WritePropertyName("Item");
w.WriteValue(dr["Plugin"].ToString());
DateTime dtTemp = DateTime.Parse(dr["SubscriptionExpires"].ToString());
w.WritePropertyName("SubscriptionExpires");
w.WriteValue(dtTemp);
w.WriteEndObject();
//----------------
}
//end of plugins array
w.WriteEnd();
//end of plugins object
w.WriteEndObject();
//end of AyaNova/AyaNovaLite key object
w.WriteEndObject();
//close outer 'wrapper' object brace }
w.WriteEndObject();
}//end of using statement
#endregion build json
#region ## CALCULATE SIGNATURE
//GET JSON as a string with whitespace stripped outside of delimited strings
//http://stackoverflow.com/questions/8913138/minify-indented-json-string-in-net
string keyNoWS = System.Text.RegularExpressions.Regex.Replace(sbKey.ToString(), "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1");
//**** Note this is our real 2016 private key
var privatePEM = @"-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAz7wrvLDcKVMZ31HFGBnLWL08IodYIV5VJkKy1Z0n2snprhSi
u3izxTyz+SLpftvKHJpky027ii7l/pL9Bo3JcjU5rKrxXavnE7TuYPjXn16dNLd0
K/ERSU+pXLmUaVN0nUWuGuUMoGJMEXoulS6pJiG11yu3BM9fL2Nbj0C6a+UwzEHF
mns3J/daZOb4gAzMUdJfh9OJ0+wRGzR8ZxyC99Na2gDmqYglUkSMjwLTL/HbgwF4
OwmoQYJBcET0Wa6Gfb17SaF8XRBV5ZtpCsbStkthGeoXZkFriB9c1eFQLKpBYQo2
DW3H1MPG2nAlQZLbkJj5cSh7/t1bRF08m6P+EQIDAQABAoIBAQCGvTpxLRXgB/Kk
EtmQBEsMx9EVZEwZeKIqKuDsBP8wvf4/10ql5mhT6kehtK9WhSDW5J2z8DtQKZMs
SBKuCZE77qH2CPp9E17SPWzQoRbaW/gDlWpYhgf8URs89XH5zxO4XtXKw/4omRlV
zLYiNR2pifv0EHqpOAg5KGzewdEo4VgXgtRWpHZLMpH2Q0/5ZIKMhstI6vFHP1p7
jmU4YI6uxiu7rVrZDmIUsAGoTdMabNqK/N8hKaoBiIto0Jn1ck26g+emLg8m160y
Xciu5yFUU+PP1SJMUs+k1UnAWf4p46X9jRLQCBRue9o0Ntiq/75aljRoDvgdwDsR
mg4ZANqxAoGBAPBoM5KoMZ4sv8ZFv8V+V8hgL5xiLgGoiwQl91mRsHRM/NQU5A/w
tH8nmwUrJOrksV7kX9228smKmoliTptyGGyi1NPmSkA7cN9YYnENoOEBHCVNK9vh
P+bkbMYUDNMW4fgOj09oXtQtMl5E2B3OTGoNwZ2w13YQJ8RIniLPsX7nAoGBAN01
eQNcUzQk9YrFGTznOs8udDLBfigDxaNnawvPueulJdBy6ZXDDrKmkQQA7xxl8YPr
dNtBq2lOgnb6+smC15TaAfV/fb8BLmkSwdn4Fy0FApIXIEOnLq+wjkte98nuezl8
9KXDzaqNI9hPuk2i36tJuLLMH8hzldveWbWjSlRHAoGBAKRPE7CQtBjfjNL+qOta
RrT0yJWhpMANabYUHNJi+K8ET2jEPnuGkFa3wwPtUPYaCABLJhprB9Unnid3wTIM
8RSO1ddd9jGgbqy3w9Bw+BvQnmQAMpG9iedNB+r5mSpM4XSgvuIO+4EYwuwbMXpt
nVx+um4Eh75xnDxTRYGVYkLRAoGAaZVpUlpR+HSfooHbPv+bSWKB4ewLPCw4vHrT
VErtEfW8q9b9eRcmP81TMFcFykc6VN4g47pfh58KlKHM7DwAjDLWdohIy89TiKGE
V3acEUfv5y0UoFX+6ara8Ey+9upWdKUY3Lotw3ckoc3EPeQ84DQK7YSSswnAgLaL
mS/8fWcCgYBjRefVbEep161d2DGruk4X7eNI9TFJ278h6ydW5kK9aTJuxkrtKIp4
CYf6emoB4mLXFPvAmnsalkhN2iB29hUZCXXSUjpKZrpijL54Wdu2S6ynm7aT97NF
oArP0E2Vbow3JMxq/oeXmHbrLMLQfYyXwFmciLFigOtkd45bfHdrbA==
-----END RSA PRIVATE KEY-----";
PemReader pr = new PemReader(new StringReader(privatePEM));
AsymmetricCipherKeyPair keys = (AsymmetricCipherKeyPair)pr.ReadObject();
var encoder = new UTF8Encoding(false, true);
var inputData = encoder.GetBytes(keyNoWS);
var signer = SignerUtilities.GetSigner("SHA256WITHRSA");
signer.Init(true, keys.Private);
signer.BlockUpdate(inputData, 0, inputData.Length);
var sign = signer.GenerateSignature();
var signature = Convert.ToBase64String(sign);
#endregion calculate signature
#region ## Return the signed key
System.Text.StringBuilder sbOut = new StringBuilder();
//sbOut.AppendLine("=-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=-=");
sbOut.AppendLine("[KEY");
sbOut.AppendLine(sbKey.ToString());
sbOut.AppendLine("KEY]");
sbOut.AppendLine("[SIGNATURE");
sbOut.AppendLine(signature);
sbOut.AppendLine("SIGNATURE]");
// sbOut.AppendLine("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
return sbOut.ToString();
#endregion
}
catch (Exception ex)
{
return (ex.Message);
}
}
//************************************************************************************************************
//************************************************************************************************************
//*********************************** NEW 2016 JSON KEY WORK *************************************************
//************************************************************************************************************
//************************************************************************************************************
//GEN-TEST
/// <summary>
/// Figure out a javascript and c# compatible signed key scheme
/// Requirements:
/// 1) generate a new json key in windows and sign it, then validate and parse it to json in windows then validate and parse in linux
/// 2) generate a new json key in linux and sign it, then validate and parse it in linux then in windows
/// </summary>
/// <returns></returns>
public void GenTest()
{
jsonGenerate();
jsonVerify();
return;
}
// /gen-test
public void jsonGenerate()
{
StringBuilder sbKey = new StringBuilder();
StringWriter sw = new StringWriter(sbKey);
#region ## BUILD JSON
using (Newtonsoft.Json.JsonWriter w = new Newtonsoft.Json.JsonTextWriter(sw))
{
w.Formatting = Newtonsoft.Json.Formatting.Indented;
//outer object start
w.WriteStartObject();
w.WritePropertyName("AyaNovaLicenseKey");
w.WriteStartObject();//start of key object
w.WritePropertyName("SchemaVersion");
w.WriteValue("7");
w.WritePropertyName("Created");
w.WriteValue(System.DateTime.Now);
w.WritePropertyName("Sub");
w.WriteValue("true");
w.WritePropertyName("RegisteredTo");
w.WriteValue("Что такое Unicode?");//unicode test string
w.WritePropertyName("InstallableUntil");
w.WriteValue(System.DateTime.Now.AddMonths(1));
w.WritePropertyName("TotalScheduleableUsers");
w.WriteValue("20");
w.WritePropertyName("Expires");
w.WriteValue(System.DateTime.Now.AddYears(1));
w.WritePropertyName("RequestedTrial");
w.WriteValue("false");
//PLUGINS
w.WritePropertyName("Plugins");
w.WriteStartObject();//start of key object
w.WritePropertyName("Plugin");
w.WriteStartArray();
//----PLUGIN------
w.WriteStartObject();
w.WritePropertyName("Item");
w.WriteValue("QuickNotification");
w.WritePropertyName("SubscriptionExpires");
w.WriteValue(System.DateTime.Now.AddYears(1));
w.WriteEndObject();
//----------------
//----PLUGIN------
w.WriteStartObject();
w.WritePropertyName("Item");
w.WriteValue("RI - Responsive Interface");
w.WritePropertyName("SubscriptionExpires");
w.WriteValue(System.DateTime.Now.AddYears(1));
w.WriteEndObject();
//----------------
//----PLUGIN------
w.WriteStartObject();
w.WritePropertyName("Item");
w.WriteValue("ImportExportCSVDuplicate");
w.WritePropertyName("SubscriptionExpires");
w.WriteValue(System.DateTime.Now.AddYears(1));
w.WriteEndObject();
//----------------
//end of plugins array
w.WriteEnd();
//end of plugins object
w.WriteEndObject();
//end of AyaNova key object
w.WriteEndObject();
//close outer 'wrapper' object brace }
w.WriteEndObject();
}//end of using statement
#endregion build json
//TEST TEST TEST
//sbKey.Clear();
//sbKey.Append("data_data_data");
//## GET JSON as a string with whitespace stripped outside of delimited strings
//http://stackoverflow.com/questions/8913138/minify-indented-json-string-in-net
string keyNoWS = System.Text.RegularExpressions.Regex.Replace(sbKey.ToString(), "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1");
#region ## CALCULATE SIGNATURE
//**** Note this is our real 2016 private key
var privatePEM = @"-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAz7wrvLDcKVMZ31HFGBnLWL08IodYIV5VJkKy1Z0n2snprhSi
u3izxTyz+SLpftvKHJpky027ii7l/pL9Bo3JcjU5rKrxXavnE7TuYPjXn16dNLd0
K/ERSU+pXLmUaVN0nUWuGuUMoGJMEXoulS6pJiG11yu3BM9fL2Nbj0C6a+UwzEHF
mns3J/daZOb4gAzMUdJfh9OJ0+wRGzR8ZxyC99Na2gDmqYglUkSMjwLTL/HbgwF4
OwmoQYJBcET0Wa6Gfb17SaF8XRBV5ZtpCsbStkthGeoXZkFriB9c1eFQLKpBYQo2
DW3H1MPG2nAlQZLbkJj5cSh7/t1bRF08m6P+EQIDAQABAoIBAQCGvTpxLRXgB/Kk
EtmQBEsMx9EVZEwZeKIqKuDsBP8wvf4/10ql5mhT6kehtK9WhSDW5J2z8DtQKZMs
SBKuCZE77qH2CPp9E17SPWzQoRbaW/gDlWpYhgf8URs89XH5zxO4XtXKw/4omRlV
zLYiNR2pifv0EHqpOAg5KGzewdEo4VgXgtRWpHZLMpH2Q0/5ZIKMhstI6vFHP1p7
jmU4YI6uxiu7rVrZDmIUsAGoTdMabNqK/N8hKaoBiIto0Jn1ck26g+emLg8m160y
Xciu5yFUU+PP1SJMUs+k1UnAWf4p46X9jRLQCBRue9o0Ntiq/75aljRoDvgdwDsR
mg4ZANqxAoGBAPBoM5KoMZ4sv8ZFv8V+V8hgL5xiLgGoiwQl91mRsHRM/NQU5A/w
tH8nmwUrJOrksV7kX9228smKmoliTptyGGyi1NPmSkA7cN9YYnENoOEBHCVNK9vh
P+bkbMYUDNMW4fgOj09oXtQtMl5E2B3OTGoNwZ2w13YQJ8RIniLPsX7nAoGBAN01
eQNcUzQk9YrFGTznOs8udDLBfigDxaNnawvPueulJdBy6ZXDDrKmkQQA7xxl8YPr
dNtBq2lOgnb6+smC15TaAfV/fb8BLmkSwdn4Fy0FApIXIEOnLq+wjkte98nuezl8
9KXDzaqNI9hPuk2i36tJuLLMH8hzldveWbWjSlRHAoGBAKRPE7CQtBjfjNL+qOta
RrT0yJWhpMANabYUHNJi+K8ET2jEPnuGkFa3wwPtUPYaCABLJhprB9Unnid3wTIM
8RSO1ddd9jGgbqy3w9Bw+BvQnmQAMpG9iedNB+r5mSpM4XSgvuIO+4EYwuwbMXpt
nVx+um4Eh75xnDxTRYGVYkLRAoGAaZVpUlpR+HSfooHbPv+bSWKB4ewLPCw4vHrT
VErtEfW8q9b9eRcmP81TMFcFykc6VN4g47pfh58KlKHM7DwAjDLWdohIy89TiKGE
V3acEUfv5y0UoFX+6ara8Ey+9upWdKUY3Lotw3ckoc3EPeQ84DQK7YSSswnAgLaL
mS/8fWcCgYBjRefVbEep161d2DGruk4X7eNI9TFJ278h6ydW5kK9aTJuxkrtKIp4
CYf6emoB4mLXFPvAmnsalkhN2iB29hUZCXXSUjpKZrpijL54Wdu2S6ynm7aT97NF
oArP0E2Vbow3JMxq/oeXmHbrLMLQfYyXwFmciLFigOtkd45bfHdrbA==
-----END RSA PRIVATE KEY-----";
PemReader pr = new PemReader(new StringReader(privatePEM));
AsymmetricCipherKeyPair keys = (AsymmetricCipherKeyPair)pr.ReadObject();
var encoder = new UTF8Encoding(false, true);
var inputData = encoder.GetBytes(keyNoWS);
var signer = SignerUtilities.GetSigner("SHA256WITHRSA");
signer.Init(true, keys.Private);
signer.BlockUpdate(inputData, 0, inputData.Length);
var sign = signer.GenerateSignature();
var signature = Convert.ToBase64String(sign);
#endregion calculate signature
//## Write out to file key and signature
System.Text.StringBuilder sbOut = new StringBuilder();
sbOut.AppendLine("=-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=-=");
sbOut.AppendLine("[KEY");
sbOut.AppendLine(sbKey.ToString());
sbOut.AppendLine("KEY]");
sbOut.AppendLine("[SIGNATURE");
sbOut.AppendLine(signature);
sbOut.AppendLine("SIGNATURE]");
sbOut.AppendLine("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
using (StreamWriter writer = new StreamWriter("c:\\temp\\newkey\\JSAyaLicense.txt", false, Encoding.UTF8))
{
writer.WriteLine(sbOut.ToString());
}
}//END OF JSONGENTEST METHOD
public bool jsonVerify()
{
string licenseFileData = string.Empty;
//using (StreamReader rdr = new StreamReader("c:\\temp\\newkey\\JSAyaLicense.txt", Encoding.UTF8))
using (StreamReader rdr = new StreamReader("c:\\temp\\newkey\\NODE_JSAyaLicense.txt", Encoding.UTF8))
{
licenseFileData = rdr.ReadToEnd();
}
//extract between [KEY and KEY]
if (!licenseFileData.Contains("[KEY") ||
!licenseFileData.Contains("KEY]") ||
!licenseFileData.Contains("[SIGNATURE") ||
!licenseFileData.Contains("SIGNATURE]"))
throw new System.FormatException("KEY IS NOT VALID! Missing one or more required delimiters");
string keyNoWS = System.Text.RegularExpressions.Regex.Replace(ExtractString(licenseFileData, "[KEY", "KEY]").Trim(), "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1");
string keySig = ExtractString(licenseFileData, "[SIGNATURE", "SIGNATURE]").Trim();
//***** NOTE: this is our real 2016 public key
var publicPem = @"-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz7wrvLDcKVMZ31HFGBnL
WL08IodYIV5VJkKy1Z0n2snprhSiu3izxTyz+SLpftvKHJpky027ii7l/pL9Bo3J
cjU5rKrxXavnE7TuYPjXn16dNLd0K/ERSU+pXLmUaVN0nUWuGuUMoGJMEXoulS6p
JiG11yu3BM9fL2Nbj0C6a+UwzEHFmns3J/daZOb4gAzMUdJfh9OJ0+wRGzR8ZxyC
99Na2gDmqYglUkSMjwLTL/HbgwF4OwmoQYJBcET0Wa6Gfb17SaF8XRBV5ZtpCsbS
tkthGeoXZkFriB9c1eFQLKpBYQo2DW3H1MPG2nAlQZLbkJj5cSh7/t1bRF08m6P+
EQIDAQAB
-----END PUBLIC KEY-----";
PemReader pr = new PemReader(new StringReader(publicPem));
var KeyParameter = (Org.BouncyCastle.Crypto.AsymmetricKeyParameter)pr.ReadObject();
var signer = SignerUtilities.GetSigner("SHA256WITHRSA");
signer.Init(false, KeyParameter);
var expectedSig = Convert.FromBase64String(keySig);
var msgBytes = Encoding.UTF8.GetBytes(keyNoWS);
signer.BlockUpdate(msgBytes, 0, msgBytes.Length);
bool isValid = signer.VerifySignature(expectedSig);
return isValid;
}//end of jsonVerify test code
/// <summary>
/// Extract string between tokens
/// </summary>
/// <param name="s"></param>
/// <param name="openTag"></param>
/// <param name="closeTag"></param>
/// <returns></returns>
string ExtractString(string s, string openTag, string closeTag)
{
int startIndex = s.IndexOf(openTag) + openTag.Length;
int endIndex = s.IndexOf(closeTag, startIndex);
return s.Substring(startIndex, endIndex - startIndex);
}
//---------------------------------------------------------------------------
//************************************************************************************************************
//************************************************************************************************************
//*********************************** NEW 2016 JSON KEY WORK *************************************************
//************************************************************************************************************
//************************************************************************************************************
public static string ToHexString(string str)
{
var sb = new StringBuilder();
var bytes = Encoding.Unicode.GetBytes(str);
foreach (var t in bytes)
{
sb.Append(t.ToString("X2"));
}
return sb.ToString(); // returns: "48656C6C6F20776F726C64" for "Hello world"
}
public static string FromHexString(string hexString)
{
var bytes = new byte[hexString.Length / 2];
for (var i = 0; i < bytes.Length; i++)
{
bytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
}
return Encoding.Unicode.GetString(bytes); // returns: "Hello world" for "48656C6C6F20776F726C64"
}
//End of module
}
}

684
keys/Generator/KeyRead.cs Normal file
View File

@@ -0,0 +1,684 @@
using System;
using System.IO;
using System.Xml;
using System.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using System.Data;
//JSON KEY
using System.Text;
using Newtonsoft.Json;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.OpenSsl;
namespace GroundZero.KeyCodes
{
/// <summary>
/// AyaNova .net key reader and validator
/// Used to rehydrate a key from a past key for add-on / subscription renewal etc
/// </summary>
public class KeyReader
{
private bool _IsValid;
private string _RegisteredTo;
private int _ScheduleableUsers;
// private bool _FeatureWebInterface;
private object _Expires;
private string _status;
private DateTime _Generated;
private DateTime _InstallableUntil;
private bool _Installable;
private double _SchemaVersion;
//private bool _FeatureMBIInterface;
private bool _RequestedTrial;
private DataTable dtPlugins;
private bool _Lite;
private bool _SubscriptionLicense;
private bool _Lockout;
private DateTime _LockoutDate;
public string RegisteredTo
{
get
{
return _RegisteredTo;
}
}
public string Status
{
get
{
return _status;
}
}
public int ScheduleableUsers
{
get
{
return _ScheduleableUsers;
}
}
public bool IsValid
{
get
{
return _IsValid;
}
}
public DateTime Generated
{
get
{
return _Generated;
}
}
public object Expires
{
get
{
return _Expires;
}
}
public DateTime InstallableUntil
{
get
{
return _InstallableUntil;
}
}
public bool Installable
{
get
{
return _Installable;
}
}
public double SchemaVersion
{
get
{
return _SchemaVersion;
}
}
public bool RequestedTrial
{
get
{
return _RequestedTrial;
}
}
public DataTable Plugins
{
get
{
return dtPlugins;
}
}
public bool Lite
{
get
{
return _Lite;
}
}
public bool SubscriptionLicense
{
get
{
return _SubscriptionLicense;
}
}
public bool Lockout
{
get
{
return _Lockout;
}
}
public DateTime LockoutDate
{
get
{
return _LockoutDate;
}
}
public KeyReader(string Key)
{
_IsValid = false;
// _FeatureWebInterface = false;
_Installable = false;
this._RegisteredTo = "";
this._ScheduleableUsers = 0;
this._SchemaVersion = 0;
this._status = "";
this._Expires = System.DateTime.Now;
_RequestedTrial = false;
this._SubscriptionLicense = false;//default for old license processing
_Lockout = false;
_LockoutDate = DateTime.MaxValue;
dtPlugins = new DataTable();
dtPlugins.Columns.Add("Plugin");
dtPlugins.Columns.Add("Version");
//case 2094
dtPlugins.Columns.Add("SubscriptionExpires");
_Installable = false;
//Ensure we have a key and strip out any unnecessary text
string sKeyType = "AyaNovaLiteLicenseKey";
_Lite = true;
if (Key.Contains("AyaNovaLicenseKey"))
{
sKeyType = "AyaNovaLicenseKey";
_Lite = false;
}
bool containsXML = Key.Contains("<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>");
bool containsJSON = Key.Contains("[KEY");
if (!containsXML && !containsJSON)
{
_IsValid = false;
_status = "Error: could not find license key in text provided";
return;
}
if (containsXML)
{
#region PARSE XML KEY
int nStart = Key.IndexOf("<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>");
int nEnd = Key.IndexOf("</" + sKeyType + ">");
if (nEnd == -1 || nStart == -1 || nEnd < nStart)
{
_IsValid = false;
_status = "Error: could not find license XML in license key provided";
return;
}
Key = Key.Substring(nStart, (nEnd + (("</" + sKeyType + ">").Length)) - nStart);
//validate key signature then get settings within key
// Get the XML content from the embedded XML public key.
Stream s = null;
string xmlkey = string.Empty;
try
{
// System.Reflection.Assembly ass=System.Reflection.Assembly.GetExecutingAssembly();
// string [] items=ass.GetManifestResourceNames();
// foreach(string ss in items)
// {
// string xy=ss;
// string ab=xy;
//
// }
System.Reflection.Assembly a = typeof(KeyReader).Assembly;
s = a.GetManifestResourceStream("GroundZero.KeyCodes.pubkey.xml");
// Read-in the XML content.
StreamReader reader = new StreamReader(s);
xmlkey = reader.ReadToEnd();
reader.Close();
}
catch (Exception ex)
{
_IsValid = false;
_status = "Error: could not import public key. " + ex.Message + "\r\n" + ex.InnerException;
return;
}
// Create an RSA crypto service provider from the embedded
// XML document resource (the public key).
RSACryptoServiceProvider csp = new RSACryptoServiceProvider();
csp.FromXmlString(xmlkey);
// Load the signed XML license file.
XmlDocument xmldoc = new XmlDocument();
try
{
xmldoc.LoadXml(Key);
}
catch (Exception ex)
{
_IsValid = false;
_status = "Error: exception in LoadXml:\r\n." + ex.Message + "\r\n" + ex.InnerException;
return;
}
// Create the signed XML object.
SignedXml sxml = new SignedXml(xmldoc);
try
{
// Get the XML Signature node and load it into the signed XML object.
XmlNode dsig = xmldoc.GetElementsByTagName("Signature",
SignedXml.XmlDsigNamespaceUrl)[0];
sxml.LoadXml((XmlElement)dsig);
}
catch (Exception ex)
{
_IsValid = false;
_status = "Error: no signature found." + ex.Message + "\r\n" + ex.InnerException;
return;
}
// Verify the signature.
if (!sxml.CheckSignature(csp))
{
_IsValid = false;
_status = "Error: Signature not valid, key has been tampered with.";
return;
}
_IsValid = true;
try
{
_SchemaVersion = XmlConvert.ToDouble(xmldoc.SelectSingleNode("/" + sKeyType + "/SchemaVersion").InnerText);
_RegisteredTo = xmldoc.SelectSingleNode("/" + sKeyType + "/RegisteredTo").InnerText;
_ScheduleableUsers = XmlConvert.ToInt32(xmldoc.SelectSingleNode("/" + sKeyType + "/TotalScheduleableUsers").InnerText);
_Generated = XmlConvert.ToDateTime(xmldoc.SelectSingleNode("/" + sKeyType + "/Created").InnerText, XmlDateTimeSerializationMode.Local);
_InstallableUntil = XmlConvert.ToDateTime(xmldoc.SelectSingleNode("/" + sKeyType + "/InstallableUntil").InnerText, XmlDateTimeSerializationMode.Local);
#region Revoked key check
string DigestValue = xmldoc.GetElementsByTagName("DigestValue")[0].InnerText;
switch (DigestValue)
{
#region Case 428
//<RegisteredTo>Braintek</RegisteredTo>,
case "mpBdutEgT9w8hWT/T1uwNmLGeLQ=":
//<RegisteredTo>MCCAIN RESEARCH LAB , INC</RegisteredTo>,
case "2pYzGIlMU18QomByUC4D72ViOyE=":
//<RegisteredTo>Standby Power System Consultants, Inc.</RegisteredTo>,
case "PlzMfZoVI4iR0Ws11yqaAf+4g5U=":
//<RegisteredTo>Snyder Services</RegisteredTo>,
case "EMmFEcwm78pskcWAIZ7z5CKdOxk=":
#endregion
#region Case 874
//<RegisteredTo>Vrobel's Heating & Cooling</RegisteredTo>,
case "dhkBn04QOYxysTnXTql/9VHkEtI=":
#endregion
#region Case 1167
//<RegisteredTo>Verhoeven kantoortotaal</RegisteredTo>
case "b75SpAQzm71JsRLNtosk0ty1Tsw=":
#endregion
#region Case 1191
// <RegisteredTo>CF Can Group</RegisteredTo>
case "i9/LC/6RVsoIT1X5YKlzBRA2T08=":
#endregion
#region Case 1364
// <RegisteredTo>Leavenworth County</RegisteredTo>
case "W2inW3VDw8FPzMdBHgE8k+U6gSg=":
// <RegisteredTo>mbernardinelli</RegisteredTo>
case "13OUStnOVvlJszgrUIcVxMcLkhw=":
// <RegisteredTo>Penney Lawn Service</RegisteredTo>
case "OSQOreX+pT0TczLrxb6ucOv4rF8=":
#endregion
#region Case 1862
// <RegisteredTo>Morris Waterworks</RegisteredTo>
case "8lPDmvrFCHnVxUDGzscSZKmGtgM=":
#endregion
_IsValid = false;
_status = "Error: Key is not valid due to NON-PAYMENT revoke list.";
return;
}
#endregion revoked key check
if (xmldoc.SelectSingleNode("/" + sKeyType + "/Expires") != null)
_Expires = XmlConvert.ToDateTime(xmldoc.SelectSingleNode("/" + sKeyType + "/Expires").InnerText, XmlDateTimeSerializationMode.Local);
else
_Expires = null;
//Case 999
if (xmldoc.SelectSingleNode("/" + sKeyType + "/RequestedTrial") != null)
_RequestedTrial = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/" + sKeyType + "/RequestedTrial").InnerText);
else
_RequestedTrial = false;
//Case 2094
if (xmldoc.SelectSingleNode("/" + sKeyType + "/Sub") != null)
_SubscriptionLicense = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/" + sKeyType + "/Sub").InnerText);
else
{
_SubscriptionLicense = false;
//default expiry to yesterday on v7 keys forcing new date to be selected in UI
_Expires = DateTime.Now.AddDays(-1);
}
//case 2094
if (xmldoc.SelectSingleNode("/" + sKeyType + "/LockDate") != null)
{
_Lockout = true;
_LockoutDate = XmlConvert.ToDateTime(xmldoc.SelectSingleNode("/" + sKeyType + "/LockDate").InnerText, XmlDateTimeSerializationMode.Local);
}
else
{
_Lockout = false;
_LockoutDate = DateTime.MaxValue;
}
//Case 2094
//deal with v7.3 licenses WBI
bool hasv7wbi = false;
if (!_SubscriptionLicense)
{
if (xmldoc.SelectSingleNode("/" + sKeyType + "/FeatureWebBrowserInterface") != null)
hasv7wbi = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/" + sKeyType + "/FeatureWebBrowserInterface").InnerText);
else
{
hasv7wbi = false;
//default expiry to yesterday on v7 keys forcing new date to be selected in UI
_Expires = DateTime.Now.AddDays(-1);
}
}
if (hasv7wbi)
{
//add it as a v7.4 plugin
DataRow dr = dtPlugins.NewRow();
dr["Plugin"] = "WBI - Web browser interface";
dr["SubscriptionExpires"] = DateTime.Now.AddDays(-1);
dtPlugins.Rows.Add(dr);
}
//Case 2094
//deal with v7.3 license MBI
bool hasv7mbi = false;
if (!_SubscriptionLicense)
{
if (xmldoc.SelectSingleNode("/" + sKeyType + "/FeatureMBIInterface") != null)
hasv7mbi = XmlConvert.ToBoolean(xmldoc.SelectSingleNode("/" + sKeyType + "/FeatureMBIInterface").InnerText);
else
{
hasv7mbi = false;
//default expiry to yesterday on v7 keys forcing new date to be selected in UI
_Expires = DateTime.Now.AddDays(-1);
}
}
if (hasv7mbi)
{
//add it as a v7.4 plugin
DataRow dr = dtPlugins.NewRow();
dr["Plugin"] = "MBI - Minimal browser interface";
dr["SubscriptionExpires"] = DateTime.Now.AddDays(-1);
dtPlugins.Rows.Add(dr);
}
//case 1053 plugins
XmlNodeList plugs = xmldoc.SelectNodes("//Plugin");
if (plugs != null && plugs.Count > 0)
{
foreach (XmlNode n in plugs)
{
DataRow dr = dtPlugins.NewRow();
dr["Plugin"] = n.SelectSingleNode("Item").InnerText;
//case 2094 SubscriptionExpires key
if (_SubscriptionLicense)
{
if (n.SelectSingleNode("SubscriptionExpires") != null)
dr["SubscriptionExpires"] = XmlConvert.ToDateTime(n.SelectSingleNode("SubscriptionExpires").InnerText, XmlDateTimeSerializationMode.Local);
}
else
{
dr["Version"] = n.SelectSingleNode("Version").InnerText;
//default expiry to yesterday on v7 keys forcing new date to be selected in UI
dr["SubscriptionExpires"] = DateTime.Now.AddDays(-1);
}
dtPlugins.Rows.Add(dr);
}
}
// ETC
_Installable = true;
}
catch (Exception ex)
{
_IsValid = false;
_status = "Error: Signature not valid - exception processing fields:\r\n." + ex.Message + "\r\n" + ex.InnerException;
return;
}
#endregion read XML format key
}
else
{
#region PARSE JSON KEY
string licenseFileData = Key;
//extract between [KEY and KEY]
if (!licenseFileData.Contains("[KEY") ||
!licenseFileData.Contains("KEY]") ||
!licenseFileData.Contains("[SIGNATURE") ||
!licenseFileData.Contains("SIGNATURE]"))
throw new System.FormatException("KEY IS NOT VALID! Missing one or more required delimiters");
string keyNoWS = System.Text.RegularExpressions.Regex.Replace(ExtractString(licenseFileData, "[KEY", "KEY]").Trim(), "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1");
string keySig = ExtractString(licenseFileData, "[SIGNATURE", "SIGNATURE]").Trim();
#region Check Signature
//***** NOTE: this is our real 2016 public key
var publicPem = @"-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz7wrvLDcKVMZ31HFGBnL
WL08IodYIV5VJkKy1Z0n2snprhSiu3izxTyz+SLpftvKHJpky027ii7l/pL9Bo3J
cjU5rKrxXavnE7TuYPjXn16dNLd0K/ERSU+pXLmUaVN0nUWuGuUMoGJMEXoulS6p
JiG11yu3BM9fL2Nbj0C6a+UwzEHFmns3J/daZOb4gAzMUdJfh9OJ0+wRGzR8ZxyC
99Na2gDmqYglUkSMjwLTL/HbgwF4OwmoQYJBcET0Wa6Gfb17SaF8XRBV5ZtpCsbS
tkthGeoXZkFriB9c1eFQLKpBYQo2DW3H1MPG2nAlQZLbkJj5cSh7/t1bRF08m6P+
EQIDAQAB
-----END PUBLIC KEY-----";
PemReader pr = new PemReader(new StringReader(publicPem));
var KeyParameter = (Org.BouncyCastle.Crypto.AsymmetricKeyParameter)pr.ReadObject();
var signer = SignerUtilities.GetSigner("SHA256WITHRSA");
signer.Init(false, KeyParameter);
var expectedSig = Convert.FromBase64String(keySig);
var msgBytes = Encoding.UTF8.GetBytes(keyNoWS);
signer.BlockUpdate(msgBytes, 0, msgBytes.Length);
if (!signer.VerifySignature(expectedSig))
{
_IsValid = false;
_status = "Error: Signature not valid, key has been tampered with.";
return;
}
#endregion check signature
//valid key (has valid signature)
_IsValid = true;
try
{
#region Get Values
Newtonsoft.Json.Linq.JToken token = Newtonsoft.Json.Linq.JObject.Parse(keyNoWS);
_SchemaVersion = (double)token.SelectToken(sKeyType + ".SchemaVersion");
_RegisteredTo = (string)token.SelectToken(sKeyType + ".RegisteredTo");
_ScheduleableUsers = (int)token.SelectToken(sKeyType + ".TotalScheduleableUsers");
_Generated = (DateTime)token.SelectToken(sKeyType + ".Created");
_InstallableUntil = (DateTime)token.SelectToken(sKeyType + ".InstallableUntil");
//REVOKED KEY CHECK HERE IN FUTURE LIKE XML VERSION DOES?
if (token.SelectToken(sKeyType + ".Expires") != null)
{
_Expires = (DateTime)token.SelectToken(sKeyType + ".Expires");
if (((DateTime)_Expires).Year == 1)
throw new System.ArgumentOutOfRangeException("Expires out of range");
}
else
{
_Expires = DateTime.MaxValue;
}
if (token.SelectToken(sKeyType + ".RequestedTrial") != null)
{
_RequestedTrial = (bool)token.SelectToken(sKeyType + ".RequestedTrial");
}
else
{
_RequestedTrial = false;
}
if (token.SelectToken(sKeyType + ".Sub") != null)
{
_SubscriptionLicense = (bool)token.SelectToken(sKeyType + ".Sub");
}
else
{
_SubscriptionLicense = false;
//default expiry to yesterday on v7 keys forcing new date to be selected in UI
_Expires = DateTime.Now.AddDays(-1);
}
if (token.SelectToken(sKeyType + ".LockDate") != null)
{
_Lockout = true;
_LockoutDate = (DateTime)token.SelectToken(sKeyType + ".LockDate");
}
else
{
_LockoutDate = DateTime.MaxValue;
_Lockout = false;
}
//PLUGINS
Newtonsoft.Json.Linq.JArray p = (Newtonsoft.Json.Linq.JArray)token.SelectToken("AyaNovaLicenseKey.Plugins.Plugin");
for (int x = 0; x < p.Count; x++)
{
DataRow dr = dtPlugins.NewRow();
dr["Plugin"] = (string)p[x].SelectToken("Item");
dr["SubscriptionExpires"] = (DateTime)p[x].SelectToken("SubscriptionExpires");
dtPlugins.Rows.Add(dr);
}
_Installable = true;
#endregion get values
}
catch (Exception ex)
{
_IsValid = false;
_status = "Error: Signature not valid - exception processing fields:\r\n." + ex.Message + "\r\n" + ex.InnerException;
return;
}
#endregion parse json key
}
}//end of function
/// <summary>
/// Extract string between tokens
/// </summary>
/// <param name="s"></param>
/// <param name="openTag"></param>
/// <param name="closeTag"></param>
/// <returns></returns>
string ExtractString(string s, string openTag, string closeTag)
{
int startIndex = s.IndexOf(openTag) + openTag.Length;
int endIndex = s.IndexOf(closeTag, startIndex);
return s.Substring(startIndex, endIndex - startIndex);
}
//=======================================
//eoc
}
}

294
keys/Generator/MsgEditor.Designer.cs generated Normal file
View File

@@ -0,0 +1,294 @@
namespace GroundZero.KeyCodes
{
partial class MsgEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.edMsg = new System.Windows.Forms.TextBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.messageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.trialGreetingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuLiteTrialGreeting = new System.Windows.Forms.ToolStripMenuItem();
this.mnuFullTrialGreeting = new System.Windows.Forms.ToolStripMenuItem();
this.mnuInsertFirstNameToken = new System.Windows.Forms.ToolStripMenuItem();
this.licenseKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuKeyNewFull = new System.Windows.Forms.ToolStripMenuItem();
this.mnuKeyNewLite = new System.Windows.Forms.ToolStripMenuItem();
this.additionalLicensesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuKeyAddOnFull = new System.Windows.Forms.ToolStripMenuItem();
this.mnuKeyAddOnLite = new System.Windows.Forms.ToolStripMenuItem();
this.licensedTrialToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuKeyTrialFull = new System.Windows.Forms.ToolStripMenuItem();
this.mnuKeyTrialLite = new System.Windows.Forms.ToolStripMenuItem();
this.insertTokenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuInsertTokenLicenseExpiryDate = new System.Windows.Forms.ToolStripMenuItem();
this.mnuInsertTokenLicenseDescription = new System.Windows.Forms.ToolStripMenuItem();
this.mnuInsertTokenLicenseKey = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// edMsg
//
this.edMsg.AcceptsReturn = true;
this.edMsg.AcceptsTab = true;
this.edMsg.Dock = System.Windows.Forms.DockStyle.Fill;
this.edMsg.Enabled = false;
this.edMsg.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.edMsg.Location = new System.Drawing.Point(0, 24);
this.edMsg.Multiline = true;
this.edMsg.Name = "edMsg";
this.edMsg.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.edMsg.Size = new System.Drawing.Size(588, 414);
this.edMsg.TabIndex = 0;
this.edMsg.TextChanged += new System.EventHandler(this.edMsg_TextChanged);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.messageToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(588, 24);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
//
// messageToolStripMenuItem
//
this.messageToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.trialGreetingToolStripMenuItem,
this.licenseKeyToolStripMenuItem,
this.saveToolStripMenuItem,
this.exitToolStripMenuItem});
this.messageToolStripMenuItem.Name = "messageToolStripMenuItem";
this.messageToolStripMenuItem.Size = new System.Drawing.Size(65, 20);
this.messageToolStripMenuItem.Text = "&Message";
//
// trialGreetingToolStripMenuItem
//
this.trialGreetingToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuLiteTrialGreeting,
this.mnuFullTrialGreeting,
this.mnuInsertFirstNameToken});
this.trialGreetingToolStripMenuItem.Name = "trialGreetingToolStripMenuItem";
this.trialGreetingToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.trialGreetingToolStripMenuItem.Text = "Trial Greeting";
//
// mnuLiteTrialGreeting
//
this.mnuLiteTrialGreeting.Name = "mnuLiteTrialGreeting";
this.mnuLiteTrialGreeting.Size = new System.Drawing.Size(204, 22);
this.mnuLiteTrialGreeting.Text = "Lite";
this.mnuLiteTrialGreeting.Click += new System.EventHandler(this.mnuLiteTrialGreeting_Click);
//
// mnuFullTrialGreeting
//
this.mnuFullTrialGreeting.Name = "mnuFullTrialGreeting";
this.mnuFullTrialGreeting.Size = new System.Drawing.Size(204, 22);
this.mnuFullTrialGreeting.Text = "Full";
this.mnuFullTrialGreeting.Click += new System.EventHandler(this.mnuFullTrialGreeting_Click);
//
// mnuInsertFirstNameToken
//
this.mnuInsertFirstNameToken.Name = "mnuInsertFirstNameToken";
this.mnuInsertFirstNameToken.Size = new System.Drawing.Size(204, 22);
this.mnuInsertFirstNameToken.Text = "Insert token - First Name";
this.mnuInsertFirstNameToken.Click += new System.EventHandler(this.mnuInsertFirstNameToken_Click);
//
// licenseKeyToolStripMenuItem
//
this.licenseKeyToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.additionalLicensesToolStripMenuItem,
this.licensedTrialToolStripMenuItem,
this.insertTokenToolStripMenuItem});
this.licenseKeyToolStripMenuItem.Name = "licenseKeyToolStripMenuItem";
this.licenseKeyToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.licenseKeyToolStripMenuItem.Text = "License key";
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuKeyNewFull,
this.mnuKeyNewLite});
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(173, 22);
this.newToolStripMenuItem.Text = "New";
//
// mnuKeyNewFull
//
this.mnuKeyNewFull.Name = "mnuKeyNewFull";
this.mnuKeyNewFull.Size = new System.Drawing.Size(93, 22);
this.mnuKeyNewFull.Text = "Full";
this.mnuKeyNewFull.Click += new System.EventHandler(this.mnuKeyNewFull_Click);
//
// mnuKeyNewLite
//
this.mnuKeyNewLite.Name = "mnuKeyNewLite";
this.mnuKeyNewLite.Size = new System.Drawing.Size(93, 22);
this.mnuKeyNewLite.Text = "Lite";
this.mnuKeyNewLite.Click += new System.EventHandler(this.mnuKeyNewLite_Click);
//
// additionalLicensesToolStripMenuItem
//
this.additionalLicensesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuKeyAddOnFull,
this.mnuKeyAddOnLite});
this.additionalLicensesToolStripMenuItem.Name = "additionalLicensesToolStripMenuItem";
this.additionalLicensesToolStripMenuItem.Size = new System.Drawing.Size(173, 22);
this.additionalLicensesToolStripMenuItem.Text = "Additional licenses";
//
// mnuKeyAddOnFull
//
this.mnuKeyAddOnFull.Name = "mnuKeyAddOnFull";
this.mnuKeyAddOnFull.Size = new System.Drawing.Size(93, 22);
this.mnuKeyAddOnFull.Text = "Full";
this.mnuKeyAddOnFull.Click += new System.EventHandler(this.mnuKeyAddOnFull_Click);
//
// mnuKeyAddOnLite
//
this.mnuKeyAddOnLite.Name = "mnuKeyAddOnLite";
this.mnuKeyAddOnLite.Size = new System.Drawing.Size(93, 22);
this.mnuKeyAddOnLite.Text = "Lite";
this.mnuKeyAddOnLite.Click += new System.EventHandler(this.mnuKeyAddOnLite_Click);
//
// licensedTrialToolStripMenuItem
//
this.licensedTrialToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuKeyTrialFull,
this.mnuKeyTrialLite});
this.licensedTrialToolStripMenuItem.Name = "licensedTrialToolStripMenuItem";
this.licensedTrialToolStripMenuItem.Size = new System.Drawing.Size(173, 22);
this.licensedTrialToolStripMenuItem.Text = "Licensed Trial";
//
// mnuKeyTrialFull
//
this.mnuKeyTrialFull.Name = "mnuKeyTrialFull";
this.mnuKeyTrialFull.Size = new System.Drawing.Size(93, 22);
this.mnuKeyTrialFull.Text = "Full";
this.mnuKeyTrialFull.Click += new System.EventHandler(this.mnuKeyTrialFull_Click);
//
// mnuKeyTrialLite
//
this.mnuKeyTrialLite.Name = "mnuKeyTrialLite";
this.mnuKeyTrialLite.Size = new System.Drawing.Size(93, 22);
this.mnuKeyTrialLite.Text = "Lite";
this.mnuKeyTrialLite.Click += new System.EventHandler(this.mnuKeyTrialLite_Click);
//
// insertTokenToolStripMenuItem
//
this.insertTokenToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuInsertTokenLicenseExpiryDate,
this.mnuInsertTokenLicenseDescription,
this.mnuInsertTokenLicenseKey});
this.insertTokenToolStripMenuItem.Name = "insertTokenToolStripMenuItem";
this.insertTokenToolStripMenuItem.Size = new System.Drawing.Size(173, 22);
this.insertTokenToolStripMenuItem.Text = "Insert Token";
//
// mnuInsertTokenLicenseExpiryDate
//
this.mnuInsertTokenLicenseExpiryDate.Name = "mnuInsertTokenLicenseExpiryDate";
this.mnuInsertTokenLicenseExpiryDate.Size = new System.Drawing.Size(175, 22);
this.mnuInsertTokenLicenseExpiryDate.Text = "License expiry date";
this.mnuInsertTokenLicenseExpiryDate.Click += new System.EventHandler(this.mnuInsertTokenLicenseExpiryDate_Click);
//
// mnuInsertTokenLicenseDescription
//
this.mnuInsertTokenLicenseDescription.Name = "mnuInsertTokenLicenseDescription";
this.mnuInsertTokenLicenseDescription.Size = new System.Drawing.Size(175, 22);
this.mnuInsertTokenLicenseDescription.Text = "License description";
this.mnuInsertTokenLicenseDescription.Click += new System.EventHandler(this.mnuInsertTokenLicenseDescription_Click);
//
// mnuInsertTokenLicenseKey
//
this.mnuInsertTokenLicenseKey.Name = "mnuInsertTokenLicenseKey";
this.mnuInsertTokenLicenseKey.Size = new System.Drawing.Size(175, 22);
this.mnuInsertTokenLicenseKey.Text = "License key";
this.mnuInsertTokenLicenseKey.Click += new System.EventHandler(this.mnuInsertTokenLicenseKey_Click);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.saveToolStripMenuItem.Text = "&Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// MsgEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(588, 438);
this.Controls.Add(this.edMsg);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "MsgEditor";
this.Text = "Key generator message editor";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MsgEditor_FormClosing);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox edMsg;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem messageToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem trialGreetingToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mnuLiteTrialGreeting;
private System.Windows.Forms.ToolStripMenuItem mnuFullTrialGreeting;
private System.Windows.Forms.ToolStripMenuItem mnuInsertFirstNameToken;
private System.Windows.Forms.ToolStripMenuItem licenseKeyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mnuKeyNewFull;
private System.Windows.Forms.ToolStripMenuItem mnuKeyNewLite;
private System.Windows.Forms.ToolStripMenuItem additionalLicensesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mnuKeyAddOnFull;
private System.Windows.Forms.ToolStripMenuItem mnuKeyAddOnLite;
private System.Windows.Forms.ToolStripMenuItem licensedTrialToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mnuKeyTrialFull;
private System.Windows.Forms.ToolStripMenuItem mnuKeyTrialLite;
private System.Windows.Forms.ToolStripMenuItem insertTokenToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mnuInsertTokenLicenseExpiryDate;
private System.Windows.Forms.ToolStripMenuItem mnuInsertTokenLicenseDescription;
private System.Windows.Forms.ToolStripMenuItem mnuInsertTokenLicenseKey;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
}
}

239
keys/Generator/MsgEditor.cs Normal file
View File

@@ -0,0 +1,239 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace GroundZero.KeyCodes
{
public partial class MsgEditor : Form
{
public MsgEditor()
{
InitializeComponent();
}
private MessageType currentMessageType = MessageType.None;
private string currentMessage = "";
#region open message types menu clicks
private void mnuLiteTrialGreeting_Click(object sender, EventArgs e)
{
OpenMessage(MessageType.TrialGreetingLite);
}
private void mnuFullTrialGreeting_Click(object sender, EventArgs e)
{
OpenMessage(MessageType.TrialGreetingFull);
}
private void mnuKeyNewFull_Click(object sender, EventArgs e)
{
OpenMessage(MessageType.KeyNewFull);
}
private void mnuKeyNewLite_Click(object sender, EventArgs e)
{
OpenMessage(MessageType.KeyNewLite);
}
private void mnuKeyAddOnFull_Click(object sender, EventArgs e)
{
OpenMessage(MessageType.KeyAddOnFull);
}
private void mnuKeyAddOnLite_Click(object sender, EventArgs e)
{
OpenMessage(MessageType.KeyAddOnLite);
}
private void mnuKeyTrialFull_Click(object sender, EventArgs e)
{
OpenMessage(MessageType.KeyTrialFull);
}
private void mnuKeyTrialLite_Click(object sender, EventArgs e)
{
OpenMessage(MessageType.KeyTrialLite);
}
#endregion open message types menu clicks
#region nuts and bolts
private bool IsDirty
{
get
{
if (currentMessageType == MessageType.None) return false;
return currentMessage != edMsg.Text;
}
}
private void OpenMessage(MessageType mtype)
{
if (IsDirty)
{
if (!PromptToSave())
return;
}
Read(mtype);
edMsg.Enabled = true;
}
private bool PromptToSave()
{
DialogResult dr = MessageBox.Show("Save changes?", "Changes have been made", MessageBoxButtons.YesNoCancel);
if(dr== System.Windows.Forms.DialogResult.Cancel)
return false;
if (dr == System.Windows.Forms.DialogResult.No) return true;
Save();
return true;
}
private void Save()
{
File.WriteAllText(FileName(currentMessageType), edMsg.Text);
currentMessage = edMsg.Text;
ShowDirty();
}
private void Read(MessageType mtype)
{
currentMessageType = mtype;
this.Text = "Key generator message editor - " + FileName(mtype);
if (!File.Exists(FileName(mtype)))
{
MessageBox.Show("File " + FileName(mtype) + " not found, a new one will be created on save");
edMsg.Text = "";
currentMessage = "";
return;
}
currentMessage=edMsg.Text = File.ReadAllText(FileName(mtype));
ShowDirty();
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
Save();
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void MsgEditor_FormClosing(object sender, FormClosingEventArgs e)
{
if (IsDirty)
{
if (!PromptToSave())
{
e.Cancel = true;
return;
}
}
}
private void edMsg_TextChanged(object sender, EventArgs e)
{
ShowDirty();
}
private void ShowDirty()
{
this.Text = this.Text.Replace("*", "");
if (IsDirty)
{
this.Text = "*" + this.Text;
}
}
#endregion nuts and bolts
#region Tokens
private void mnuInsertFirstNameToken_Click(object sender, EventArgs e)
{
edMsg.SelectedText = "[FirstName]";
}
private void mnuInsertTokenLicenseExpiryDate_Click(object sender, EventArgs e)
{
edMsg.SelectedText = "[LicenseExpiryDate]";
}
private void mnuInsertTokenLicenseDescription_Click(object sender, EventArgs e)
{
edMsg.SelectedText = "[LicenseDescription]";
}
private void mnuInsertTokenLicenseKey_Click(object sender, EventArgs e)
{
edMsg.SelectedText = "[LicenseKey]";
}
#endregion tokens
#region MessageType enum
enum MessageType
{
None,
TrialGreetingLite,
TrialGreetingFull,
KeyNewFull,
KeyNewLite,
KeyAddOnFull,
KeyAddOnLite,
KeyTrialFull,
KeyTrialLite
}
private string FileName(MessageType mtype)
{
switch (mtype)
{
case MessageType.TrialGreetingFull:
return "TrialGreetingFull.txt";
case MessageType.TrialGreetingLite:
return "TrialGreetingLite.txt";
case MessageType.KeyNewFull:
return "KeyNewFull.txt";
case MessageType.KeyNewLite:
return "KeyNewLite.txt";
case MessageType.KeyAddOnFull:
return "KeyAddOnFull.txt";
case MessageType.KeyAddOnLite:
return "KeyAddOnLite.txt";
case MessageType.KeyTrialFull:
return "KeyTrialFull.txt";
case MessageType.KeyTrialLite:
return "KeyTrialLite.txt";
}
return "";
}
#endregion MessageTypeEnum
}//end of class
}

View File

@@ -0,0 +1,123 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

346
keys/Generator/MsgGen.cs Normal file
View File

@@ -0,0 +1,346 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.IO;
namespace GroundZero.KeyCodes
{
class MsgGen
{
/*
*
* - Trial greeting message
Lite and Full separate
[FirstName] - requesters first name, need to auto capitalize first letter
- Key message
[LicenseExpiryDate] (Now plus 7 days)
[LicenseDescription] (textual description of info for body of message see code)
[LicenseKey] (actual key)
New key message
Lite
Full
Add on key message
Lite
Full
Licensed trial key message
Lite
Full
*/
public static string TrialGreetingMessage(bool bLite, string sName)
{
if (!string.IsNullOrEmpty(sName))
{
// convert to char array of the string
char[] letters = sName.ToCharArray();
// upper case the first char
letters[0] = char.ToUpper(letters[0]);
// return the array made of the new char array
sName = new string(letters);
}
if (!bLite)
{
return File.ReadAllText(FileName(MessageType.TrialGreetingFull)).Replace("[FirstName]", sName);
}
else
{
return File.ReadAllText(FileName(MessageType.TrialGreetingLite)).Replace("[FirstName]", sName);
}
}
public static string TrialKeyMessage(bool bLite, string sRegTo, bool XMLFormat)
{
KeyGen kg = new KeyGen();
kg.Lite = bLite;
//case 2094 moved to plugins
//kg.FeatureMBIInterface = !bLite;
//kg.FeatureWebInterface = !bLite;
kg.Expires = DateTime.Now.AddDays(31);
kg.Plugins = new DataTable();
kg.Plugins.Columns.Add("Plugin");
//kg.Plugins.Columns.Add("Version");
kg.Plugins.Columns.Add("SubscriptionExpires");
#region Add trial plugins
DataRow dr = kg.Plugins.NewRow();
dr["Plugin"] = "QBI - QuickBooks interface";
//dr["Version"] = "7";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
dr = kg.Plugins.NewRow();
dr["Plugin"] = "QBOI - QuickBooks Online interface";
//dr["Version"] = "7";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
dr = kg.Plugins.NewRow();
dr["Plugin"] = "PTI - US Sage 50/Peachtree interface";
//dr["Version"] = "7";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
if (!kg.Lite)
{
dr = kg.Plugins.NewRow();
dr["Plugin"] = "QuickNotification";
//dr["Version"] = "Licensed";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
}
dr = kg.Plugins.NewRow();
dr["Plugin"] = "ExportToXls";
//dr["Version"] = "Licensed";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
dr = kg.Plugins.NewRow();
dr["Plugin"] = "OutlookSchedule";
//dr["Version"] = "Licensed";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
dr = kg.Plugins.NewRow();
dr["Plugin"] = "AyaNovaOLI";
//dr["Version"] = "Licensed";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
dr = kg.Plugins.NewRow();
dr["Plugin"] = "ImportExportCSVDuplicate";
//dr["Version"] = "Licensed";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
if (!kg.Lite)
{
dr = kg.Plugins.NewRow();
dr["Plugin"] = "WBI - Web browser interface";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
dr = kg.Plugins.NewRow();
dr["Plugin"] = "MBI - Minimal browser interface";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
dr = kg.Plugins.NewRow();
dr["Plugin"] = "RI - Responsive Interface";
dr["SubscriptionExpires"] = kg.Expires.ToString();
kg.Plugins.Rows.Add(dr);
}
#endregion
kg.RegisteredTo = sRegTo;
kg.RequestedTrial = true;
if (kg.Lite)
kg.ScheduleableUsers = 1;
else
kg.ScheduleableUsers = 5;
kg.SelectedLicenseType = "Web requested trial";
kg.WillExpire = true;
return FormatMessage(kg, XMLFormat);
}
public static string FormatMessage(KeyGen kg, bool XMLFormat)
{
string sMessage = "";
if (kg.SelectedLicenseType == "New")
{
if (kg.Lite)
{
sMessage = File.ReadAllText(FileName(MessageType.KeyNewLite));
}
else
{
sMessage = File.ReadAllText(FileName(MessageType.KeyNewFull));
}
}
else if (kg.SelectedLicenseType == "Add on")
{
if (kg.Lite)
{
sMessage = File.ReadAllText(FileName(MessageType.KeyAddOnLite));
}
else
{
sMessage = File.ReadAllText(FileName(MessageType.KeyAddOnFull));
}
}
else//licensed trial
{
if (kg.Lite)
{
sMessage = File.ReadAllText(FileName(MessageType.KeyTrialLite));
}
else
{
sMessage = File.ReadAllText(FileName(MessageType.KeyTrialFull));
}
}
//token substitutions
sMessage = sMessage.Replace("[LicenseExpiryDate]", kg.InstallableUntil.ToLongDateString());
sMessage = sMessage.Replace("[LicenseDescription]", LicenseInfo(kg));
sMessage = sMessage.Replace("[LicenseKey]", kg.Generate(XMLFormat));
return sMessage;
}
/// <summary>
/// Extra info to display about key at top of key message
/// </summary>
/// <param name="kg"></param>
/// <returns></returns>
public static string LicenseInfo(KeyGen kg)
{
StringBuilder sb = new StringBuilder();
sb.Append("LICENSE DETAILS\r\n");
sb.Append("This key must be installed before: ");
sb.Append(kg.InstallableUntil.ToLongDateString());
sb.Append("\r\n");
//if (kg.SelectedLicenseType == "Web requested trial")
//{
// sb.Append("*** This temporary license key has been provided for limited evaluation purposes only *** \r\n");
// sb.Append("This license will expire and AyaNova usage will be restricted after: " + kg.Expires.ToLongDateString() + "\r\n\r\n");
//}
if (kg.LockOut)
{
sb.Append("*** This temporary license key is provided for evaluation use only pending payment ***\r\n");
sb.Append("This license will expire and AyaNova usage will be restricted after: " + kg.Expires.ToLongDateString() + "\r\n");
sb.Append("\r\n");
sb.Append("A permanent license key will be sent to you when payment \r\n" +
"has been received and processed. There will be no extensions or \r\n" +
"exceptions. Please send in payment early enough to allow for \r\n" +
"mail and processing time to ensure uninterrupted use of AyaNova" + (kg.Lite ? " Lite" : "") + ". \r\n\r\n");
}
sb.Append("Registered to: ");
sb.Append(kg.RegisteredTo);
sb.Append("\r\n");
sb.Append("Scheduleable resources: ");
switch (kg.ScheduleableUsers)
{
case 1:
sb.AppendLine("1");
break;
case 5:
sb.AppendLine("Up to 5");
break;
case 10:
sb.AppendLine("Up to 10");
break;
case 20:
sb.AppendLine("Up to 20");
break;
case 50:
sb.AppendLine("Up to 50");
break;
case 999:
sb.AppendLine("Up to 999");
break;
}
sb.AppendLine("Support and updates until: " + kg.Expires.ToLongDateString() + "\r\n");
if (kg.Plugins.Rows.Count > 0)
{
sb.Append("\r\n");
sb.Append("Plugins:\r\n");
foreach (DataRow dr in kg.Plugins.Rows)
{
sb.Append("\t");
sb.Append(dr["Plugin"].ToString());
sb.Append(" support and updates until: ");
DateTime dtx = DateTime.Parse(dr["SubscriptionExpires"].ToString());
sb.Append(dtx.ToLongDateString());
sb.Append("\r\n");
}
}
return sb.ToString();
}
#region MessageType enum
static string FileName(MessageType mtype)
{
switch (mtype)
{
case MessageType.TrialGreetingFull:
return "TrialGreetingFull.txt";
case MessageType.TrialGreetingLite:
return "TrialGreetingLite.txt";
case MessageType.KeyNewFull:
return "KeyNewFull.txt";
case MessageType.KeyNewLite:
return "KeyNewLite.txt";
case MessageType.KeyAddOnFull:
return "KeyAddOnFull.txt";
case MessageType.KeyAddOnLite:
return "KeyAddOnLite.txt";
case MessageType.KeyTrialFull:
return "KeyTrialFull.txt";
case MessageType.KeyTrialLite:
return "KeyTrialLite.txt";
}
return "";
}
#endregion MessageTypeEnum
}//end of class
public enum MessageType
{
None,
TrialGreetingLite,
TrialGreetingFull,
KeyNewFull,
KeyNewLite,
KeyAddOnFull,
KeyAddOnLite,
KeyTrialFull,
KeyTrialLite
}
}//end of namespace

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="Generator">
</Property><Property Name="Solution File" Value="C:\data\AyaNova 3.2\keys\Generator\Generator.sln">
</Property><Property Name="User Options File" Value="C:\data\AyaNova 3.2\keys\Generator\Generator.suo">
</Property><Property Name="Date" Value="Monday, October 02, 2006">
</Property><Property Name="Time" Value="12:52 PM">
</Property></Properties><Event ErrorLevel="0" Project="" Source="Generator.sln" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\Generator.sln">
</Event><Event ErrorLevel="0" Project="" Source="Generator.suo" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\Generator.suo">
</Event><Event ErrorLevel="0" Project="Generator" Source="Generator.csproj" Description="Project file successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\Generator.csproj">
</Event><Event ErrorLevel="0" Project="Generator" Source="Generator.csproj.user" Description="Project user file successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\Generator.csproj.user">
</Event><Event ErrorLevel="0" Project="Generator" Source="AssemblyInfo.cs" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\AssemblyInfo.cs">
</Event><Event ErrorLevel="0" Project="Generator" Source="Form1.cs" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\Form1.cs">
</Event><Event ErrorLevel="0" Project="Generator" Source="KeyGen.cs" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\KeyGen.cs">
</Event><Event ErrorLevel="0" Project="Generator" Source="KeyRead.cs" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\KeyRead.cs">
</Event><Event ErrorLevel="0" Project="Generator" Source="App.ico" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\App.ico">
</Event><Event ErrorLevel="0" Project="Generator" Source="Form1.resx" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\Form1.resx">
</Event><Event ErrorLevel="0" Project="Generator" Source="licenses.licx" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\licenses.licx">
</Event><Event ErrorLevel="0" Project="Generator" Source="pubkey.xml" Description="File successfully backed up as C:\data\AyaNova 3.2\keys\Generator\Backup\pubkey.xml">
</Event><Event ErrorLevel="0" Project="Generator" Source="Generator.csproj" Description="Project converted successfully">
</Event><Event ErrorLevel="3" Project="Generator" Source="Generator.csproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="Generator.sln" Description="Solution converted successfully">
</Event><Event ErrorLevel="3" Project="" Source="Generator.sln" Description="Converted">
</Event><Event ErrorLevel="0" Project="Generator" Source="Generator.csproj" Description="Scan complete: Upgrade not required for project files.">
</Event></UpgradeLog>

View File

@@ -0,0 +1,207 @@
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}

View File

@@ -0,0 +1,232 @@
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
<xsl:key name="ProjectKey" match="Event" use="@Project" />
<xsl:template match="Events" mode="createProjects">
<projects>
<xsl:for-each select="Event">
<!--xsl:sort select="@Project" order="descending"/-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
<xsl:variable name="ProjectName" select="@Project"/>
<project>
<xsl:attribute name="name">
<xsl:value-of select="@Project"/>
</xsl:attribute>
<xsl:if test="@Project=''">
<xsl:attribute name="solution">
<xsl:value-of select="@Solution"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="key('ProjectKey', $ProjectName)">
<!--xsl:sort select="@Source" /-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
<source>
<xsl:attribute name="name">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:variable name="Source">
<xsl:value-of select="@Source"/>
</xsl:variable>
<xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
<event>
<xsl:attribute name="error-level">
<xsl:value-of select="@ErrorLevel"/>
</xsl:attribute>
<xsl:attribute name="description">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</event>
</xsl:for-each>
</source>
</xsl:if>
</xsl:for-each>
</project>
</xsl:if>
</xsl:for-each>
</projects>
</xsl:template>
<xsl:template match="projects">
<xsl:for-each select="project">
<xsl:sort select="@Name" order="ascending"/>
<h2>
<xsl:if test="@solution"><a _locID="Solution">Solution</a>: <xsl:value-of select="@solution"/></xsl:if>
<xsl:if test="not(@solution)"><a _locID="Project">Project</a>: <xsl:value-of select="@name"/>
<xsl:for-each select="source">
<xsl:variable name="Hyperlink" select="@name"/>
<xsl:for-each select="event[@error-level='4']">
&#32;<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</h2>
<table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
<tr>
<td nowrap="1" class="header" _locID="Filename">Filename</td>
<td nowrap="1" class="header" _locID="Status">Status</td>
<td nowrap="1" class="header" _locID="Errors">Errors</td>
<td nowrap="1" class="header" _locID="Warnings">Warnings</td>
</tr>
<xsl:for-each select="source">
<xsl:sort select="@name" order="ascending"/>
<xsl:variable name="source-id" select="generate-id(.)"/>
<xsl:if test="count(event)!=count(event[@error-level='4'])">
<tr class="row">
<td class="content">
<A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" _locID="IMG.alt" _locAttrData="alt" alt="expand/collapse section" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9" ><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A>&#32;<xsl:value-of select="@name"/>
</td>
<td class="content">
<xsl:if test="count(event[@error-level='3'])=1">
<xsl:for-each select="event[@error-level='3']">
<xsl:if test="@description='Converted'"><a _locID="Converted1">Converted</a></xsl:if>
<xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0"><a _locID="Converted2">Converted</a>
</xsl:if>
</td>
<td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
<td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
</tr>
<tr class="collapsed" bgcolor="#ffffff">
<xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
<td colspan="7">
<table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
<tr>
<td colspan="7" class="issuetitle" _locID="ConversionIssues">Conversion Report - <xsl:value-of select="@name"/>:</td>
</tr>
<xsl:for-each select="event[@error-level!='3']">
<xsl:if test="@error-level!='4'">
<tr>
<td class="issuenone" style="border-bottom:solid 1 lightgray">
<xsl:value-of select="@description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr valign="top">
<td class="foot">
<xsl:if test="count(source)!=1">
<xsl:value-of select="count(source)"/><a _locID="file1"> files</a>
</xsl:if>
<xsl:if test="count(source)=1">
<a _locID="file2">1 file</a>
</xsl:if>
</td>
<td class="foot">
<a _locID="Converted3">Converted</a>:&#32;<xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR />
<a _locID="NotConverted">Not converted</a>:&#32;<xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
</td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="Property">
<xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
<tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
</xsl:if>
</xsl:template>
<xsl:template match="UpgradeLog">
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css" />
<title _locID="ConversionReport0">Conversion Report&#32;
<xsl:if test="Properties/Property[@Name='LogNumber']">
<xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
</xsl:if>
</title>
<script language="javascript">
function outliner () {
oMe = window.event.srcElement
//get child element
var child = document.all[event.srcElement.getAttribute("child",false)];
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic() {
uMe = window.event.srcElement;
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("upgradereport_plus.gif") != -1)
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
}
else
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
}
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
<h1 _locID="ConversionReport">Conversion Report - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
<p><span class="note">
<b _locID="TimeOfConversion">Time of Conversion:</b>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Date']/@Value"/>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
</span></p>
<xsl:variable name="SortedEvents">
<Events>
<xsl:for-each select="Event">
<xsl:sort select="@Project" order="ascending"/>
<xsl:sort select="@Source" order="ascending"/>
<xsl:sort select="@ErrorLevel" order="ascending"/>
<Event>
<xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
<xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
<xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
<xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
<xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
</Event>
</xsl:for-each>
</Events>
</xsl:variable>
<xsl:variable name="Projects">
<xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
<p></p><p>
<table class="note">
<tr>
<td nowrap="1">
<b _locID="ConversionSettings">Conversion Settings</b>
</td>
</tr>
<xsl:apply-templates select="Properties"/>
</table></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

View File

@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" /></startup></configuration>

Binary file not shown.

View File

@@ -0,0 +1,64 @@
Thank you for your additional license purchase!
Below is your replacement activation key with
instructions for entering it.
This key replaces your previous key which is no longer required.
You must apply this license before [LicenseExpiryDate].
Be sure to review and implement the backup procedures for AyaNova
as outlined in the AyaNova help file from http://www.ayanova.com/onlinehelp.htm
Re-issue of a keycode may require payment of an administration fee.
Reminder: no physical product will be shipped to you, this license key
fulfills your order in full.
HELP AND SUPPORT RESOURCES
ONLINE:
AyaNova web site:
http://www.ayanova.com
Answers to frequently asked questions:
http://www.ayanova.com/faqAnswers.htm
Technical support forum:
http://forum.ayanova.com
Latest AyaNova version update information:
http://forum.ayanova.com
Downloads and help documentation:
http://www.ayanova.com/download.htm
http://www.ayanova.com/onlinehelp.htm
[LicenseDescription]
PURCHASING ADDITIONAL LICENSES
If you wish to purchase additional licenses in future do use the
same registration name and registered email address used when you purchased this key.
HOW TO ENTER YOUR LICENSE KEY
1. Ensure no other users are running AyaNova.
2. Copy the unaltered text from between the -=-=-=-=-=- below to the Windows clipboard
(highlight the text, right-click, select Copy).
3. Log in as the AyaNova Administrator
(default login is manager with password letmein ).
4. Select Help->License from the main menu to open the license key entry window.
5. Select the menu option Paste license key, AyaNova will close.
=-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=-
[LicenseKey]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

View File

@@ -0,0 +1,54 @@
Thank you for your additional license purchase!
Below is your replacement activation key with
instructions for entering it.
This key replaces your previous key which is no longer required.
You must apply this license before [LicenseExpiryDate].
Be sure to review and implement the backup procedures for AyaNova
as outlined in the AyaNova help file from http://www.ayanova.com/onlinehelp.htm
Re-issue of a keycode may require payment of an administration fee.
Reminder: no physical product will be shipped to you, this license key
fulfills your order in full.
HELP AND SUPPORT RESOURCES
ONLINE:
AyaNova web site:
http://www.ayanova.com
Answers to frequently asked questions:
http://www.ayanova.com/faqAnswers.htm
Technical support forum:
http://forum.ayanova.com
Latest AyaNova version update information:
http://forum.ayanova.com
Downloads and help documentation:
http://www.ayanova.com/download.htm
[LicenseDescription]
HOW TO ENTER YOUR LICENSE KEY
1. Copy the unaltered text from between the -=-=-=-=-=- below to the Windows clipboard
(highlight the text, right-click, select Copy).
2. Select Help->License from the AyaNova Lite main menu to open the license key entry window.
3. Select the menu option Paste license key, AyaNova Lite will close.
=-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=-
[LicenseKey]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

View File

@@ -0,0 +1,72 @@
Thank you for your purchase and welcome to the
world-wide community of AyaNova users!
Below is your activation key with instructions for entry into the
trial of AyaNova 7 that you previously downloaded from our website,
installed and tested for suitability.
You must apply this license before the Install By date of [LicenseExpiryDate].
Once the keycode is applied, there is never a need to re-apply as the keycode is maintained in the database along with your data.
Be sure to review and implement the backup procedures for AyaNova
as outlined in the AyaNova help file from http://www.ayanova.com/onlinehelp.htm
Re-issue of a keycode may require payment of an administration fee.
Reminder: no physical product will be shipped to you, this license key
fulfills your order in full.
PURCHASING ADDITIONAL LICENSES
If you wish to purchase additional licenses in future do use the
same registration name and registered email address used when you purchased this key.
Additional AyaNova licenses can be purchased via the link at
http://www.ayanova.com/purchase.htm
HELP AND SUPPORT RESOURCES
ONLINE:
AyaNova web site:
http://www.ayanova.com
Answers to frequently asked questions:
http://www.ayanova.com/faqAnswers.htm
Technical support forum:
http://forum.ayanova.com
Latest AyaNova version update information:
http://forum.ayanova.com
Downloads and help documentation:
http://www.ayanova.com/download.htm
http://www.ayanova.com/onlinehelp.htm
[LicenseDescription]
HOW TO ENTER YOUR LICENSE KEY
1. Ensure no other users are running AyaNova.
2. Copy the unaltered text from between the -=-=-=-=-=- below to the Windows clipboard
(highlight the text, right-click, select Copy).
3. Log in as the AyaNova Administrator
(default login is manager with password letmein ).
4. Select Help->License from the main menu to open the license key entry window.
5. Select the menu option Paste license key, AyaNova will close.
6. Refer to the AyaNova Help file for installation, configuration and use such as
http://www.ayanova.com/AyaNova7webHelp/suggested_order_of_setting_up_.htm
7. If any issues applying this license keycode, please contact support@ayanova.com
with the error so we can help right away
=-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=-
[LicenseKey]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

View File

@@ -0,0 +1,66 @@
Thank you for your purchase and welcome to the
world-wide community of AyaNova users!
Below is your activation key with instructions for entry into the
trial of AyaNova Lite 7 that you previously downloaded from our website,
installed and tested for suitability.
You must apply this license before the Install By date of [LicenseExpiryDate].
Once the keycode is applied, there is never a need to re-apply as the keycode is maintained in the database along with your data.
Be sure to review and implement the backup procedures for AyaNova Lite
as outlined in the AyaNova Lite help file from http://www.ayanova.com/onlinehelp.htm
Re-issue of a keycode may require payment of an administration fee.
Reminder: no physical product will be shipped to you, this license key
fulfills your order in full.
HELP AND SUPPORT RESOURCES
ONLINE:
AyaNova web site:
http://www.ayanova.com
Answers to frequently asked questions:
http://www.ayanova.com/faqAnswers.htm
Technical support forum:
http://forum.ayanova.com
Latest AyaNova version update information:
http://forum.ayanova.com
Downloads and help documentation:
http://www.ayanova.com/download.htm
http://www.ayanova.com/onlinehelp.htm
[LicenseDescription]
HOW TO ENTER YOUR LICENSE KEY
1. Make sure you have toggled to your AyaNova Lite trial. Refer to the http://www.ayanova.com/AyaNovalite7webHelp/toggle_between_ayanovalite_and.htm
2. Copy the unaltered text from between the -=-=-=-=-=- below to the Windows clipboard
(highlight the text, right-click, select Copy).
3. Select Help->License from the AyaNova Lite main menu to open the license key entry window.
4. Select the menu option Paste license key, AyaNova Lite will close.
5. Refer to the AyaNova Lite Help file for installation, configuration and use such as
http://www.ayanova.com/AyaNovaLite7webHelp/suggested_order_of_setting_up_.htm
6. If any issues applying this license keycode, please contact support@ayanova.com
with the error so we can help right away
=-=-=-=-=-=-< LICENSE KEYCODE >-=-=-=-=-=-=-
[LicenseKey]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

View File

@@ -0,0 +1,52 @@
Thank you for evaluating AyaNova 7 and its optional add-ons.
Below is your temporary license key with instructions for entry into the
trial of AyaNova that you previously downloaded from our website.
You must apply this license before [LicenseExpiryDate].
HELP AND SUPPORT RESOURCES
ONLINE:
AyaNova web site:
http://www.ayanova.com
Answers to frequently asked questions:
http://www.ayanova.com/faqAnswers.htm
Technical support forum:
http://forum.ayanova.com
Latest AyaNova version update information:
http://forum.ayanova.com
Downloads and help documentation:
http://www.ayanova.com/download.htm
http://www.ayanova.com/onlinehelp.htm
[LicenseDescription]
HOW TO ENTER YOUR LICENSE KEY
1. Ensure no other users are running AyaNova.
2. Copy the unaltered text from between the -=-=-=-=-=- below to the Windows clipboard
(highlight the text, right-click, select Copy).
3. Log in as the AyaNova Administrator
(default login is manager with password letmein ).
4. Select Help->License from the main menu to open the license key entry window.
5. Select the menu option Paste license key, AyaNova will close.
6. Log into AyaNova using one of the sample usernames as identified in
http://www.ayanova.com/AyaNova7webHelp/sample_users_and_passwords.htm
=-=-=-=-=-=-< LICENSE KEY >-=-=-=-=-=-=-
[LicenseKey]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

View File

@@ -0,0 +1,50 @@
Thank you for evaluating AyaNova Lite 7 and its optional add-ons.
Below is your temporary license key with instructions for entry into the
trial of AyaNova Lite that you previously downloaded from our website.
You must apply this license before [LicenseExpiryDate]
HELP AND SUPPORT RESOURCES
ONLINE:
AyaNova web site:
http://www.ayanova.com
Answers to frequently asked questions:
http://www.ayanova.com/faqAnswers.htm
Technical support forum:
http://forum.ayanova.com
Latest AyaNova version update information:
http://forum.ayanova.com
Downloads and help documentation:
http://www.ayanova.com/download.htm
http://www.ayanova.com/onlinehelp.htm
[LicenseDescription]
HOW TO ENTER YOUR LICENSE KEY
1. Make sure you have toggled to your AyaNova Lite trial. Refer to the http://www.ayanova.com/AyaNovalite7webHelp/toggle_between_ayanovalite_and.htm
2. Copy the unaltered text from between the -=-=-=-=-=- below to the Windows clipboard
(highlight the text, right-click, select Copy).
3. Select Help->License from the AyaNova Lite main menu to open the license key entry window.
4. Select the menu option Paste license key, AyaNova Lite will close.
5. Refer to the AyaNova Lite Help file for installation, configuration and use such as
http://www.ayanova.com/AyaNovaLite7webHelp/suggested_order_of_setting_up_.htm
=-=-=-=-=-=-< LICENSE KEY >-=-=-=-=-=-=-
[LicenseKey]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

View File

@@ -0,0 +1,13 @@
Hello [FirstName],
Thank you for your interest in AyaNova
Following this message will be your AyaNova 7 and optional add-on's temporary 30 day Activation key in its own email. Apply as per its instructions.
Please be sure to follow along with the tutorials in the AyaNova online Help documentation. The tutorials will ensure you are able to customize your AyaNova to fit your specific needs.
Start with http://www.ayanova.com/AyaNova7webHelp/basic_overview_of_a_workorder.htm and the next tutorial after that, and so on.
Or, if you'd rather, simply reply to this email with your needs and we would be happy to help!
Your AyaNova Support Team

View File

@@ -0,0 +1,13 @@
Hello [FirstName],
Thank you for your interest in AyaNova Lite.
Following this message will be your AyaNova Lite 7 and optional add-on's temporary 30 day Activation key in its own email. Apply as per its instructions.
Please be sure to follow along with the tutorials in the Lite online Help documentation. The tutorials will ensure you are able to customize your AyaNova Lite to fit your specific needs.
Start with http://www.ayanova.com/ayanovalite7webHelp/schedule_user_for_new_workorde.htm and the next tutorial after that, and so on.
Or, if you'd rather, simply reply to this email with your needs and we would be happy to help!
Your AyaNova Support Team

239
keys/Generator/key info.txt Normal file
View File

@@ -0,0 +1,239 @@
RSA key information for license key generation
Using .net licenses are signed using a RSA key stored in AyaNovaKey.snk file.
I have extracted the private and public keys into PEM files which are in the generator folder
The code used to do this in case it comes up again is here:
//====================================================================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
namespace KeyStuff
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
//RSACryptoServiceProvider csp = new RSACryptoServiceProvider(parms);
RSACryptoServiceProvider csp = new RSACryptoServiceProvider();
csp.ImportCspBlob(System.IO.File.ReadAllBytes("c:\\temp\\lic.snk"));
//RSAParameters RSAParams = csp.ExportParameters(true);
try
{
System.IO.TextWriter privFile = new StreamWriter("c:\\temp\\AyaNovaPrivateLicenseSigningKey.pem");
ExportPrivateKey(csp, privFile);
privFile.Flush();
privFile.Close();
privFile = null;
System.IO.TextWriter writeFile = new StreamWriter("c:\\temp\\AyaNovaPublicLicenseSigningKey.pem");
ExportPublicKey(csp, writeFile);
writeFile.Flush();
writeFile.Close();
writeFile = null;
}
catch (IOException ex)
{
MessageBox.Show(ex.ToString());
}
}
catch (Exception ex)
{
}
}
//FROM http://stackoverflow.com/questions/28406888/c-sharp-rsa-public-key-output-not-correct/28407693#28407693
private static void ExportPublicKey(RSACryptoServiceProvider csp, TextWriter outputStream)
{
var parameters = csp.ExportParameters(false);
using (var stream = new MemoryStream())
{
var writer = new BinaryWriter(stream);
writer.Write((byte)0x30); // SEQUENCE
using (var innerStream = new MemoryStream())
{
var innerWriter = new BinaryWriter(innerStream);
innerWriter.Write((byte)0x30); // SEQUENCE
EncodeLength(innerWriter, 13);
innerWriter.Write((byte)0x06); // OBJECT IDENTIFIER
var rsaEncryptionOid = new byte[] { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01 };
EncodeLength(innerWriter, rsaEncryptionOid.Length);
innerWriter.Write(rsaEncryptionOid);
innerWriter.Write((byte)0x05); // NULL
EncodeLength(innerWriter, 0);
innerWriter.Write((byte)0x03); // BIT STRING
using (var bitStringStream = new MemoryStream())
{
var bitStringWriter = new BinaryWriter(bitStringStream);
bitStringWriter.Write((byte)0x00); // # of unused bits
bitStringWriter.Write((byte)0x30); // SEQUENCE
using (var paramsStream = new MemoryStream())
{
var paramsWriter = new BinaryWriter(paramsStream);
EncodeIntegerBigEndian(paramsWriter, parameters.Modulus); // Modulus
EncodeIntegerBigEndian(paramsWriter, parameters.Exponent); // Exponent
var paramsLength = (int)paramsStream.Length;
EncodeLength(bitStringWriter, paramsLength);
bitStringWriter.Write(paramsStream.GetBuffer(), 0, paramsLength);
}
var bitStringLength = (int)bitStringStream.Length;
EncodeLength(innerWriter, bitStringLength);
innerWriter.Write(bitStringStream.GetBuffer(), 0, bitStringLength);
}
var length = (int)innerStream.Length;
EncodeLength(writer, length);
writer.Write(innerStream.GetBuffer(), 0, length);
}
var base64 = Convert.ToBase64String(stream.GetBuffer(), 0, (int)stream.Length).ToCharArray();
outputStream.WriteLine("-----BEGIN PUBLIC KEY-----");
for (var i = 0; i < base64.Length; i += 64)
{
outputStream.WriteLine(base64, i, Math.Min(64, base64.Length - i));
}
outputStream.WriteLine("-----END PUBLIC KEY-----");
}
}
//FROM http://stackoverflow.com/questions/23734792/c-sharp-export-private-public-rsa-key-from-rsacryptoserviceprovider-to-pem-strin
private static void ExportPrivateKey(RSACryptoServiceProvider csp, TextWriter outputStream)
{
if (csp.PublicOnly) throw new ArgumentException("CSP does not contain a private key", "csp");
var parameters = csp.ExportParameters(true);
using (var stream = new MemoryStream())
{
var writer = new BinaryWriter(stream);
writer.Write((byte)0x30); // SEQUENCE
using (var innerStream = new MemoryStream())
{
var innerWriter = new BinaryWriter(innerStream);
EncodeIntegerBigEndian(innerWriter, new byte[] { 0x00 }); // Version
EncodeIntegerBigEndian(innerWriter, parameters.Modulus);
EncodeIntegerBigEndian(innerWriter, parameters.Exponent);
EncodeIntegerBigEndian(innerWriter, parameters.D);
EncodeIntegerBigEndian(innerWriter, parameters.P);
EncodeIntegerBigEndian(innerWriter, parameters.Q);
EncodeIntegerBigEndian(innerWriter, parameters.DP);
EncodeIntegerBigEndian(innerWriter, parameters.DQ);
EncodeIntegerBigEndian(innerWriter, parameters.InverseQ);
var length = (int)innerStream.Length;
EncodeLength(writer, length);
writer.Write(innerStream.GetBuffer(), 0, length);
}
var base64 = Convert.ToBase64String(stream.GetBuffer(), 0, (int)stream.Length).ToCharArray();
outputStream.WriteLine("-----BEGIN RSA PRIVATE KEY-----");
// Output as Base64 with lines chopped at 64 characters
for (var i = 0; i < base64.Length; i += 64)
{
outputStream.WriteLine(base64, i, Math.Min(64, base64.Length - i));
}
outputStream.WriteLine("-----END RSA PRIVATE KEY-----");
}
}
private static void EncodeLength(BinaryWriter stream, int length)
{
if (length < 0) throw new ArgumentOutOfRangeException("length", "Length must be non-negative");
if (length < 0x80)
{
// Short form
stream.Write((byte)length);
}
else
{
// Long form
var temp = length;
var bytesRequired = 0;
while (temp > 0)
{
temp >>= 8;
bytesRequired++;
}
stream.Write((byte)(bytesRequired | 0x80));
for (var i = bytesRequired - 1; i >= 0; i--)
{
stream.Write((byte)(length >> (8 * i) & 0xff));
}
}
}
private static void EncodeIntegerBigEndian(BinaryWriter stream, byte[] value, bool forceUnsigned = true)
{
stream.Write((byte)0x02); // INTEGER
var prefixZeros = 0;
for (var i = 0; i < value.Length; i++)
{
if (value[i] != 0) break;
prefixZeros++;
}
if (value.Length - prefixZeros == 0)
{
EncodeLength(stream, 1);
stream.Write((byte)0);
}
else
{
if (forceUnsigned && value[prefixZeros] > 0x7f)
{
// Add a prefix zero to force unsigned if the MSB is 1
EncodeLength(stream, value.Length - prefixZeros + 1);
stream.Write((byte)0);
}
else
{
EncodeLength(stream, value.Length - prefixZeros);
}
for (var i = prefixZeros; i < value.Length; i++)
{
stream.Write(value[i]);
}
}
}
//===================================================
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
<RSAKeyValue><Modulus>vyqf5yWWe1xguhmNbxqrMQi5xdPVsFkEg5N8v2o027rcd8ciU8ZWsNDnxDO1pXqDZFDG74B+HiAbFzLxfl7goyASItWAENnGOMgebJqpqX3JLlTt20spyDGsI4K4zSsdELhT3Q2nRt34MdWu1gMN6NIcUWrYMfoiz6UEzyBczHM=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

Binary file not shown.

View File

@@ -0,0 +1,24 @@
obj\Release\Generator.exe
obj\Release\ResolveAssemblyReference.cache
obj\Release\Generator.pubkey.xml
obj\Release\GroundZero.KeyCodes.Form1.resources
obj\Release\Generator.csproj.GenerateResource.Cache
obj\Release\Generator.exe.licenses
bin\Release\Generator.exe
obj\Debug\Generator.exe
obj\Debug\Generator.pdb
obj\Debug\ResolveAssemblyReference.cache
obj\Debug\Generator.pubkey.xml
obj\Debug\GroundZero.KeyCodes.Form1.resources
obj\Debug\Generator.csproj.GenerateResource.Cache
obj\Debug\Generator.exe.licenses
bin\Debug\Generator.exe
bin\Debug\Generator.pdb
bin\Release\Infragistics2.Win.v6.3.xml
bin\Release\Infragistics2.Shared.v6.3.xml
bin\Release\Infragistics2.Win.UltraWinEditors.v6.3.xml
bin\Release\Infragistics2.Win.Misc.v6.3.xml
bin\Debug\Infragistics2.Win.v6.3.xml
bin\Debug\Infragistics2.Shared.v6.3.xml
bin\Debug\Infragistics2.Win.UltraWinEditors.v6.3.xml
bin\Debug\Infragistics2.Win.Misc.v6.3.xml

Binary file not shown.

View File

@@ -0,0 +1 @@
<RSAKeyValue><Modulus>vyqf5yWWe1xguhmNbxqrMQi5xdPVsFkEg5N8v2o027rcd8ciU8ZWsNDnxDO1pXqDZFDG74B+HiAbFzLxfl7goyASItWAENnGOMgebJqpqX3JLlTt20spyDGsI4K4zSsdELhT3Q2nRt34MdWu1gMN6NIcUWrYMfoiz6UEzyBczHM=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

View File

@@ -0,0 +1 @@
<RSAKeyValue><Modulus>vyqf5yWWe1xguhmNbxqrMQi5xdPVsFkEg5N8v2o027rcd8ciU8ZWsNDnxDO1pXqDZFDG74B+HiAbFzLxfl7goyASItWAENnGOMgebJqpqX3JLlTt20spyDGsI4K4zSsdELhT3Q2nRt34MdWu1gMN6NIcUWrYMfoiz6UEzyBczHM=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>