checking in all the old panacean stuff

This commit is contained in:
2016-07-25 15:42:39 -04:00
parent c996cdd81f
commit 8fd9e44ae5
1210 changed files with 220657 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,873 @@
namespace VS2005SampleNET
{
partial class FormMain
{
/// <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.components = new System.ComponentModel.Container();
this.label1 = new System.Windows.Forms.Label();
this.timerUpdateUnits = new System.Windows.Forms.Timer(this.components);
this.btnSortArray = new System.Windows.Forms.Button();
this.btnShowRegistation = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOk = new System.Windows.Forms.Button();
this.lProtectionDate = new System.Windows.Forms.Label();
this.label26 = new System.Windows.Forms.Label();
this.lLaunchesLeft = new System.Windows.Forms.Label();
this.lLaunchesTotal = new System.Windows.Forms.Label();
this.lTrialDaysLeft = new System.Windows.Forms.Label();
this.lTrialDaysTotal = new System.Windows.Forms.Label();
this.label29 = new System.Windows.Forms.Label();
this.label27 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.btnRenew = new System.Windows.Forms.Button();
this.btnRegister = new System.Windows.Forms.Button();
this.tbRenewalCode = new System.Windows.Forms.TextBox();
this.tbLicenseCode = new System.Windows.Forms.TextBox();
this.lCurrentRegistrationDate = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.lFirstRegistrationDate = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.lOrderDate = new System.Windows.Forms.Label();
this.lCurrentActivationDate = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.lCurrentPPVersion = new System.Windows.Forms.Label();
this.lCustomerEMail = new System.Windows.Forms.Label();
this.lCustomerName = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.lIntelliProtectorVersion = new System.Windows.Forms.Label();
this.lSupportExpirationPPVersion = new System.Windows.Forms.Label();
this.lSupportExpirationDaysLeft = new System.Windows.Forms.Label();
this.lLicenseExpirationDaysLeft = new System.Windows.Forms.Label();
this.lSupportExpirationDate = new System.Windows.Forms.Label();
this.lLicenseExpirationDate = new System.Windows.Forms.Label();
this.lSupportExpirationDaysTotal = new System.Windows.Forms.Label();
this.lLicenseExpirationDaysTotal = new System.Windows.Forms.Label();
this.lBuyNowLink = new System.Windows.Forms.Label();
this.lRenewLicenseLink = new System.Windows.Forms.Label();
this.lLicenseCode = new System.Windows.Forms.Label();
this.lLicenseType = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label35 = new System.Windows.Forms.Label();
this.label31 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.label39 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label37 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.lIsProtected = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.lTrialTimeUnitsLeft = new System.Windows.Forms.Label();
this.lTrialTimeUnitsTotal = new System.Windows.Forms.Label();
this.lIsRegistered = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.btnRegistrationByEmail = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(470, 513);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(229, 13);
this.label1.TabIndex = 5;
this.label1.Text = "IntelliProtector sample. Visual Studio 2005.NET";
//
// timerUpdateUnits
//
this.timerUpdateUnits.Enabled = true;
this.timerUpdateUnits.Interval = 30000;
this.timerUpdateUnits.Tick += new System.EventHandler(this.timerUpdateUnits_Tick);
//
// btnSortArray
//
this.btnSortArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSortArray.Location = new System.Drawing.Point(547, 119);
this.btnSortArray.Name = "btnSortArray";
this.btnSortArray.Size = new System.Drawing.Size(153, 23);
this.btnSortArray.TabIndex = 73;
this.btnSortArray.Text = "Sort array (encrypted call)";
this.btnSortArray.UseVisualStyleBackColor = true;
this.btnSortArray.Click += new System.EventHandler(this.btnSortArray_Click);
//
// btnShowRegistation
//
this.btnShowRegistation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnShowRegistation.Location = new System.Drawing.Point(547, 89);
this.btnShowRegistation.Name = "btnShowRegistation";
this.btnShowRegistation.Size = new System.Drawing.Size(153, 23);
this.btnShowRegistation.TabIndex = 72;
this.btnShowRegistation.Text = "Show Registration Window";
this.btnShowRegistation.UseVisualStyleBackColor = true;
this.btnShowRegistation.Click += new System.EventHandler(this.btnShowRegistation_Click);
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(624, 41);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 71;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOk
//
this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnOk.Location = new System.Drawing.Point(624, 12);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 70;
this.btnOk.Text = "Ok";
this.btnOk.UseVisualStyleBackColor = true;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// lProtectionDate
//
this.lProtectionDate.Location = new System.Drawing.Point(141, 146);
this.lProtectionDate.Name = "lProtectionDate";
this.lProtectionDate.Size = new System.Drawing.Size(179, 13);
this.lProtectionDate.TabIndex = 135;
this.lProtectionDate.Text = "date";
//
// label26
//
this.label26.AutoSize = true;
this.label26.Location = new System.Drawing.Point(12, 146);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(82, 13);
this.label26.TabIndex = 134;
this.label26.Text = "Protection date:";
//
// lLaunchesLeft
//
this.lLaunchesLeft.AutoSize = true;
this.lLaunchesLeft.Location = new System.Drawing.Point(119, 269);
this.lLaunchesLeft.Name = "lLaunchesLeft";
this.lLaunchesLeft.Size = new System.Drawing.Size(13, 13);
this.lLaunchesLeft.TabIndex = 131;
this.lLaunchesLeft.Text = "0";
//
// lLaunchesTotal
//
this.lLaunchesTotal.AutoSize = true;
this.lLaunchesTotal.Location = new System.Drawing.Point(119, 251);
this.lLaunchesTotal.Name = "lLaunchesTotal";
this.lLaunchesTotal.Size = new System.Drawing.Size(13, 13);
this.lLaunchesTotal.TabIndex = 130;
this.lLaunchesTotal.Text = "0";
//
// lTrialDaysLeft
//
this.lTrialDaysLeft.AutoSize = true;
this.lTrialDaysLeft.Location = new System.Drawing.Point(119, 227);
this.lTrialDaysLeft.Name = "lTrialDaysLeft";
this.lTrialDaysLeft.Size = new System.Drawing.Size(13, 13);
this.lTrialDaysLeft.TabIndex = 133;
this.lTrialDaysLeft.Text = "0";
//
// lTrialDaysTotal
//
this.lTrialDaysTotal.AutoSize = true;
this.lTrialDaysTotal.Location = new System.Drawing.Point(119, 191);
this.lTrialDaysTotal.Name = "lTrialDaysTotal";
this.lTrialDaysTotal.Size = new System.Drawing.Size(13, 13);
this.lTrialDaysTotal.TabIndex = 132;
this.lTrialDaysTotal.Text = "0";
//
// label29
//
this.label29.AutoSize = true;
this.label29.Location = new System.Drawing.Point(12, 269);
this.label29.Name = "label29";
this.label29.Size = new System.Drawing.Size(93, 13);
this.label29.TabIndex = 127;
this.label29.Text = "Trial launches left:";
//
// label27
//
this.label27.AutoSize = true;
this.label27.Location = new System.Drawing.Point(12, 251);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(99, 13);
this.label27.TabIndex = 126;
this.label27.Text = "Trial launches total:";
//
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(12, 227);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(72, 13);
this.label21.TabIndex = 129;
this.label21.Text = "Trial days left:";
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(12, 191);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(78, 13);
this.label20.TabIndex = 128;
this.label20.Text = "Trial days total:";
//
// btnRenew
//
this.btnRenew.Location = new System.Drawing.Point(416, 451);
this.btnRenew.Name = "btnRenew";
this.btnRenew.Size = new System.Drawing.Size(75, 23);
this.btnRenew.TabIndex = 117;
this.btnRenew.Text = "Renew";
this.btnRenew.UseVisualStyleBackColor = true;
this.btnRenew.Click += new System.EventHandler(this.btnRenew_Click);
//
// btnRegister
//
this.btnRegister.Location = new System.Drawing.Point(417, 425);
this.btnRegister.Name = "btnRegister";
this.btnRegister.Size = new System.Drawing.Size(75, 23);
this.btnRegister.TabIndex = 116;
this.btnRegister.Text = "Register";
this.btnRegister.UseVisualStyleBackColor = true;
//
// tbRenewalCode
//
this.tbRenewalCode.Location = new System.Drawing.Point(109, 451);
this.tbRenewalCode.Name = "tbRenewalCode";
this.tbRenewalCode.Size = new System.Drawing.Size(301, 20);
this.tbRenewalCode.TabIndex = 115;
//
// tbLicenseCode
//
this.tbLicenseCode.Location = new System.Drawing.Point(110, 425);
this.tbLicenseCode.Name = "tbLicenseCode";
this.tbLicenseCode.Size = new System.Drawing.Size(301, 20);
this.tbLicenseCode.TabIndex = 114;
//
// lCurrentRegistrationDate
//
this.lCurrentRegistrationDate.Location = new System.Drawing.Point(141, 128);
this.lCurrentRegistrationDate.Name = "lCurrentRegistrationDate";
this.lCurrentRegistrationDate.Size = new System.Drawing.Size(179, 13);
this.lCurrentRegistrationDate.TabIndex = 93;
this.lCurrentRegistrationDate.Text = "date";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(12, 128);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(122, 13);
this.label12.TabIndex = 92;
this.label12.Text = "Current registration date:";
//
// lFirstRegistrationDate
//
this.lFirstRegistrationDate.Location = new System.Drawing.Point(141, 109);
this.lFirstRegistrationDate.Name = "lFirstRegistrationDate";
this.lFirstRegistrationDate.Size = new System.Drawing.Size(179, 13);
this.lFirstRegistrationDate.TabIndex = 91;
this.lFirstRegistrationDate.Text = "date";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(12, 109);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(107, 13);
this.label10.TabIndex = 90;
this.label10.Text = "First registration date:";
//
// lOrderDate
//
this.lOrderDate.Location = new System.Drawing.Point(141, 71);
this.lOrderDate.Name = "lOrderDate";
this.lOrderDate.Size = new System.Drawing.Size(179, 13);
this.lOrderDate.TabIndex = 88;
this.lOrderDate.Text = "date";
//
// lCurrentActivationDate
//
this.lCurrentActivationDate.Location = new System.Drawing.Point(141, 90);
this.lCurrentActivationDate.Name = "lCurrentActivationDate";
this.lCurrentActivationDate.Size = new System.Drawing.Size(179, 13);
this.lCurrentActivationDate.TabIndex = 89;
this.lCurrentActivationDate.Text = "date";
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(12, 71);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(60, 13);
this.label16.TabIndex = 86;
this.label16.Text = "Order date:";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(12, 90);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(117, 13);
this.label7.TabIndex = 87;
this.label7.Text = "Current activation date:";
//
// lCurrentPPVersion
//
this.lCurrentPPVersion.Location = new System.Drawing.Point(341, 43);
this.lCurrentPPVersion.Name = "lCurrentPPVersion";
this.lCurrentPPVersion.Size = new System.Drawing.Size(131, 13);
this.lCurrentPPVersion.TabIndex = 84;
this.lCurrentPPVersion.Text = "1.0";
//
// lCustomerEMail
//
this.lCustomerEMail.Location = new System.Drawing.Point(341, 26);
this.lCustomerEMail.Name = "lCustomerEMail";
this.lCustomerEMail.Size = new System.Drawing.Size(209, 13);
this.lCustomerEMail.TabIndex = 85;
this.lCustomerEMail.Text = "customer e-mail";
//
// lCustomerName
//
this.lCustomerName.Location = new System.Drawing.Point(341, 9);
this.lCustomerName.Name = "lCustomerName";
this.lCustomerName.Size = new System.Drawing.Size(209, 13);
this.lCustomerName.TabIndex = 83;
this.lCustomerName.Text = "customer name";
//
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(250, 43);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(84, 13);
this.label25.TabIndex = 81;
this.label25.Text = "Product version:";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(250, 26);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(84, 13);
this.label13.TabIndex = 82;
this.label13.Text = "Customer e-mail:";
//
// lIntelliProtectorVersion
//
this.lIntelliProtectorVersion.AutoSize = true;
this.lIntelliProtectorVersion.Location = new System.Drawing.Point(129, 485);
this.lIntelliProtectorVersion.Name = "lIntelliProtectorVersion";
this.lIntelliProtectorVersion.Size = new System.Drawing.Size(41, 13);
this.lIntelliProtectorVersion.TabIndex = 125;
this.lIntelliProtectorVersion.Text = "version";
//
// lSupportExpirationPPVersion
//
this.lSupportExpirationPPVersion.AutoSize = true;
this.lSupportExpirationPPVersion.Location = new System.Drawing.Point(481, 309);
this.lSupportExpirationPPVersion.Name = "lSupportExpirationPPVersion";
this.lSupportExpirationPPVersion.Size = new System.Drawing.Size(22, 13);
this.lSupportExpirationPPVersion.TabIndex = 111;
this.lSupportExpirationPPVersion.Text = "1.5";
//
// lSupportExpirationDaysLeft
//
this.lSupportExpirationDaysLeft.AutoSize = true;
this.lSupportExpirationDaysLeft.Location = new System.Drawing.Point(481, 344);
this.lSupportExpirationDaysLeft.Name = "lSupportExpirationDaysLeft";
this.lSupportExpirationDaysLeft.Size = new System.Drawing.Size(13, 13);
this.lSupportExpirationDaysLeft.TabIndex = 110;
this.lSupportExpirationDaysLeft.Text = "0";
//
// lLicenseExpirationDaysLeft
//
this.lLicenseExpirationDaysLeft.AutoSize = true;
this.lLicenseExpirationDaysLeft.Location = new System.Drawing.Point(157, 326);
this.lLicenseExpirationDaysLeft.Name = "lLicenseExpirationDaysLeft";
this.lLicenseExpirationDaysLeft.Size = new System.Drawing.Size(13, 13);
this.lLicenseExpirationDaysLeft.TabIndex = 109;
this.lLicenseExpirationDaysLeft.Text = "0";
//
// lSupportExpirationDate
//
this.lSupportExpirationDate.AutoSize = true;
this.lSupportExpirationDate.Location = new System.Drawing.Point(481, 292);
this.lSupportExpirationDate.Name = "lSupportExpirationDate";
this.lSupportExpirationDate.Size = new System.Drawing.Size(28, 13);
this.lSupportExpirationDate.TabIndex = 102;
this.lSupportExpirationDate.Text = "date";
//
// lLicenseExpirationDate
//
this.lLicenseExpirationDate.AutoSize = true;
this.lLicenseExpirationDate.Location = new System.Drawing.Point(157, 292);
this.lLicenseExpirationDate.Name = "lLicenseExpirationDate";
this.lLicenseExpirationDate.Size = new System.Drawing.Size(28, 13);
this.lLicenseExpirationDate.TabIndex = 104;
this.lLicenseExpirationDate.Text = "date";
//
// lSupportExpirationDaysTotal
//
this.lSupportExpirationDaysTotal.AutoSize = true;
this.lSupportExpirationDaysTotal.Location = new System.Drawing.Point(481, 327);
this.lSupportExpirationDaysTotal.Name = "lSupportExpirationDaysTotal";
this.lSupportExpirationDaysTotal.Size = new System.Drawing.Size(13, 13);
this.lSupportExpirationDaysTotal.TabIndex = 103;
this.lSupportExpirationDaysTotal.Text = "0";
//
// lLicenseExpirationDaysTotal
//
this.lLicenseExpirationDaysTotal.AutoSize = true;
this.lLicenseExpirationDaysTotal.Location = new System.Drawing.Point(157, 309);
this.lLicenseExpirationDaysTotal.Name = "lLicenseExpirationDaysTotal";
this.lLicenseExpirationDaysTotal.Size = new System.Drawing.Size(13, 13);
this.lLicenseExpirationDaysTotal.TabIndex = 105;
this.lLicenseExpirationDaysTotal.Text = "0";
//
// lBuyNowLink
//
this.lBuyNowLink.Location = new System.Drawing.Point(129, 368);
this.lBuyNowLink.Name = "lBuyNowLink";
this.lBuyNowLink.Size = new System.Drawing.Size(350, 13);
this.lBuyNowLink.TabIndex = 121;
this.lBuyNowLink.Text = "http://www.mysite.com/purchase1.html";
//
// lRenewLicenseLink
//
this.lRenewLicenseLink.Location = new System.Drawing.Point(129, 384);
this.lRenewLicenseLink.Name = "lRenewLicenseLink";
this.lRenewLicenseLink.Size = new System.Drawing.Size(350, 13);
this.lRenewLicenseLink.TabIndex = 123;
this.lRenewLicenseLink.Text = "http://www.mysite.com/purchase2.html";
//
// lLicenseCode
//
this.lLicenseCode.Location = new System.Drawing.Point(129, 400);
this.lLicenseCode.Name = "lLicenseCode";
this.lLicenseCode.Size = new System.Drawing.Size(301, 13);
this.lLicenseCode.TabIndex = 122;
this.lLicenseCode.Text = "license code";
//
// lLicenseType
//
this.lLicenseType.AutoSize = true;
this.lLicenseType.Location = new System.Drawing.Point(141, 43);
this.lLicenseType.Name = "lLicenseType";
this.lLicenseType.Size = new System.Drawing.Size(16, 13);
this.lLicenseType.TabIndex = 79;
this.lLicenseType.Text = "-1";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(250, 9);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(83, 13);
this.label9.TabIndex = 80;
this.label9.Text = "Customer name:";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(12, 485);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(114, 13);
this.label14.TabIndex = 124;
this.label14.Text = "IntelliProtector version:";
//
// label35
//
this.label35.AutoSize = true;
this.label35.Location = new System.Drawing.Point(336, 309);
this.label35.Name = "label35";
this.label35.Size = new System.Drawing.Size(132, 13);
this.label35.TabIndex = 108;
this.label35.Text = "Support expiration version:";
//
// label31
//
this.label31.AutoSize = true;
this.label31.Location = new System.Drawing.Point(336, 344);
this.label31.Name = "label31";
this.label31.Size = new System.Drawing.Size(137, 13);
this.label31.TabIndex = 107;
this.label31.Text = "Support expiration days left:";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(12, 326);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(137, 13);
this.label15.TabIndex = 106;
this.label15.Text = "License expiration days left:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(11, 454);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(79, 13);
this.label5.TabIndex = 112;
this.label5.Text = "Renewal code:";
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(12, 428);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(74, 13);
this.label19.TabIndex = 113;
this.label19.Text = "License code:";
//
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(336, 292);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(119, 13);
this.label24.TabIndex = 99;
this.label24.Text = "Support expiration date:";
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(12, 292);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(119, 13);
this.label18.TabIndex = 98;
this.label18.Text = "License expiration date:";
//
// label23
//
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(336, 327);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(143, 13);
this.label23.TabIndex = 101;
this.label23.Text = "Support expiration days total:";
//
// label39
//
this.label39.AutoSize = true;
this.label39.Location = new System.Drawing.Point(9, 368);
this.label39.Name = "label39";
this.label39.Size = new System.Drawing.Size(110, 13);
this.label39.TabIndex = 120;
this.label39.Text = "Purchase license link:";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(12, 309);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(143, 13);
this.label11.TabIndex = 100;
this.label11.Text = "License expiration days total:";
//
// label37
//
this.label37.AutoSize = true;
this.label37.Location = new System.Drawing.Point(9, 384);
this.label37.Name = "label37";
this.label37.Size = new System.Drawing.Size(114, 13);
this.label37.TabIndex = 118;
this.label37.Text = "Purchase renewal link:";
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(9, 400);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(74, 13);
this.label17.TabIndex = 119;
this.label17.Text = "License code:";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(12, 43);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(70, 13);
this.label8.TabIndex = 78;
this.label8.Text = "License type:";
//
// lIsProtected
//
this.lIsProtected.AutoSize = true;
this.lIsProtected.Location = new System.Drawing.Point(141, 9);
this.lIsProtected.Name = "lIsProtected";
this.lIsProtected.Size = new System.Drawing.Size(19, 13);
this.lIsProtected.TabIndex = 75;
this.lIsProtected.Text = "no";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 9);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(100, 13);
this.label3.TabIndex = 74;
this.label3.Text = "Software protected:";
//
// lTrialTimeUnitsLeft
//
this.lTrialTimeUnitsLeft.AutoSize = true;
this.lTrialTimeUnitsLeft.Location = new System.Drawing.Point(119, 211);
this.lTrialTimeUnitsLeft.Name = "lTrialTimeUnitsLeft";
this.lTrialTimeUnitsLeft.Size = new System.Drawing.Size(208, 13);
this.lTrialTimeUnitsLeft.TabIndex = 97;
this.lTrialTimeUnitsLeft.Text = "* mins | * hours | * days | * weeks | * months";
//
// lTrialTimeUnitsTotal
//
this.lTrialTimeUnitsTotal.AutoSize = true;
this.lTrialTimeUnitsTotal.Location = new System.Drawing.Point(119, 175);
this.lTrialTimeUnitsTotal.Name = "lTrialTimeUnitsTotal";
this.lTrialTimeUnitsTotal.Size = new System.Drawing.Size(208, 13);
this.lTrialTimeUnitsTotal.TabIndex = 95;
this.lTrialTimeUnitsTotal.Text = "* mins | * hours | * days | * weeks | * months";
//
// lIsRegistered
//
this.lIsRegistered.AutoSize = true;
this.lIsRegistered.Location = new System.Drawing.Point(141, 26);
this.lIsRegistered.Name = "lIsRegistered";
this.lIsRegistered.Size = new System.Drawing.Size(19, 13);
this.lIsRegistered.TabIndex = 77;
this.lIsRegistered.Text = "no";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(12, 211);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(94, 13);
this.label6.TabIndex = 96;
this.label6.Text = "Trial time units left:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 175);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(100, 13);
this.label4.TabIndex = 94;
this.label4.Text = "Trial time units total:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 26);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(101, 13);
this.label2.TabIndex = 76;
this.label2.Text = "Software registered:";
//
// btnRegistrationByEmail
//
this.btnRegistrationByEmail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRegistrationByEmail.Location = new System.Drawing.Point(547, 148);
this.btnRegistrationByEmail.Name = "btnRegistrationByEmail";
this.btnRegistrationByEmail.Size = new System.Drawing.Size(153, 23);
this.btnRegistrationByEmail.TabIndex = 136;
this.btnRegistrationByEmail.Text = "Registration By Email";
this.btnRegistrationByEmail.UseVisualStyleBackColor = true;
this.btnRegistrationByEmail.Click += new System.EventHandler(this.btnRegistrationByEmail_Click);
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(711, 535);
this.Controls.Add(this.btnRegistrationByEmail);
this.Controls.Add(this.lProtectionDate);
this.Controls.Add(this.label26);
this.Controls.Add(this.lLaunchesLeft);
this.Controls.Add(this.lLaunchesTotal);
this.Controls.Add(this.lTrialDaysLeft);
this.Controls.Add(this.lTrialDaysTotal);
this.Controls.Add(this.label29);
this.Controls.Add(this.label27);
this.Controls.Add(this.label21);
this.Controls.Add(this.label20);
this.Controls.Add(this.btnRenew);
this.Controls.Add(this.btnRegister);
this.Controls.Add(this.tbRenewalCode);
this.Controls.Add(this.tbLicenseCode);
this.Controls.Add(this.lCurrentRegistrationDate);
this.Controls.Add(this.label12);
this.Controls.Add(this.lFirstRegistrationDate);
this.Controls.Add(this.label10);
this.Controls.Add(this.lOrderDate);
this.Controls.Add(this.lCurrentActivationDate);
this.Controls.Add(this.label16);
this.Controls.Add(this.label7);
this.Controls.Add(this.lCurrentPPVersion);
this.Controls.Add(this.lCustomerEMail);
this.Controls.Add(this.lCustomerName);
this.Controls.Add(this.label25);
this.Controls.Add(this.label13);
this.Controls.Add(this.lIntelliProtectorVersion);
this.Controls.Add(this.lSupportExpirationPPVersion);
this.Controls.Add(this.lSupportExpirationDaysLeft);
this.Controls.Add(this.lLicenseExpirationDaysLeft);
this.Controls.Add(this.lSupportExpirationDate);
this.Controls.Add(this.lLicenseExpirationDate);
this.Controls.Add(this.lSupportExpirationDaysTotal);
this.Controls.Add(this.lLicenseExpirationDaysTotal);
this.Controls.Add(this.lBuyNowLink);
this.Controls.Add(this.lRenewLicenseLink);
this.Controls.Add(this.lLicenseCode);
this.Controls.Add(this.lLicenseType);
this.Controls.Add(this.label9);
this.Controls.Add(this.label14);
this.Controls.Add(this.label35);
this.Controls.Add(this.label31);
this.Controls.Add(this.label15);
this.Controls.Add(this.label5);
this.Controls.Add(this.label19);
this.Controls.Add(this.label24);
this.Controls.Add(this.label18);
this.Controls.Add(this.label23);
this.Controls.Add(this.label39);
this.Controls.Add(this.label11);
this.Controls.Add(this.label37);
this.Controls.Add(this.label17);
this.Controls.Add(this.label8);
this.Controls.Add(this.lIsProtected);
this.Controls.Add(this.label3);
this.Controls.Add(this.lTrialTimeUnitsLeft);
this.Controls.Add(this.lTrialTimeUnitsTotal);
this.Controls.Add(this.lIsRegistered);
this.Controls.Add(this.label6);
this.Controls.Add(this.label4);
this.Controls.Add(this.label2);
this.Controls.Add(this.btnSortArray);
this.Controls.Add(this.btnShowRegistation);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.label1);
this.Name = "FormMain";
this.Text = "FormMain. Sample .NET";
this.Load += new System.EventHandler(this.FormMain_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Timer timerUpdateUnits;
private System.Windows.Forms.Button btnSortArray;
private System.Windows.Forms.Button btnShowRegistation;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Label lProtectionDate;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.Label lLaunchesLeft;
private System.Windows.Forms.Label lLaunchesTotal;
private System.Windows.Forms.Label lTrialDaysLeft;
private System.Windows.Forms.Label lTrialDaysTotal;
private System.Windows.Forms.Label label29;
private System.Windows.Forms.Label label27;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Button btnRenew;
private System.Windows.Forms.Button btnRegister;
private System.Windows.Forms.TextBox tbRenewalCode;
private System.Windows.Forms.TextBox tbLicenseCode;
private System.Windows.Forms.Label lCurrentRegistrationDate;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label lFirstRegistrationDate;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label lOrderDate;
private System.Windows.Forms.Label lCurrentActivationDate;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label lCurrentPPVersion;
private System.Windows.Forms.Label lCustomerEMail;
private System.Windows.Forms.Label lCustomerName;
private System.Windows.Forms.Label label25;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label lIntelliProtectorVersion;
private System.Windows.Forms.Label lSupportExpirationPPVersion;
private System.Windows.Forms.Label lSupportExpirationDaysLeft;
private System.Windows.Forms.Label lLicenseExpirationDaysLeft;
private System.Windows.Forms.Label lSupportExpirationDate;
private System.Windows.Forms.Label lLicenseExpirationDate;
private System.Windows.Forms.Label lSupportExpirationDaysTotal;
private System.Windows.Forms.Label lLicenseExpirationDaysTotal;
private System.Windows.Forms.Label lBuyNowLink;
private System.Windows.Forms.Label lRenewLicenseLink;
private System.Windows.Forms.Label lLicenseCode;
private System.Windows.Forms.Label lLicenseType;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label35;
private System.Windows.Forms.Label label31;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label39;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label37;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label lIsProtected;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lTrialTimeUnitsLeft;
private System.Windows.Forms.Label lTrialTimeUnitsTotal;
private System.Windows.Forms.Label lIsRegistered;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnRegistrationByEmail;
}
}

View File

@@ -0,0 +1,202 @@
using System;
using System.Text;
using System.Windows.Forms;
using IntelliProtectorService;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// == How to test this example ==
// 1. Build C# project (VS2005SampleNET)
// 2. Protect the VS2005SampleNET.exe with IntelliProtector
// 3. Start VS2005SampleNET.exe
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace VS2005SampleNET
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
}
private void btnOk_Click(object sender, EventArgs e)
{
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
Close();
}
private void btnSortArray_Click(object sender, EventArgs e)
{
try
{
SortArray();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
[IntelliProtectorService.attributes.Encrypt]
private void SortArray()
{
int[] array = new int[] { 10, 2, 3, 101, 3, 33, 7, 1 };
Array.Sort(array);
MessageBox.Show("Array is sorted");
}
private void FormMain_Load(object sender, EventArgs e)
{
try
{
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void UpdateControls()
{
lIsProtected.Text = IntelliProtector.IsSoftwareProtected() ? "yes" : "no";
lIsRegistered.Text = IntelliProtector.IsSoftwareRegistered() ? "yes" : "no";
lTrialTimeUnitsTotal.Text = string.Format("{0} mins | {1} hours | {2} days | {3} weeks | {4} months"
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudMinutes)
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudHours)
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudDays)
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudWeeks)
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudMonths)
);
lLicenseType.Text = IntelliProtector.GetLicenseType().ToString();
int iDays = IntelliProtector.GetTrialDaysCount();
lTrialDaysTotal.Text = iDays.ToString();
iDays = IntelliProtector.GetTrialDaysLeftCount();
lTrialDaysLeft.Text = iDays.ToString();
iDays = IntelliProtector.GetLicenseExpirationDaysCount();
lLicenseExpirationDaysTotal.Text = iDays.ToString();
iDays = IntelliProtector.GetLicenseExpirationDaysLeftCount();
lLicenseExpirationDaysLeft.Text = iDays.ToString();
timerUpdateUnits_Tick(null, null);
lLaunchesTotal.Text = IntelliProtector.GetTrialLaunchesCount().ToString();
lLaunchesLeft.Text = IntelliProtector.GetTrialLaunchesLeftCount().ToString();
const int ciMaxBufferLen = 256;
StringBuilder stbBuffer = new StringBuilder(ciMaxBufferLen);
lBuyNowLink.Text = IntelliProtector.GetBuyNowLink();
lRenewLicenseLink.Text = IntelliProtector.GetRenewalPurchaseLink();
lCurrentPPVersion.Text = IntelliProtector.GetCurrentProductVersion();
lSupportExpirationPPVersion.Text = IntelliProtector.GetSupportExpirationProductVersion();
lLicenseCode.Text = IntelliProtector.GetLicenseCode();
lCustomerName.Text = IntelliProtector.GetCustomerName();
lCustomerEMail.Text = IntelliProtector.GetCustomerEMail();
lLicenseExpirationDaysTotal.Text = IntelliProtector.GetLicenseExpirationDaysCount().ToString();
lLicenseExpirationDaysLeft.Text = IntelliProtector.GetLicenseExpirationDaysLeftCount().ToString();
lSupportExpirationDaysTotal.Text = IntelliProtector.GetSupportExpirationDaysCount().ToString();
lSupportExpirationDaysLeft.Text = IntelliProtector.GetSupportExpirationDaysLeftCount().ToString();
DateTime dtOrder = IntelliProtector.GetOrderDate();
ShowDate(lOrderDate, dtOrder);
DateTime dtCurrentActivationDate = IntelliProtector.GetCurrentActivationDate();
ShowDate(lCurrentActivationDate, dtCurrentActivationDate);
DateTime dtFirstRegistrationDate = IntelliProtector.GetFirstRegistrationDate();
ShowDate(lFirstRegistrationDate, dtFirstRegistrationDate);
DateTime dtCurrentRegistrationDate = IntelliProtector.GetCurrentRegistrationDate();
ShowDate(lCurrentRegistrationDate, dtCurrentRegistrationDate);
DateTime dtProtectionDate = IntelliProtector.GetProtectionDate();
ShowDate(lProtectionDate, dtProtectionDate);
DateTime dtLicenseExpirationDate = IntelliProtector.GetLicenseExpirationDate();
ShowDate(lLicenseExpirationDate, dtLicenseExpirationDate);
DateTime dtSupportExpirationDate = IntelliProtector.GetSupportExpirationDate();
ShowDate(lSupportExpirationDate, dtSupportExpirationDate);
lIntelliProtectorVersion.Text = IntelliProtector.GetIntelliProtectorVersion();
}
private static void ShowDate(Control label, DateTime dt)
{
label.Text = (dt != DateTime.MinValue) ? string.Format("{0}.{1}.{2} {3}:{4}", dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute) : "Not applicable";
}
private void timerUpdateUnits_Tick(object sender, EventArgs e)
{
lTrialTimeUnitsLeft.Text = string.Format("{0} mins | {1} hours | {2} days | {3} weeks | {4} months"
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudMinutes)
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudHours)
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudDays)
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudWeeks)
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudMonths)
);
}
private void btnShowRegistation_Click(object sender, EventArgs e)
{
try
{
IntelliProtector.ShowRegistrationWindow();
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void btnRegister_Click(object sender, EventArgs e)
{
try
{
IntelliProtector.RegisterSoftware(tbLicenseCode.Text);
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void btnRenew_Click(object sender, EventArgs e)
{
try
{
IntelliProtector.RenewLicenseCode(tbRenewalCode.Text);
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void btnRegistrationByEmail_Click(object sender, EventArgs e)
{
using(FormRegistrationByEmail regByEmail = new FormRegistrationByEmail("VS2005 CS sample.dat"))
regByEmail.ShowDialog();
UpdateControls();
}
}
}

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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timerUpdateUnits.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,141 @@
namespace VS2005SampleNET
{
partial class FormRegistrationByEmail
{
/// <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.label1 = new System.Windows.Forms.Label();
this.tbLicenseCode = new System.Windows.Forms.TextBox();
this.btnSaveCertificate = new System.Windows.Forms.Button();
this.btnUseCertificate = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnClose = new System.Windows.Forms.Button();
this.lRegistrationStatus = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(74, 13);
this.label1.TabIndex = 0;
this.label1.Text = "License code:";
//
// tbLicenseCode
//
this.tbLicenseCode.Location = new System.Drawing.Point(92, 6);
this.tbLicenseCode.Name = "tbLicenseCode";
this.tbLicenseCode.Size = new System.Drawing.Size(347, 20);
this.tbLicenseCode.TabIndex = 1;
//
// btnSaveCertificate
//
this.btnSaveCertificate.Location = new System.Drawing.Point(127, 47);
this.btnSaveCertificate.Name = "btnSaveCertificate";
this.btnSaveCertificate.Size = new System.Drawing.Size(197, 23);
this.btnSaveCertificate.TabIndex = 2;
this.btnSaveCertificate.Text = "1. Save request certificate";
this.btnSaveCertificate.UseVisualStyleBackColor = true;
this.btnSaveCertificate.Click += new System.EventHandler(this.btnSaveCertificate_Click);
//
// btnUseCertificate
//
this.btnUseCertificate.Location = new System.Drawing.Point(127, 76);
this.btnUseCertificate.Name = "btnUseCertificate";
this.btnUseCertificate.Size = new System.Drawing.Size(197, 23);
this.btnUseCertificate.TabIndex = 2;
this.btnUseCertificate.Text = "2. Use response certificate";
this.btnUseCertificate.UseVisualStyleBackColor = true;
this.btnUseCertificate.Click += new System.EventHandler(this.btnUseCertificate_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.lRegistrationStatus);
this.groupBox1.Location = new System.Drawing.Point(12, 121);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(427, 73);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Registration status";
//
// btnClose
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnClose.Location = new System.Drawing.Point(181, 219);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(89, 23);
this.btnClose.TabIndex = 4;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// lRegistrationStatus
//
this.lRegistrationStatus.Location = new System.Drawing.Point(130, 27);
this.lRegistrationStatus.Name = "lRegistrationStatus";
this.lRegistrationStatus.Size = new System.Drawing.Size(166, 25);
this.lRegistrationStatus.TabIndex = 0;
this.lRegistrationStatus.Text = "status";
this.lRegistrationStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// FormRegistrationByEmail
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(451, 254);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnUseCertificate);
this.Controls.Add(this.btnSaveCertificate);
this.Controls.Add(this.tbLicenseCode);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormRegistrationByEmail";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Registration by e-mail";
this.Load += new System.EventHandler(this.FormRegistrationByEmail_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tbLicenseCode;
private System.Windows.Forms.Button btnSaveCertificate;
private System.Windows.Forms.Button btnUseCertificate;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label lRegistrationStatus;
private System.Windows.Forms.Button btnClose;
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Windows.Forms;
using IntelliProtectorService;
namespace VS2005SampleNET
{
public partial class FormRegistrationByEmail : Form
{
private readonly string _certificateName;
public FormRegistrationByEmail(string certificateName)
{
_certificateName = certificateName;
InitializeComponent();
}
private void btnSaveCertificate_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(tbLicenseCode.Text))
{
MessageBox.Show(@"Please specify the license code", @"License is empty");
return;
}
using(SaveFileDialog saveFileDialog = new SaveFileDialog())
{
saveFileDialog.FileName = _certificateName;
saveFileDialog.OverwritePrompt = true;
saveFileDialog.InitialDirectory = Application.StartupPath;
saveFileDialog.Filter = @"Data Files (*.dat)|*.dat|All Files (*.*)|*.*";
if (saveFileDialog.ShowDialog() != DialogResult.OK)
return;
bool result = IntelliProtector.CreateRegistrationRequestCertificate(saveFileDialog.FileName, tbLicenseCode.Text);
if (result == false)
MessageBox.Show(@"Error, certificate is not saved!");
}
}
private void btnUseCertificate_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.InitialDirectory = Application.StartupPath;
openFileDialog.Filter = @"Data Files (*.dat)|*.dat|All Files (*.*)|*.*";
if (openFileDialog.ShowDialog() != DialogResult.OK)
return;
bool result = IntelliProtector.UseRegistrationResponseCertificate(openFileDialog.FileName);
if (result == false)
MessageBox.Show(@"Error, certificate is not used!");
}
UpdateRegistrationStatus();
}
void UpdateRegistrationStatus()
{
lRegistrationStatus.Text = IntelliProtector.IsSoftwareRegistered() ? @"registered" : @"not registered";
}
private void btnClose_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void FormRegistrationByEmail_Load(object sender, EventArgs e)
{
UpdateRegistrationStatus();
}
}
}

View File

@@ -0,0 +1,930 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2010. IntelliProtector.com
// Web site: http://intelliprotector.com
// Version: v2.5
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace netprotector.api
{
internal delegate void dVoid_NoParams();
internal delegate void dVoid_BoolParam(out bool b1);
internal delegate void dVoid_IntParam(out int i1);
internal delegate void dVoid_2IntParam(out int i1, int i2);
internal delegate void dVoid_5IntParams(out int i1, out int i2, out int i3, out int i4, out int i5);
internal delegate void dVoid_StringBuilderParam([MarshalAs(UnmanagedType.LPWStr)] StringBuilder s1, int iMaxLength);
internal delegate void dBool_StringParam(out bool res, [MarshalAs(UnmanagedType.LPWStr)]String s1, int iMaxLength);
internal delegate void dBool_StringOnlyParam(out bool res, [MarshalAs(UnmanagedType.LPWStr)]String s1);
internal delegate void dBool_StringStringParam(out bool res, [MarshalAs(UnmanagedType.LPWStr)]String s1, [MarshalAs(UnmanagedType.LPWStr)]String s2);
}
namespace IntelliProtectorService.attributes
{
internal class Encrypt : Attribute { }
internal class GetBuyNowLinkAttribute : Attribute { }
internal class IsSoftwareProtectedAttribute : Attribute { }
internal class IsSoftwareRegisteredAttribute : Attribute { }
internal class GetTrialDaysCountAttribute : Attribute { }
internal class GetTrialUnitsCountAttribute : Attribute { }
internal class GetTrialDaysLeftCountAttribute : Attribute { }
internal class GetTrialUnitsLeftCountAttribute : Attribute { }
internal class GetTrialLaunchesCountAttribute : Attribute { }
internal class GetTrialLaunchesLeftCountAttribute : Attribute { }
internal class ShowRegistrationWindowAttribute : Attribute { }
internal class IsTrialElapsedAttribute : Attribute { }
internal class GetRenewalPurchaseLinkAttribute : Attribute { }
internal class GetLicenseTypeAttribute : Attribute { }
internal class GetLicenseExpirationDaysCountAttribute : Attribute { }
internal class GetLicenseExpirationDaysLeftCountAttribute : Attribute { }
internal class GetSupportExpirationDaysCountAttribute : Attribute { }
internal class GetSupportExpirationDaysLeftCountAttribute : Attribute { }
internal class GetCurrentProductVersionAttribute : Attribute { }
internal class GetCustomerNameAttribute : Attribute { }
internal class GetCustomerEMailAttribute : Attribute { }
internal class GetLicenseCodeAttribute : Attribute { }
internal class RegisterSoftwareAttribute : Attribute { }
internal class RenewLicenseCodeAttribute : Attribute { }
internal class GetCurrentActivationDateAttribute : Attribute { }
internal class GetCurrentRegistrationDateAttribute : Attribute { }
internal class GetFirstRegistrationDateAttribute : Attribute { }
internal class GetOrderDateAttribute : Attribute { }
internal class GetLicenseExpirationDateAttribute : Attribute { }
internal class GetProtectionDateAttribute : Attribute { }
internal class GetSupportExpirationDateAttribute : Attribute { }
internal class GetSupportExpirationProductVersionAttribute : Attribute { }
internal class GetIntelliProtectorVersionAttribute : Attribute { }
internal class CreateRegistrationRequestCertificateAttribute : Attribute { }
internal class UseRegistrationResponseCertificateAttribute : Attribute { }
internal class SystemFunction1Attribute : Attribute { }
}
namespace IntelliProtectorService
{
internal class IntelliProtector
{
public static double Version_2_5()
{
return 2.5f;
}
#if DEBUG
public static bool IsInDebugMode()
{
return true;
}
#endif
public enum enUnitDimension
{
eudMinutes,
eudHours,
eudDays,
eudWeeks,
eudMonths
};
private class Init32
{
[DllImport("JitHookCore.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Init")]
public static extern void Init();
};
private class Init64
{
[DllImport("JitHookCoreX64.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Init")]
public static extern void Init();
};
public static bool Init()
{
try
{
bool tryLoadX64 = false;
try
{
Init32.Init();
}
catch (BadImageFormatException)
{
tryLoadX64 = true;
}
if (tryLoadX64)
{
try
{
Init64.Init();
}
catch (BadImageFormatException)
{
return false;
}
}
return true;
}
catch (System.Exception)
{
return true;
}
}
#region GetBuyNowLink
[attributes.GetBuyNowLinkAttribute]
public static String GetBuyNowLink()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetBuyNowLinkTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetBuyNowLinkTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region IsSoftwareProtected
[attributes.IsSoftwareProtected]
public static bool IsSoftwareProtected()
{
UInt64 address = 0;
object[] obj = new object[] { false };
Type tp = typeof(netprotector.api.dVoid_BoolParam);
IsSoftwareProtectedTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void IsSoftwareProtectedTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(bool))
return;
obj[0] = false;
}
#endregion
#region IsSoftwareRegistered
[attributes.IsSoftwareRegistered]
public static bool IsSoftwareRegistered()
{
UInt64 address = 0;
object[] obj = new object[] { false };
Type tp = typeof(netprotector.api.dVoid_BoolParam);
IsSoftwareRegisteredTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void IsSoftwareRegisteredTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(bool))
return;
obj[0] = false;
}
#endregion
#region GetTrialDaysCount
[attributes.GetTrialDaysCount]
public static int GetTrialDaysCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialDaysCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
protected static void GetTrialDaysCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialUnitsCount
[attributes.GetTrialUnitsCount]
public static int GetTrialUnitsCount(int dimensions)
{
UInt64 address = 0;
object[] obj = new object[] { (int)0, dimensions };
Type tp = typeof(netprotector.api.dVoid_2IntParam);
GetTrialUnitsCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialUnitsCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) && obj[1].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialDaysLeftCount
[attributes.GetTrialDaysLeftCount]
public static int GetTrialDaysLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialDaysLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialDaysLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialUnitsLeftCount
[attributes.GetTrialUnitsLeftCount]
public static int GetTrialUnitsLeftCount(int dimension)
{
UInt64 address = 0;
object[] obj = new object[] { (int)0, dimension };
Type tp = typeof(netprotector.api.dVoid_2IntParam);
GetTrialUnitsLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialUnitsLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) && obj[1].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialLaunchesCount
[attributes.GetTrialLaunchesCount]
public static int GetTrialLaunchesCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialLaunchesCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialLaunchesCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialLaunchesLeftCount
[attributes.GetTrialLaunchesLeftCount]
public static int GetTrialLaunchesLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialLaunchesLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialLaunchesLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region ShowRegistrationWindow
[attributes.ShowRegistrationWindow]
public static void ShowRegistrationWindow()
{
UInt64 address = 0;
Type tp = typeof(netprotector.api.dVoid_NoParams);
ShowRegistrationWindowTest(address, null, tp);
}
[attributes.Encrypt]
public static void ShowRegistrationWindowTest(UInt64 address, object[] obj, Type delegateType)
{
}
#endregion
#region IsTrialElapsed
[attributes.IsTrialElapsed]
public static bool IsTrialElapsed()
{
UInt64 address = 0;
object[] obj = new object[] { false };
Type tp = typeof(netprotector.api.dVoid_BoolParam);
IsTrialElapsedTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void IsTrialElapsedTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(bool))
return;
obj[0] = false;
}
#endregion
#region GetRenewalPurchaseLink
[attributes.GetRenewalPurchaseLink]
public static String GetRenewalPurchaseLink()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetRenewalPurchaseLinkTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetRenewalPurchaseLinkTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetLicenseType
[attributes.GetLicenseType]
public static int GetLicenseType()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetLicenseTypeTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetLicenseTypeTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetLicenseExpirationDaysCount
[attributes.GetLicenseExpirationDaysCount]
public static int GetLicenseExpirationDaysCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetLicenseExpirationDaysCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetLicenseExpirationDaysCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetLicenseExpirationDaysLeftCount
[attributes.GetLicenseExpirationDaysLeftCount]
public static int GetLicenseExpirationDaysLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetLicenseExpirationDaysLeftTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetLicenseExpirationDaysLeftTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetSupportExpirationDaysCount
[attributes.GetSupportExpirationDaysCount]
public static int GetSupportExpirationDaysCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetSupportExpirationDaysCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetSupportExpirationDaysCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetSupportExpirationDaysLeftCount
[attributes.GetSupportExpirationDaysLeftCount]
public static int GetSupportExpirationDaysLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetSupportExpirationDaysLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetSupportExpirationDaysLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetCurrentProductVersion
[attributes.GetCurrentProductVersion]
public static String GetCurrentProductVersion()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetCurrentProductVersionTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetCurrentProductVersionTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetCustomerName
[attributes.GetCustomerName]
public static String GetCustomerName()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetCustomerNameTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetCustomerNameTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetCustomerEMail
[attributes.GetCustomerEMail]
public static String GetCustomerEMail()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetCustomerEMailTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetCustomerEMailTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetLicenseCode
[attributes.GetLicenseCode]
public static String GetLicenseCode()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetLicenseCodeTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetLicenseCodeTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region RegisterSoftware
[attributes.RegisterSoftware]
public static bool RegisterSoftware(string licenseKey)
{
UInt64 address = 0;
bool res = false;
object[] obj = new object[] { res, licenseKey, licenseKey.Length };
Type tp = typeof(netprotector.api.dBool_StringParam);
RegisterSoftwareTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void RegisterSoftwareTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = false;
}
#endregion
#region RenewLicenseCode
[attributes.RenewLicenseCode]
public static bool RenewLicenseCode(string renewalCode)
{
UInt64 address = 0;
object[] obj = new object[] { false, renewalCode, renewalCode.Length };
Type tp = typeof(netprotector.api.dBool_StringParam);
RenewLicenseCodeTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void RenewLicenseCodeTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = false;
}
#endregion
#region GetCurrentActivationDate
[attributes.GetCurrentActivationDate]
public static DateTime GetCurrentActivationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetCurrentActivationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetCurrentActivationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetCurrentRegistrationDate
[attributes.GetCurrentRegistrationDate]
public static DateTime GetCurrentRegistrationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetCurrentRegistrationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetCurrentRegistrationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetFirstRegistrationDate
[attributes.GetFirstRegistrationDate]
public static DateTime GetFirstRegistrationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetFirstRegistrationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetFirstRegistrationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetOrderDate
[attributes.GetOrderDate]
public static DateTime GetOrderDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetOrderDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetOrderDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetLicenseExpirationDate
[attributes.GetLicenseExpirationDate]
public static DateTime GetLicenseExpirationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetLicenseExpirationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetLicenseExpirationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetProtectionDate
[attributes.GetProtectionDate]
public static DateTime GetProtectionDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetProtectionDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetProtectionDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetSupportExpirationDate
[attributes.GetSupportExpirationDate]
public static DateTime GetSupportExpirationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetSupportExpirationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetSupportExpirationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetSupportExpirationProductVersion
[attributes.GetSupportExpirationProductVersion]
public static String GetSupportExpirationProductVersion()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetSupportExpirationProductVersionTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetSupportExpirationProductVersionTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetIntelliProtectorVersion
[attributes.GetIntelliProtectorVersion]
public static String GetIntelliProtectorVersion()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetIntelliProtectorVersionTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetIntelliProtectorVersionTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region CreateRegistrationRequestCertificate
[attributes.CreateRegistrationRequestCertificate]
public static bool CreateRegistrationRequestCertificate(string path, string licenseCode)
{
UInt64 address = 0;
bool res = false;
object[] obj = new object[] { res, path, licenseCode };
Type tp = typeof(netprotector.api.dBool_StringStringParam);
CreateRegistrationRequestCertificateTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void CreateRegistrationRequestCertificateTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = true;
}
#endregion
#region UseRegistrationResponseCertificate
[attributes.UseRegistrationResponseCertificate]
public static bool UseRegistrationResponseCertificate(string path)
{
UInt64 address = 0;
bool res = false;
object[] obj = new object[] { res, path };
Type tp = typeof(netprotector.api.dBool_StringOnlyParam);
UseRegistrationResponseCertificateTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void UseRegistrationResponseCertificateTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = true;
}
#endregion
#region SystemFunction1
[attributes.SystemFunction1]
protected static void SystemFunction1(UInt64 address, object[] parameters, Type delegateType)
{
Delegate delegateFunc = Marshal.GetDelegateForFunctionPointer((IntPtr)address, delegateType);
delegateFunc.DynamicInvoke(parameters);
}
#endregion
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Windows.Forms;
using IntelliProtectorService;
namespace VS2005SampleNET
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
if (!IntelliProtector.Init())
{
MessageBox.Show("Cannot load protector module");
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormMain());
}
}
}

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VS2005SampleNET")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("IntelliProtector.com")]
[assembly: AssemblyProduct("VS2005SampleNET")]
[assembly: AssemblyCopyright("Copyright © 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("91fab80e-617f-4ec4-9780-23a809cce5b8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.5.0.0")]
[assembly: AssemblyFileVersion("2.5.0.0")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VS2005SampleNET.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VS2005SampleNET.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VS2005SampleNET.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,103 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VS2005SampleNET</RootNamespace>
<AssemblyName>VS2005SampleNET</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FormMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormMain.Designer.cs">
<DependentUpon>FormMain.cs</DependentUpon>
</Compile>
<Compile Include="FormRegistrationByEmail.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormRegistrationByEmail.Designer.cs">
<DependentUpon>FormRegistrationByEmail.cs</DependentUpon>
</Compile>
<Compile Include="IntelliProtector.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FormMain.resx">
<SubType>Designer</SubType>
<DependentUpon>FormMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,26 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS2005SampleNET", "VS2005SampleNET.csproj", "{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Debug|x86.ActiveCfg = Debug|x86
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Debug|x86.Build.0 = Debug|x86
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Release|Any CPU.Build.0 = Release|Any CPU
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Release|x86.ActiveCfg = Release|x86
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,873 @@
namespace VS2005SampleNET
{
partial class FormMain
{
/// <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.components = new System.ComponentModel.Container();
this.label1 = new System.Windows.Forms.Label();
this.timerUpdateUnits = new System.Windows.Forms.Timer(this.components);
this.btnSortArray = new System.Windows.Forms.Button();
this.btnShowRegistation = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOk = new System.Windows.Forms.Button();
this.lProtectionDate = new System.Windows.Forms.Label();
this.label26 = new System.Windows.Forms.Label();
this.lLaunchesLeft = new System.Windows.Forms.Label();
this.lLaunchesTotal = new System.Windows.Forms.Label();
this.lTrialDaysLeft = new System.Windows.Forms.Label();
this.lTrialDaysTotal = new System.Windows.Forms.Label();
this.label29 = new System.Windows.Forms.Label();
this.label27 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.btnRenew = new System.Windows.Forms.Button();
this.btnRegister = new System.Windows.Forms.Button();
this.tbRenewalCode = new System.Windows.Forms.TextBox();
this.tbLicenseCode = new System.Windows.Forms.TextBox();
this.lCurrentRegistrationDate = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.lFirstRegistrationDate = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.lOrderDate = new System.Windows.Forms.Label();
this.lCurrentActivationDate = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.lCurrentPPVersion = new System.Windows.Forms.Label();
this.lCustomerEMail = new System.Windows.Forms.Label();
this.lCustomerName = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.lIntelliProtectorVersion = new System.Windows.Forms.Label();
this.lSupportExpirationPPVersion = new System.Windows.Forms.Label();
this.lSupportExpirationDaysLeft = new System.Windows.Forms.Label();
this.lLicenseExpirationDaysLeft = new System.Windows.Forms.Label();
this.lSupportExpirationDate = new System.Windows.Forms.Label();
this.lLicenseExpirationDate = new System.Windows.Forms.Label();
this.lSupportExpirationDaysTotal = new System.Windows.Forms.Label();
this.lLicenseExpirationDaysTotal = new System.Windows.Forms.Label();
this.lBuyNowLink = new System.Windows.Forms.Label();
this.lRenewLicenseLink = new System.Windows.Forms.Label();
this.lLicenseCode = new System.Windows.Forms.Label();
this.lLicenseType = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label35 = new System.Windows.Forms.Label();
this.label31 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.label39 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label37 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.lIsProtected = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.lTrialTimeUnitsLeft = new System.Windows.Forms.Label();
this.lTrialTimeUnitsTotal = new System.Windows.Forms.Label();
this.lIsRegistered = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.btnRegistrationByEmail = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(470, 513);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(229, 13);
this.label1.TabIndex = 5;
this.label1.Text = "IntelliProtector sample. Visual Studio 2005.NET";
//
// timerUpdateUnits
//
this.timerUpdateUnits.Enabled = true;
this.timerUpdateUnits.Interval = 30000;
this.timerUpdateUnits.Tick += new System.EventHandler(this.timerUpdateUnits_Tick);
//
// btnSortArray
//
this.btnSortArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSortArray.Location = new System.Drawing.Point(547, 119);
this.btnSortArray.Name = "btnSortArray";
this.btnSortArray.Size = new System.Drawing.Size(153, 23);
this.btnSortArray.TabIndex = 73;
this.btnSortArray.Text = "Sort array (encrypted call)";
this.btnSortArray.UseVisualStyleBackColor = true;
this.btnSortArray.Click += new System.EventHandler(this.btnSortArray_Click);
//
// btnShowRegistation
//
this.btnShowRegistation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnShowRegistation.Location = new System.Drawing.Point(547, 89);
this.btnShowRegistation.Name = "btnShowRegistation";
this.btnShowRegistation.Size = new System.Drawing.Size(153, 23);
this.btnShowRegistation.TabIndex = 72;
this.btnShowRegistation.Text = "Show Registration Window";
this.btnShowRegistation.UseVisualStyleBackColor = true;
this.btnShowRegistation.Click += new System.EventHandler(this.btnShowRegistation_Click);
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(624, 41);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 71;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOk
//
this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnOk.Location = new System.Drawing.Point(624, 12);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 70;
this.btnOk.Text = "Ok";
this.btnOk.UseVisualStyleBackColor = true;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// lProtectionDate
//
this.lProtectionDate.Location = new System.Drawing.Point(141, 146);
this.lProtectionDate.Name = "lProtectionDate";
this.lProtectionDate.Size = new System.Drawing.Size(179, 13);
this.lProtectionDate.TabIndex = 135;
this.lProtectionDate.Text = "date";
//
// label26
//
this.label26.AutoSize = true;
this.label26.Location = new System.Drawing.Point(12, 146);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(82, 13);
this.label26.TabIndex = 134;
this.label26.Text = "Protection date:";
//
// lLaunchesLeft
//
this.lLaunchesLeft.AutoSize = true;
this.lLaunchesLeft.Location = new System.Drawing.Point(119, 269);
this.lLaunchesLeft.Name = "lLaunchesLeft";
this.lLaunchesLeft.Size = new System.Drawing.Size(13, 13);
this.lLaunchesLeft.TabIndex = 131;
this.lLaunchesLeft.Text = "0";
//
// lLaunchesTotal
//
this.lLaunchesTotal.AutoSize = true;
this.lLaunchesTotal.Location = new System.Drawing.Point(119, 251);
this.lLaunchesTotal.Name = "lLaunchesTotal";
this.lLaunchesTotal.Size = new System.Drawing.Size(13, 13);
this.lLaunchesTotal.TabIndex = 130;
this.lLaunchesTotal.Text = "0";
//
// lTrialDaysLeft
//
this.lTrialDaysLeft.AutoSize = true;
this.lTrialDaysLeft.Location = new System.Drawing.Point(119, 227);
this.lTrialDaysLeft.Name = "lTrialDaysLeft";
this.lTrialDaysLeft.Size = new System.Drawing.Size(13, 13);
this.lTrialDaysLeft.TabIndex = 133;
this.lTrialDaysLeft.Text = "0";
//
// lTrialDaysTotal
//
this.lTrialDaysTotal.AutoSize = true;
this.lTrialDaysTotal.Location = new System.Drawing.Point(119, 191);
this.lTrialDaysTotal.Name = "lTrialDaysTotal";
this.lTrialDaysTotal.Size = new System.Drawing.Size(13, 13);
this.lTrialDaysTotal.TabIndex = 132;
this.lTrialDaysTotal.Text = "0";
//
// label29
//
this.label29.AutoSize = true;
this.label29.Location = new System.Drawing.Point(12, 269);
this.label29.Name = "label29";
this.label29.Size = new System.Drawing.Size(93, 13);
this.label29.TabIndex = 127;
this.label29.Text = "Trial launches left:";
//
// label27
//
this.label27.AutoSize = true;
this.label27.Location = new System.Drawing.Point(12, 251);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(99, 13);
this.label27.TabIndex = 126;
this.label27.Text = "Trial launches total:";
//
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(12, 227);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(72, 13);
this.label21.TabIndex = 129;
this.label21.Text = "Trial days left:";
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(12, 191);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(78, 13);
this.label20.TabIndex = 128;
this.label20.Text = "Trial days total:";
//
// btnRenew
//
this.btnRenew.Location = new System.Drawing.Point(416, 451);
this.btnRenew.Name = "btnRenew";
this.btnRenew.Size = new System.Drawing.Size(75, 23);
this.btnRenew.TabIndex = 117;
this.btnRenew.Text = "Renew";
this.btnRenew.UseVisualStyleBackColor = true;
this.btnRenew.Click += new System.EventHandler(this.btnRenew_Click);
//
// btnRegister
//
this.btnRegister.Location = new System.Drawing.Point(417, 425);
this.btnRegister.Name = "btnRegister";
this.btnRegister.Size = new System.Drawing.Size(75, 23);
this.btnRegister.TabIndex = 116;
this.btnRegister.Text = "Register";
this.btnRegister.UseVisualStyleBackColor = true;
//
// tbRenewalCode
//
this.tbRenewalCode.Location = new System.Drawing.Point(109, 451);
this.tbRenewalCode.Name = "tbRenewalCode";
this.tbRenewalCode.Size = new System.Drawing.Size(301, 20);
this.tbRenewalCode.TabIndex = 115;
//
// tbLicenseCode
//
this.tbLicenseCode.Location = new System.Drawing.Point(110, 425);
this.tbLicenseCode.Name = "tbLicenseCode";
this.tbLicenseCode.Size = new System.Drawing.Size(301, 20);
this.tbLicenseCode.TabIndex = 114;
//
// lCurrentRegistrationDate
//
this.lCurrentRegistrationDate.Location = new System.Drawing.Point(141, 128);
this.lCurrentRegistrationDate.Name = "lCurrentRegistrationDate";
this.lCurrentRegistrationDate.Size = new System.Drawing.Size(179, 13);
this.lCurrentRegistrationDate.TabIndex = 93;
this.lCurrentRegistrationDate.Text = "date";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(12, 128);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(122, 13);
this.label12.TabIndex = 92;
this.label12.Text = "Current registration date:";
//
// lFirstRegistrationDate
//
this.lFirstRegistrationDate.Location = new System.Drawing.Point(141, 109);
this.lFirstRegistrationDate.Name = "lFirstRegistrationDate";
this.lFirstRegistrationDate.Size = new System.Drawing.Size(179, 13);
this.lFirstRegistrationDate.TabIndex = 91;
this.lFirstRegistrationDate.Text = "date";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(12, 109);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(107, 13);
this.label10.TabIndex = 90;
this.label10.Text = "First registration date:";
//
// lOrderDate
//
this.lOrderDate.Location = new System.Drawing.Point(141, 71);
this.lOrderDate.Name = "lOrderDate";
this.lOrderDate.Size = new System.Drawing.Size(179, 13);
this.lOrderDate.TabIndex = 88;
this.lOrderDate.Text = "date";
//
// lCurrentActivationDate
//
this.lCurrentActivationDate.Location = new System.Drawing.Point(141, 90);
this.lCurrentActivationDate.Name = "lCurrentActivationDate";
this.lCurrentActivationDate.Size = new System.Drawing.Size(179, 13);
this.lCurrentActivationDate.TabIndex = 89;
this.lCurrentActivationDate.Text = "date";
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(12, 71);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(60, 13);
this.label16.TabIndex = 86;
this.label16.Text = "Order date:";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(12, 90);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(117, 13);
this.label7.TabIndex = 87;
this.label7.Text = "Current activation date:";
//
// lCurrentPPVersion
//
this.lCurrentPPVersion.Location = new System.Drawing.Point(341, 43);
this.lCurrentPPVersion.Name = "lCurrentPPVersion";
this.lCurrentPPVersion.Size = new System.Drawing.Size(131, 13);
this.lCurrentPPVersion.TabIndex = 84;
this.lCurrentPPVersion.Text = "1.0";
//
// lCustomerEMail
//
this.lCustomerEMail.Location = new System.Drawing.Point(341, 26);
this.lCustomerEMail.Name = "lCustomerEMail";
this.lCustomerEMail.Size = new System.Drawing.Size(209, 13);
this.lCustomerEMail.TabIndex = 85;
this.lCustomerEMail.Text = "customer e-mail";
//
// lCustomerName
//
this.lCustomerName.Location = new System.Drawing.Point(341, 9);
this.lCustomerName.Name = "lCustomerName";
this.lCustomerName.Size = new System.Drawing.Size(209, 13);
this.lCustomerName.TabIndex = 83;
this.lCustomerName.Text = "customer name";
//
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(250, 43);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(84, 13);
this.label25.TabIndex = 81;
this.label25.Text = "Product version:";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(250, 26);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(84, 13);
this.label13.TabIndex = 82;
this.label13.Text = "Customer e-mail:";
//
// lIntelliProtectorVersion
//
this.lIntelliProtectorVersion.AutoSize = true;
this.lIntelliProtectorVersion.Location = new System.Drawing.Point(129, 485);
this.lIntelliProtectorVersion.Name = "lIntelliProtectorVersion";
this.lIntelliProtectorVersion.Size = new System.Drawing.Size(41, 13);
this.lIntelliProtectorVersion.TabIndex = 125;
this.lIntelliProtectorVersion.Text = "version";
//
// lSupportExpirationPPVersion
//
this.lSupportExpirationPPVersion.AutoSize = true;
this.lSupportExpirationPPVersion.Location = new System.Drawing.Point(481, 309);
this.lSupportExpirationPPVersion.Name = "lSupportExpirationPPVersion";
this.lSupportExpirationPPVersion.Size = new System.Drawing.Size(22, 13);
this.lSupportExpirationPPVersion.TabIndex = 111;
this.lSupportExpirationPPVersion.Text = "1.5";
//
// lSupportExpirationDaysLeft
//
this.lSupportExpirationDaysLeft.AutoSize = true;
this.lSupportExpirationDaysLeft.Location = new System.Drawing.Point(481, 344);
this.lSupportExpirationDaysLeft.Name = "lSupportExpirationDaysLeft";
this.lSupportExpirationDaysLeft.Size = new System.Drawing.Size(13, 13);
this.lSupportExpirationDaysLeft.TabIndex = 110;
this.lSupportExpirationDaysLeft.Text = "0";
//
// lLicenseExpirationDaysLeft
//
this.lLicenseExpirationDaysLeft.AutoSize = true;
this.lLicenseExpirationDaysLeft.Location = new System.Drawing.Point(157, 326);
this.lLicenseExpirationDaysLeft.Name = "lLicenseExpirationDaysLeft";
this.lLicenseExpirationDaysLeft.Size = new System.Drawing.Size(13, 13);
this.lLicenseExpirationDaysLeft.TabIndex = 109;
this.lLicenseExpirationDaysLeft.Text = "0";
//
// lSupportExpirationDate
//
this.lSupportExpirationDate.AutoSize = true;
this.lSupportExpirationDate.Location = new System.Drawing.Point(481, 292);
this.lSupportExpirationDate.Name = "lSupportExpirationDate";
this.lSupportExpirationDate.Size = new System.Drawing.Size(28, 13);
this.lSupportExpirationDate.TabIndex = 102;
this.lSupportExpirationDate.Text = "date";
//
// lLicenseExpirationDate
//
this.lLicenseExpirationDate.AutoSize = true;
this.lLicenseExpirationDate.Location = new System.Drawing.Point(157, 292);
this.lLicenseExpirationDate.Name = "lLicenseExpirationDate";
this.lLicenseExpirationDate.Size = new System.Drawing.Size(28, 13);
this.lLicenseExpirationDate.TabIndex = 104;
this.lLicenseExpirationDate.Text = "date";
//
// lSupportExpirationDaysTotal
//
this.lSupportExpirationDaysTotal.AutoSize = true;
this.lSupportExpirationDaysTotal.Location = new System.Drawing.Point(481, 327);
this.lSupportExpirationDaysTotal.Name = "lSupportExpirationDaysTotal";
this.lSupportExpirationDaysTotal.Size = new System.Drawing.Size(13, 13);
this.lSupportExpirationDaysTotal.TabIndex = 103;
this.lSupportExpirationDaysTotal.Text = "0";
//
// lLicenseExpirationDaysTotal
//
this.lLicenseExpirationDaysTotal.AutoSize = true;
this.lLicenseExpirationDaysTotal.Location = new System.Drawing.Point(157, 309);
this.lLicenseExpirationDaysTotal.Name = "lLicenseExpirationDaysTotal";
this.lLicenseExpirationDaysTotal.Size = new System.Drawing.Size(13, 13);
this.lLicenseExpirationDaysTotal.TabIndex = 105;
this.lLicenseExpirationDaysTotal.Text = "0";
//
// lBuyNowLink
//
this.lBuyNowLink.Location = new System.Drawing.Point(129, 368);
this.lBuyNowLink.Name = "lBuyNowLink";
this.lBuyNowLink.Size = new System.Drawing.Size(350, 13);
this.lBuyNowLink.TabIndex = 121;
this.lBuyNowLink.Text = "http://www.mysite.com/purchase1.html";
//
// lRenewLicenseLink
//
this.lRenewLicenseLink.Location = new System.Drawing.Point(129, 384);
this.lRenewLicenseLink.Name = "lRenewLicenseLink";
this.lRenewLicenseLink.Size = new System.Drawing.Size(350, 13);
this.lRenewLicenseLink.TabIndex = 123;
this.lRenewLicenseLink.Text = "http://www.mysite.com/purchase2.html";
//
// lLicenseCode
//
this.lLicenseCode.Location = new System.Drawing.Point(129, 400);
this.lLicenseCode.Name = "lLicenseCode";
this.lLicenseCode.Size = new System.Drawing.Size(301, 13);
this.lLicenseCode.TabIndex = 122;
this.lLicenseCode.Text = "license code";
//
// lLicenseType
//
this.lLicenseType.AutoSize = true;
this.lLicenseType.Location = new System.Drawing.Point(141, 43);
this.lLicenseType.Name = "lLicenseType";
this.lLicenseType.Size = new System.Drawing.Size(16, 13);
this.lLicenseType.TabIndex = 79;
this.lLicenseType.Text = "-1";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(250, 9);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(83, 13);
this.label9.TabIndex = 80;
this.label9.Text = "Customer name:";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(12, 485);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(114, 13);
this.label14.TabIndex = 124;
this.label14.Text = "IntelliProtector version:";
//
// label35
//
this.label35.AutoSize = true;
this.label35.Location = new System.Drawing.Point(336, 309);
this.label35.Name = "label35";
this.label35.Size = new System.Drawing.Size(132, 13);
this.label35.TabIndex = 108;
this.label35.Text = "Support expiration version:";
//
// label31
//
this.label31.AutoSize = true;
this.label31.Location = new System.Drawing.Point(336, 344);
this.label31.Name = "label31";
this.label31.Size = new System.Drawing.Size(137, 13);
this.label31.TabIndex = 107;
this.label31.Text = "Support expiration days left:";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(12, 326);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(137, 13);
this.label15.TabIndex = 106;
this.label15.Text = "License expiration days left:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(11, 454);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(79, 13);
this.label5.TabIndex = 112;
this.label5.Text = "Renewal code:";
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(12, 428);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(74, 13);
this.label19.TabIndex = 113;
this.label19.Text = "License code:";
//
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(336, 292);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(119, 13);
this.label24.TabIndex = 99;
this.label24.Text = "Support expiration date:";
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(12, 292);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(119, 13);
this.label18.TabIndex = 98;
this.label18.Text = "License expiration date:";
//
// label23
//
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(336, 327);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(143, 13);
this.label23.TabIndex = 101;
this.label23.Text = "Support expiration days total:";
//
// label39
//
this.label39.AutoSize = true;
this.label39.Location = new System.Drawing.Point(9, 368);
this.label39.Name = "label39";
this.label39.Size = new System.Drawing.Size(110, 13);
this.label39.TabIndex = 120;
this.label39.Text = "Purchase license link:";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(12, 309);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(143, 13);
this.label11.TabIndex = 100;
this.label11.Text = "License expiration days total:";
//
// label37
//
this.label37.AutoSize = true;
this.label37.Location = new System.Drawing.Point(9, 384);
this.label37.Name = "label37";
this.label37.Size = new System.Drawing.Size(114, 13);
this.label37.TabIndex = 118;
this.label37.Text = "Purchase renewal link:";
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(9, 400);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(74, 13);
this.label17.TabIndex = 119;
this.label17.Text = "License code:";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(12, 43);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(70, 13);
this.label8.TabIndex = 78;
this.label8.Text = "License type:";
//
// lIsProtected
//
this.lIsProtected.AutoSize = true;
this.lIsProtected.Location = new System.Drawing.Point(141, 9);
this.lIsProtected.Name = "lIsProtected";
this.lIsProtected.Size = new System.Drawing.Size(19, 13);
this.lIsProtected.TabIndex = 75;
this.lIsProtected.Text = "no";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 9);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(100, 13);
this.label3.TabIndex = 74;
this.label3.Text = "Software protected:";
//
// lTrialTimeUnitsLeft
//
this.lTrialTimeUnitsLeft.AutoSize = true;
this.lTrialTimeUnitsLeft.Location = new System.Drawing.Point(119, 211);
this.lTrialTimeUnitsLeft.Name = "lTrialTimeUnitsLeft";
this.lTrialTimeUnitsLeft.Size = new System.Drawing.Size(208, 13);
this.lTrialTimeUnitsLeft.TabIndex = 97;
this.lTrialTimeUnitsLeft.Text = "* mins | * hours | * days | * weeks | * months";
//
// lTrialTimeUnitsTotal
//
this.lTrialTimeUnitsTotal.AutoSize = true;
this.lTrialTimeUnitsTotal.Location = new System.Drawing.Point(119, 175);
this.lTrialTimeUnitsTotal.Name = "lTrialTimeUnitsTotal";
this.lTrialTimeUnitsTotal.Size = new System.Drawing.Size(208, 13);
this.lTrialTimeUnitsTotal.TabIndex = 95;
this.lTrialTimeUnitsTotal.Text = "* mins | * hours | * days | * weeks | * months";
//
// lIsRegistered
//
this.lIsRegistered.AutoSize = true;
this.lIsRegistered.Location = new System.Drawing.Point(141, 26);
this.lIsRegistered.Name = "lIsRegistered";
this.lIsRegistered.Size = new System.Drawing.Size(19, 13);
this.lIsRegistered.TabIndex = 77;
this.lIsRegistered.Text = "no";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(12, 211);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(94, 13);
this.label6.TabIndex = 96;
this.label6.Text = "Trial time units left:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 175);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(100, 13);
this.label4.TabIndex = 94;
this.label4.Text = "Trial time units total:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 26);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(101, 13);
this.label2.TabIndex = 76;
this.label2.Text = "Software registered:";
//
// btnRegistrationByEmail
//
this.btnRegistrationByEmail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRegistrationByEmail.Location = new System.Drawing.Point(547, 148);
this.btnRegistrationByEmail.Name = "btnRegistrationByEmail";
this.btnRegistrationByEmail.Size = new System.Drawing.Size(153, 23);
this.btnRegistrationByEmail.TabIndex = 136;
this.btnRegistrationByEmail.Text = "Registration By Email";
this.btnRegistrationByEmail.UseVisualStyleBackColor = true;
this.btnRegistrationByEmail.Click += new System.EventHandler(this.btnRegistrationByEmail_Click);
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(711, 535);
this.Controls.Add(this.btnRegistrationByEmail);
this.Controls.Add(this.lProtectionDate);
this.Controls.Add(this.label26);
this.Controls.Add(this.lLaunchesLeft);
this.Controls.Add(this.lLaunchesTotal);
this.Controls.Add(this.lTrialDaysLeft);
this.Controls.Add(this.lTrialDaysTotal);
this.Controls.Add(this.label29);
this.Controls.Add(this.label27);
this.Controls.Add(this.label21);
this.Controls.Add(this.label20);
this.Controls.Add(this.btnRenew);
this.Controls.Add(this.btnRegister);
this.Controls.Add(this.tbRenewalCode);
this.Controls.Add(this.tbLicenseCode);
this.Controls.Add(this.lCurrentRegistrationDate);
this.Controls.Add(this.label12);
this.Controls.Add(this.lFirstRegistrationDate);
this.Controls.Add(this.label10);
this.Controls.Add(this.lOrderDate);
this.Controls.Add(this.lCurrentActivationDate);
this.Controls.Add(this.label16);
this.Controls.Add(this.label7);
this.Controls.Add(this.lCurrentPPVersion);
this.Controls.Add(this.lCustomerEMail);
this.Controls.Add(this.lCustomerName);
this.Controls.Add(this.label25);
this.Controls.Add(this.label13);
this.Controls.Add(this.lIntelliProtectorVersion);
this.Controls.Add(this.lSupportExpirationPPVersion);
this.Controls.Add(this.lSupportExpirationDaysLeft);
this.Controls.Add(this.lLicenseExpirationDaysLeft);
this.Controls.Add(this.lSupportExpirationDate);
this.Controls.Add(this.lLicenseExpirationDate);
this.Controls.Add(this.lSupportExpirationDaysTotal);
this.Controls.Add(this.lLicenseExpirationDaysTotal);
this.Controls.Add(this.lBuyNowLink);
this.Controls.Add(this.lRenewLicenseLink);
this.Controls.Add(this.lLicenseCode);
this.Controls.Add(this.lLicenseType);
this.Controls.Add(this.label9);
this.Controls.Add(this.label14);
this.Controls.Add(this.label35);
this.Controls.Add(this.label31);
this.Controls.Add(this.label15);
this.Controls.Add(this.label5);
this.Controls.Add(this.label19);
this.Controls.Add(this.label24);
this.Controls.Add(this.label18);
this.Controls.Add(this.label23);
this.Controls.Add(this.label39);
this.Controls.Add(this.label11);
this.Controls.Add(this.label37);
this.Controls.Add(this.label17);
this.Controls.Add(this.label8);
this.Controls.Add(this.lIsProtected);
this.Controls.Add(this.label3);
this.Controls.Add(this.lTrialTimeUnitsLeft);
this.Controls.Add(this.lTrialTimeUnitsTotal);
this.Controls.Add(this.lIsRegistered);
this.Controls.Add(this.label6);
this.Controls.Add(this.label4);
this.Controls.Add(this.label2);
this.Controls.Add(this.btnSortArray);
this.Controls.Add(this.btnShowRegistation);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.label1);
this.Name = "FormMain";
this.Text = "FormMain. Sample .NET";
this.Load += new System.EventHandler(this.FormMain_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Timer timerUpdateUnits;
private System.Windows.Forms.Button btnSortArray;
private System.Windows.Forms.Button btnShowRegistation;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Label lProtectionDate;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.Label lLaunchesLeft;
private System.Windows.Forms.Label lLaunchesTotal;
private System.Windows.Forms.Label lTrialDaysLeft;
private System.Windows.Forms.Label lTrialDaysTotal;
private System.Windows.Forms.Label label29;
private System.Windows.Forms.Label label27;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Button btnRenew;
private System.Windows.Forms.Button btnRegister;
private System.Windows.Forms.TextBox tbRenewalCode;
private System.Windows.Forms.TextBox tbLicenseCode;
private System.Windows.Forms.Label lCurrentRegistrationDate;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label lFirstRegistrationDate;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label lOrderDate;
private System.Windows.Forms.Label lCurrentActivationDate;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label lCurrentPPVersion;
private System.Windows.Forms.Label lCustomerEMail;
private System.Windows.Forms.Label lCustomerName;
private System.Windows.Forms.Label label25;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label lIntelliProtectorVersion;
private System.Windows.Forms.Label lSupportExpirationPPVersion;
private System.Windows.Forms.Label lSupportExpirationDaysLeft;
private System.Windows.Forms.Label lLicenseExpirationDaysLeft;
private System.Windows.Forms.Label lSupportExpirationDate;
private System.Windows.Forms.Label lLicenseExpirationDate;
private System.Windows.Forms.Label lSupportExpirationDaysTotal;
private System.Windows.Forms.Label lLicenseExpirationDaysTotal;
private System.Windows.Forms.Label lBuyNowLink;
private System.Windows.Forms.Label lRenewLicenseLink;
private System.Windows.Forms.Label lLicenseCode;
private System.Windows.Forms.Label lLicenseType;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label35;
private System.Windows.Forms.Label label31;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label39;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label37;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label lIsProtected;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lTrialTimeUnitsLeft;
private System.Windows.Forms.Label lTrialTimeUnitsTotal;
private System.Windows.Forms.Label lIsRegistered;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnRegistrationByEmail;
}
}

View File

@@ -0,0 +1,202 @@
using System;
using System.Text;
using System.Windows.Forms;
using IntelliProtectorService;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// == How to test this example ==
// 1. Build C# project (VS2005SampleNET)
// 2. Protect the VS2005SampleNET.exe with IntelliProtector
// 3. Start VS2005SampleNET.exe
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace VS2005SampleNET
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
}
private void btnOk_Click(object sender, EventArgs e)
{
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
Close();
}
private void btnSortArray_Click(object sender, EventArgs e)
{
try
{
SortArray();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
[IntelliProtectorService.attributes.Encrypt]
private void SortArray()
{
int[] array = new int[] { 10, 2, 3, 101, 3, 33, 7, 1 };
Array.Sort(array);
MessageBox.Show("Array is sorted");
}
private void FormMain_Load(object sender, EventArgs e)
{
try
{
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void UpdateControls()
{
lIsProtected.Text = IntelliProtector.IsSoftwareProtected() ? "yes" : "no";
lIsRegistered.Text = IntelliProtector.IsSoftwareRegistered() ? "yes" : "no";
lTrialTimeUnitsTotal.Text = string.Format("{0} mins | {1} hours | {2} days | {3} weeks | {4} months"
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudMinutes)
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudHours)
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudDays)
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudWeeks)
, IntelliProtector.GetTrialUnitsCount((int)IntelliProtector.enUnitDimension.eudMonths)
);
lLicenseType.Text = IntelliProtector.GetLicenseType().ToString();
int iDays = IntelliProtector.GetTrialDaysCount();
lTrialDaysTotal.Text = iDays.ToString();
iDays = IntelliProtector.GetTrialDaysLeftCount();
lTrialDaysLeft.Text = iDays.ToString();
iDays = IntelliProtector.GetLicenseExpirationDaysCount();
lLicenseExpirationDaysTotal.Text = iDays.ToString();
iDays = IntelliProtector.GetLicenseExpirationDaysLeftCount();
lLicenseExpirationDaysLeft.Text = iDays.ToString();
timerUpdateUnits_Tick(null, null);
lLaunchesTotal.Text = IntelliProtector.GetTrialLaunchesCount().ToString();
lLaunchesLeft.Text = IntelliProtector.GetTrialLaunchesLeftCount().ToString();
const int ciMaxBufferLen = 256;
StringBuilder stbBuffer = new StringBuilder(ciMaxBufferLen);
lBuyNowLink.Text = IntelliProtector.GetBuyNowLink();
lRenewLicenseLink.Text = IntelliProtector.GetRenewalPurchaseLink();
lCurrentPPVersion.Text = IntelliProtector.GetCurrentProductVersion();
lSupportExpirationPPVersion.Text = IntelliProtector.GetSupportExpirationProductVersion();
lLicenseCode.Text = IntelliProtector.GetLicenseCode();
lCustomerName.Text = IntelliProtector.GetCustomerName();
lCustomerEMail.Text = IntelliProtector.GetCustomerEMail();
lLicenseExpirationDaysTotal.Text = IntelliProtector.GetLicenseExpirationDaysCount().ToString();
lLicenseExpirationDaysLeft.Text = IntelliProtector.GetLicenseExpirationDaysLeftCount().ToString();
lSupportExpirationDaysTotal.Text = IntelliProtector.GetSupportExpirationDaysCount().ToString();
lSupportExpirationDaysLeft.Text = IntelliProtector.GetSupportExpirationDaysLeftCount().ToString();
DateTime dtOrder = IntelliProtector.GetOrderDate();
ShowDate(lOrderDate, dtOrder);
DateTime dtCurrentActivationDate = IntelliProtector.GetCurrentActivationDate();
ShowDate(lCurrentActivationDate, dtCurrentActivationDate);
DateTime dtFirstRegistrationDate = IntelliProtector.GetFirstRegistrationDate();
ShowDate(lFirstRegistrationDate, dtFirstRegistrationDate);
DateTime dtCurrentRegistrationDate = IntelliProtector.GetCurrentRegistrationDate();
ShowDate(lCurrentRegistrationDate, dtCurrentRegistrationDate);
DateTime dtProtectionDate = IntelliProtector.GetProtectionDate();
ShowDate(lProtectionDate, dtProtectionDate);
DateTime dtLicenseExpirationDate = IntelliProtector.GetLicenseExpirationDate();
ShowDate(lLicenseExpirationDate, dtLicenseExpirationDate);
DateTime dtSupportExpirationDate = IntelliProtector.GetSupportExpirationDate();
ShowDate(lSupportExpirationDate, dtSupportExpirationDate);
lIntelliProtectorVersion.Text = IntelliProtector.GetIntelliProtectorVersion();
}
private static void ShowDate(Control label, DateTime dt)
{
label.Text = (dt != DateTime.MinValue) ? string.Format("{0}.{1}.{2} {3}:{4}", dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute) : "Not applicable";
}
private void timerUpdateUnits_Tick(object sender, EventArgs e)
{
lTrialTimeUnitsLeft.Text = string.Format("{0} mins | {1} hours | {2} days | {3} weeks | {4} months"
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudMinutes)
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudHours)
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudDays)
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudWeeks)
, IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtector.enUnitDimension.eudMonths)
);
}
private void btnShowRegistation_Click(object sender, EventArgs e)
{
try
{
IntelliProtector.ShowRegistrationWindow();
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void btnRegister_Click(object sender, EventArgs e)
{
try
{
IntelliProtector.RegisterSoftware(tbLicenseCode.Text);
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void btnRenew_Click(object sender, EventArgs e)
{
try
{
IntelliProtector.RenewLicenseCode(tbRenewalCode.Text);
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void btnRegistrationByEmail_Click(object sender, EventArgs e)
{
using(FormRegistrationByEmail regByEmail = new FormRegistrationByEmail("VS2005 CS sample.dat"))
regByEmail.ShowDialog();
UpdateControls();
}
}
}

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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timerUpdateUnits.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,141 @@
namespace VS2005SampleNET
{
partial class FormRegistrationByEmail
{
/// <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.label1 = new System.Windows.Forms.Label();
this.tbLicenseCode = new System.Windows.Forms.TextBox();
this.btnSaveCertificate = new System.Windows.Forms.Button();
this.btnUseCertificate = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnClose = new System.Windows.Forms.Button();
this.lRegistrationStatus = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(74, 13);
this.label1.TabIndex = 0;
this.label1.Text = "License code:";
//
// tbLicenseCode
//
this.tbLicenseCode.Location = new System.Drawing.Point(92, 6);
this.tbLicenseCode.Name = "tbLicenseCode";
this.tbLicenseCode.Size = new System.Drawing.Size(347, 20);
this.tbLicenseCode.TabIndex = 1;
//
// btnSaveCertificate
//
this.btnSaveCertificate.Location = new System.Drawing.Point(127, 47);
this.btnSaveCertificate.Name = "btnSaveCertificate";
this.btnSaveCertificate.Size = new System.Drawing.Size(197, 23);
this.btnSaveCertificate.TabIndex = 2;
this.btnSaveCertificate.Text = "1. Save request certificate";
this.btnSaveCertificate.UseVisualStyleBackColor = true;
this.btnSaveCertificate.Click += new System.EventHandler(this.btnSaveCertificate_Click);
//
// btnUseCertificate
//
this.btnUseCertificate.Location = new System.Drawing.Point(127, 76);
this.btnUseCertificate.Name = "btnUseCertificate";
this.btnUseCertificate.Size = new System.Drawing.Size(197, 23);
this.btnUseCertificate.TabIndex = 2;
this.btnUseCertificate.Text = "2. Use response certificate";
this.btnUseCertificate.UseVisualStyleBackColor = true;
this.btnUseCertificate.Click += new System.EventHandler(this.btnUseCertificate_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.lRegistrationStatus);
this.groupBox1.Location = new System.Drawing.Point(12, 121);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(427, 73);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Registration status";
//
// btnClose
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnClose.Location = new System.Drawing.Point(181, 219);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(89, 23);
this.btnClose.TabIndex = 4;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// lRegistrationStatus
//
this.lRegistrationStatus.Location = new System.Drawing.Point(130, 27);
this.lRegistrationStatus.Name = "lRegistrationStatus";
this.lRegistrationStatus.Size = new System.Drawing.Size(166, 25);
this.lRegistrationStatus.TabIndex = 0;
this.lRegistrationStatus.Text = "status";
this.lRegistrationStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// FormRegistrationByEmail
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(451, 254);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnUseCertificate);
this.Controls.Add(this.btnSaveCertificate);
this.Controls.Add(this.tbLicenseCode);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormRegistrationByEmail";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Registration by e-mail";
this.Load += new System.EventHandler(this.FormRegistrationByEmail_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tbLicenseCode;
private System.Windows.Forms.Button btnSaveCertificate;
private System.Windows.Forms.Button btnUseCertificate;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label lRegistrationStatus;
private System.Windows.Forms.Button btnClose;
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Windows.Forms;
using IntelliProtectorService;
namespace VS2005SampleNET
{
public partial class FormRegistrationByEmail : Form
{
private readonly string _certificateName;
public FormRegistrationByEmail(string certificateName)
{
_certificateName = certificateName;
InitializeComponent();
}
private void btnSaveCertificate_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(tbLicenseCode.Text))
{
MessageBox.Show(@"Please specify the license code", @"License is empty");
return;
}
using(SaveFileDialog saveFileDialog = new SaveFileDialog())
{
saveFileDialog.FileName = _certificateName;
saveFileDialog.OverwritePrompt = true;
saveFileDialog.InitialDirectory = Application.StartupPath;
saveFileDialog.Filter = @"Data Files (*.dat)|*.dat|All Files (*.*)|*.*";
if (saveFileDialog.ShowDialog() != DialogResult.OK)
return;
bool result = IntelliProtector.CreateRegistrationRequestCertificate(saveFileDialog.FileName, tbLicenseCode.Text);
if (result == false)
MessageBox.Show(@"Error, certificate is not saved!");
}
}
private void btnUseCertificate_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.InitialDirectory = Application.StartupPath;
openFileDialog.Filter = @"Data Files (*.dat)|*.dat|All Files (*.*)|*.*";
if (openFileDialog.ShowDialog() != DialogResult.OK)
return;
bool result = IntelliProtector.UseRegistrationResponseCertificate(openFileDialog.FileName);
if (result == false)
MessageBox.Show(@"Error, certificate is not used!");
}
UpdateRegistrationStatus();
}
void UpdateRegistrationStatus()
{
lRegistrationStatus.Text = IntelliProtector.IsSoftwareRegistered() ? @"registered" : @"not registered";
}
private void btnClose_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void FormRegistrationByEmail_Load(object sender, EventArgs e)
{
UpdateRegistrationStatus();
}
}
}

View File

@@ -0,0 +1,930 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2010. IntelliProtector.com
// Web site: http://intelliprotector.com
// Version: v2.5
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace netprotector.api
{
internal delegate void dVoid_NoParams();
internal delegate void dVoid_BoolParam(out bool b1);
internal delegate void dVoid_IntParam(out int i1);
internal delegate void dVoid_2IntParam(out int i1, int i2);
internal delegate void dVoid_5IntParams(out int i1, out int i2, out int i3, out int i4, out int i5);
internal delegate void dVoid_StringBuilderParam([MarshalAs(UnmanagedType.LPWStr)] StringBuilder s1, int iMaxLength);
internal delegate void dBool_StringParam(out bool res, [MarshalAs(UnmanagedType.LPWStr)]String s1, int iMaxLength);
internal delegate void dBool_StringOnlyParam(out bool res, [MarshalAs(UnmanagedType.LPWStr)]String s1);
internal delegate void dBool_StringStringParam(out bool res, [MarshalAs(UnmanagedType.LPWStr)]String s1, [MarshalAs(UnmanagedType.LPWStr)]String s2);
}
namespace IntelliProtectorService.attributes
{
internal class Encrypt : Attribute { }
internal class GetBuyNowLinkAttribute : Attribute { }
internal class IsSoftwareProtectedAttribute : Attribute { }
internal class IsSoftwareRegisteredAttribute : Attribute { }
internal class GetTrialDaysCountAttribute : Attribute { }
internal class GetTrialUnitsCountAttribute : Attribute { }
internal class GetTrialDaysLeftCountAttribute : Attribute { }
internal class GetTrialUnitsLeftCountAttribute : Attribute { }
internal class GetTrialLaunchesCountAttribute : Attribute { }
internal class GetTrialLaunchesLeftCountAttribute : Attribute { }
internal class ShowRegistrationWindowAttribute : Attribute { }
internal class IsTrialElapsedAttribute : Attribute { }
internal class GetRenewalPurchaseLinkAttribute : Attribute { }
internal class GetLicenseTypeAttribute : Attribute { }
internal class GetLicenseExpirationDaysCountAttribute : Attribute { }
internal class GetLicenseExpirationDaysLeftCountAttribute : Attribute { }
internal class GetSupportExpirationDaysCountAttribute : Attribute { }
internal class GetSupportExpirationDaysLeftCountAttribute : Attribute { }
internal class GetCurrentProductVersionAttribute : Attribute { }
internal class GetCustomerNameAttribute : Attribute { }
internal class GetCustomerEMailAttribute : Attribute { }
internal class GetLicenseCodeAttribute : Attribute { }
internal class RegisterSoftwareAttribute : Attribute { }
internal class RenewLicenseCodeAttribute : Attribute { }
internal class GetCurrentActivationDateAttribute : Attribute { }
internal class GetCurrentRegistrationDateAttribute : Attribute { }
internal class GetFirstRegistrationDateAttribute : Attribute { }
internal class GetOrderDateAttribute : Attribute { }
internal class GetLicenseExpirationDateAttribute : Attribute { }
internal class GetProtectionDateAttribute : Attribute { }
internal class GetSupportExpirationDateAttribute : Attribute { }
internal class GetSupportExpirationProductVersionAttribute : Attribute { }
internal class GetIntelliProtectorVersionAttribute : Attribute { }
internal class CreateRegistrationRequestCertificateAttribute : Attribute { }
internal class UseRegistrationResponseCertificateAttribute : Attribute { }
internal class SystemFunction1Attribute : Attribute { }
}
namespace IntelliProtectorService
{
internal class IntelliProtector
{
public static double Version_2_5()
{
return 2.5f;
}
#if DEBUG
public static bool IsInDebugMode()
{
return true;
}
#endif
public enum enUnitDimension
{
eudMinutes,
eudHours,
eudDays,
eudWeeks,
eudMonths
};
private class Init32
{
[DllImport("JitHookCore.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Init")]
public static extern void Init();
};
private class Init64
{
[DllImport("JitHookCoreX64.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Init")]
public static extern void Init();
};
public static bool Init()
{
try
{
bool tryLoadX64 = false;
try
{
Init32.Init();
}
catch (BadImageFormatException)
{
tryLoadX64 = true;
}
if (tryLoadX64)
{
try
{
Init64.Init();
}
catch (BadImageFormatException)
{
return false;
}
}
return true;
}
catch (System.Exception)
{
return true;
}
}
#region GetBuyNowLink
[attributes.GetBuyNowLinkAttribute]
public static String GetBuyNowLink()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetBuyNowLinkTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetBuyNowLinkTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region IsSoftwareProtected
[attributes.IsSoftwareProtected]
public static bool IsSoftwareProtected()
{
UInt64 address = 0;
object[] obj = new object[] { false };
Type tp = typeof(netprotector.api.dVoid_BoolParam);
IsSoftwareProtectedTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void IsSoftwareProtectedTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(bool))
return;
obj[0] = false;
}
#endregion
#region IsSoftwareRegistered
[attributes.IsSoftwareRegistered]
public static bool IsSoftwareRegistered()
{
UInt64 address = 0;
object[] obj = new object[] { false };
Type tp = typeof(netprotector.api.dVoid_BoolParam);
IsSoftwareRegisteredTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void IsSoftwareRegisteredTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(bool))
return;
obj[0] = false;
}
#endregion
#region GetTrialDaysCount
[attributes.GetTrialDaysCount]
public static int GetTrialDaysCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialDaysCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
protected static void GetTrialDaysCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialUnitsCount
[attributes.GetTrialUnitsCount]
public static int GetTrialUnitsCount(int dimensions)
{
UInt64 address = 0;
object[] obj = new object[] { (int)0, dimensions };
Type tp = typeof(netprotector.api.dVoid_2IntParam);
GetTrialUnitsCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialUnitsCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) && obj[1].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialDaysLeftCount
[attributes.GetTrialDaysLeftCount]
public static int GetTrialDaysLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialDaysLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialDaysLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialUnitsLeftCount
[attributes.GetTrialUnitsLeftCount]
public static int GetTrialUnitsLeftCount(int dimension)
{
UInt64 address = 0;
object[] obj = new object[] { (int)0, dimension };
Type tp = typeof(netprotector.api.dVoid_2IntParam);
GetTrialUnitsLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialUnitsLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) && obj[1].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialLaunchesCount
[attributes.GetTrialLaunchesCount]
public static int GetTrialLaunchesCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialLaunchesCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialLaunchesCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialLaunchesLeftCount
[attributes.GetTrialLaunchesLeftCount]
public static int GetTrialLaunchesLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialLaunchesLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialLaunchesLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region ShowRegistrationWindow
[attributes.ShowRegistrationWindow]
public static void ShowRegistrationWindow()
{
UInt64 address = 0;
Type tp = typeof(netprotector.api.dVoid_NoParams);
ShowRegistrationWindowTest(address, null, tp);
}
[attributes.Encrypt]
public static void ShowRegistrationWindowTest(UInt64 address, object[] obj, Type delegateType)
{
}
#endregion
#region IsTrialElapsed
[attributes.IsTrialElapsed]
public static bool IsTrialElapsed()
{
UInt64 address = 0;
object[] obj = new object[] { false };
Type tp = typeof(netprotector.api.dVoid_BoolParam);
IsTrialElapsedTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void IsTrialElapsedTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(bool))
return;
obj[0] = false;
}
#endregion
#region GetRenewalPurchaseLink
[attributes.GetRenewalPurchaseLink]
public static String GetRenewalPurchaseLink()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetRenewalPurchaseLinkTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetRenewalPurchaseLinkTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetLicenseType
[attributes.GetLicenseType]
public static int GetLicenseType()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetLicenseTypeTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetLicenseTypeTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetLicenseExpirationDaysCount
[attributes.GetLicenseExpirationDaysCount]
public static int GetLicenseExpirationDaysCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetLicenseExpirationDaysCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetLicenseExpirationDaysCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetLicenseExpirationDaysLeftCount
[attributes.GetLicenseExpirationDaysLeftCount]
public static int GetLicenseExpirationDaysLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetLicenseExpirationDaysLeftTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetLicenseExpirationDaysLeftTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetSupportExpirationDaysCount
[attributes.GetSupportExpirationDaysCount]
public static int GetSupportExpirationDaysCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetSupportExpirationDaysCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetSupportExpirationDaysCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetSupportExpirationDaysLeftCount
[attributes.GetSupportExpirationDaysLeftCount]
public static int GetSupportExpirationDaysLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetSupportExpirationDaysLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetSupportExpirationDaysLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetCurrentProductVersion
[attributes.GetCurrentProductVersion]
public static String GetCurrentProductVersion()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetCurrentProductVersionTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetCurrentProductVersionTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetCustomerName
[attributes.GetCustomerName]
public static String GetCustomerName()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetCustomerNameTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetCustomerNameTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetCustomerEMail
[attributes.GetCustomerEMail]
public static String GetCustomerEMail()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetCustomerEMailTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetCustomerEMailTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetLicenseCode
[attributes.GetLicenseCode]
public static String GetLicenseCode()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetLicenseCodeTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetLicenseCodeTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region RegisterSoftware
[attributes.RegisterSoftware]
public static bool RegisterSoftware(string licenseKey)
{
UInt64 address = 0;
bool res = false;
object[] obj = new object[] { res, licenseKey, licenseKey.Length };
Type tp = typeof(netprotector.api.dBool_StringParam);
RegisterSoftwareTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void RegisterSoftwareTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = false;
}
#endregion
#region RenewLicenseCode
[attributes.RenewLicenseCode]
public static bool RenewLicenseCode(string renewalCode)
{
UInt64 address = 0;
object[] obj = new object[] { false, renewalCode, renewalCode.Length };
Type tp = typeof(netprotector.api.dBool_StringParam);
RenewLicenseCodeTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void RenewLicenseCodeTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = false;
}
#endregion
#region GetCurrentActivationDate
[attributes.GetCurrentActivationDate]
public static DateTime GetCurrentActivationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetCurrentActivationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetCurrentActivationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetCurrentRegistrationDate
[attributes.GetCurrentRegistrationDate]
public static DateTime GetCurrentRegistrationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetCurrentRegistrationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetCurrentRegistrationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetFirstRegistrationDate
[attributes.GetFirstRegistrationDate]
public static DateTime GetFirstRegistrationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetFirstRegistrationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetFirstRegistrationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetOrderDate
[attributes.GetOrderDate]
public static DateTime GetOrderDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetOrderDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetOrderDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetLicenseExpirationDate
[attributes.GetLicenseExpirationDate]
public static DateTime GetLicenseExpirationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetLicenseExpirationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetLicenseExpirationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetProtectionDate
[attributes.GetProtectionDate]
public static DateTime GetProtectionDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetProtectionDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetProtectionDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetSupportExpirationDate
[attributes.GetSupportExpirationDate]
public static DateTime GetSupportExpirationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetSupportExpirationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetSupportExpirationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetSupportExpirationProductVersion
[attributes.GetSupportExpirationProductVersion]
public static String GetSupportExpirationProductVersion()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetSupportExpirationProductVersionTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetSupportExpirationProductVersionTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetIntelliProtectorVersion
[attributes.GetIntelliProtectorVersion]
public static String GetIntelliProtectorVersion()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetIntelliProtectorVersionTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetIntelliProtectorVersionTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region CreateRegistrationRequestCertificate
[attributes.CreateRegistrationRequestCertificate]
public static bool CreateRegistrationRequestCertificate(string path, string licenseCode)
{
UInt64 address = 0;
bool res = false;
object[] obj = new object[] { res, path, licenseCode };
Type tp = typeof(netprotector.api.dBool_StringStringParam);
CreateRegistrationRequestCertificateTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void CreateRegistrationRequestCertificateTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = true;
}
#endregion
#region UseRegistrationResponseCertificate
[attributes.UseRegistrationResponseCertificate]
public static bool UseRegistrationResponseCertificate(string path)
{
UInt64 address = 0;
bool res = false;
object[] obj = new object[] { res, path };
Type tp = typeof(netprotector.api.dBool_StringOnlyParam);
UseRegistrationResponseCertificateTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void UseRegistrationResponseCertificateTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = true;
}
#endregion
#region SystemFunction1
[attributes.SystemFunction1]
protected static void SystemFunction1(UInt64 address, object[] parameters, Type delegateType)
{
Delegate delegateFunc = Marshal.GetDelegateForFunctionPointer((IntPtr)address, delegateType);
delegateFunc.DynamicInvoke(parameters);
}
#endregion
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Windows.Forms;
using IntelliProtectorService;
namespace VS2005SampleNET
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
if (!IntelliProtector.Init())
{
MessageBox.Show("Cannot load protector module");
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormMain());
}
}
}

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VS2005SampleNET")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("IntelliProtector.com")]
[assembly: AssemblyProduct("VS2005SampleNET")]
[assembly: AssemblyCopyright("Copyright © 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("91fab80e-617f-4ec4-9780-23a809cce5b8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.5.0.0")]
[assembly: AssemblyFileVersion("2.5.0.0")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.225
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VS2005SampleNET.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VS2005SampleNET.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.225
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VS2005SampleNET.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="VS2005SampleNET">
</Property><Property Name="Solution File" Value="C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\VS2005SampleNET.sln">
</Property><Property Name="User Options File" Value="C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\VS2005SampleNET.suo">
</Property><Property Name="Date" Value="Monday, May 02, 2011">
</Property><Property Name="Time" Value="1:56 AM">
</Property></Properties><Event ErrorLevel="0" Project="" Source="VS2005SampleNET.sln" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\VS2005SampleNET.sln">
</Event><Event ErrorLevel="0" Project="" Source="VS2005SampleNET.suo" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\VS2005SampleNET.suo">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="VS2005SampleNET.csproj" Description="Project file successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\VS2005SampleNET.csproj">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="VS2005SampleNET.csproj.user" Description="Project user file successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\VS2005SampleNET.csproj.user">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="FormMain.cs" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\FormMain.cs">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="FormMain.Designer.cs" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\FormMain.Designer.cs">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="FormRegistrationByEmail.cs" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\FormRegistrationByEmail.cs">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="FormRegistrationByEmail.Designer.cs" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\FormRegistrationByEmail.Designer.cs">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="IntelliProtector.cs" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\IntelliProtector.cs">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="Program.cs" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\Program.cs">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="Properties\AssemblyInfo.cs" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\Properties\AssemblyInfo.cs">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="Properties\Resources.Designer.cs" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\Properties\Resources.Designer.cs">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="Properties\Settings.Designer.cs" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\Properties\Settings.Designer.cs">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="Properties\Settings.settings" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\Properties\Settings.settings">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="FormMain.resx" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\FormMain.resx">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="Properties\Resources.resx" Description="File successfully backed up as C:\Users\Administrator\Downloads\VS2005SampleNET (src)\VS2005SampleNET (src)\Backup\Properties\Resources.resx">
</Event><Event ErrorLevel="1" Project="VS2005SampleNET" Source="VS2005SampleNET.csproj" Description="Your project is targeting .NET Framework 2.0 or 3.0. If your project uses assemblies requiring a newer .NET Framework, your project will fail to build. You can change the .NET Framework version by clicking Properties on the project menu and then selecting a new version in the '.NET Framework' dropdown box. (In Visual Basic, this is located on the Compile tab by clicking the 'Advanced Compiler Options...' button.)">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="VS2005SampleNET.csproj" Description="Project converted successfully">
</Event><Event ErrorLevel="3" Project="VS2005SampleNET" Source="VS2005SampleNET.csproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="VS2005SampleNET.sln" Description="Solution converted successfully">
</Event><Event ErrorLevel="3" Project="" Source="VS2005SampleNET.sln" Description="Converted">
</Event><Event ErrorLevel="0" Project="VS2005SampleNET" Source="VS2005SampleNET.csproj" Description="Scan complete: Upgrade not required for project files.">
</Event></UpgradeLog>

View File

@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VS2005SampleNET</RootNamespace>
<AssemblyName>VS2005SampleNET</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FormMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormMain.Designer.cs">
<DependentUpon>FormMain.cs</DependentUpon>
</Compile>
<Compile Include="FormRegistrationByEmail.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormRegistrationByEmail.Designer.cs">
<DependentUpon>FormRegistrationByEmail.cs</DependentUpon>
</Compile>
<Compile Include="IntelliProtector.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FormMain.resx">
<SubType>Designer</SubType>
<DependentUpon>FormMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,26 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS2005SampleNET", "VS2005SampleNET.csproj", "{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Debug|x86.ActiveCfg = Debug|x86
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Debug|x86.Build.0 = Debug|x86
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Release|Any CPU.Build.0 = Release|Any CPU
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Release|x86.ActiveCfg = Release|x86
{9B4852A9-36AE-4EDA-B727-4A86BF2487AB}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

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,32 @@
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\bin\Debug\VS2005SampleNET.exe
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\bin\Debug\VS2005SampleNET.pdb
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Debug\ResolveAssemblyReference.cache
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Debug\VS2005SampleNET.FormMain.resources
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Debug\VS2005SampleNET.Properties.Resources.resources
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Debug\VS2005SampleNET.csproj.GenerateResource.Cache
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Debug\VS2005SampleNET.exe
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Debug\VS2005SampleNET.pdb
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\bin\Release\VS2005SampleNET.exe
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\bin\Release\VS2005SampleNET.pdb
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Release\ResolveAssemblyReference.cache
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Release\VS2005SampleNET.FormMain.resources
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Release\VS2005SampleNET.Properties.Resources.resources
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Release\VS2005SampleNET.csproj.GenerateResource.Cache
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Release\VS2005SampleNET.exe
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\Release\VS2005SampleNET.pdb
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\bin\x86\Release\VS2005SampleNET.exe
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\bin\x86\Release\VS2005SampleNET.pdb
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\x86\Release\ResolveAssemblyReference.cache
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\x86\Release\VS2005SampleNET.FormMain.resources
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\x86\Release\VS2005SampleNET.Properties.Resources.resources
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\x86\Release\VS2005SampleNET.csproj.GenerateResource.Cache
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\x86\Release\VS2005SampleNET.exe
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET App (src)\obj\x86\Release\VS2005SampleNET.pdb
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET (src)\obj\x86\Release\VS2005SampleNET.exe
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET (src)\obj\x86\Release\VS2005SampleNET.pdb
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET (src)\bin\x86\Release\VS2005SampleNET.exe
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET (src)\bin\x86\Release\VS2005SampleNET.pdb
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET (src)\obj\x86\Release\ResolveAssemblyReference.cache
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET (src)\obj\x86\Release\VS2005SampleNET.FormMain.resources
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET (src)\obj\x86\Release\VS2005SampleNET.Properties.Resources.resources
D:\Work\IntelliProtector\Samples\Visual Studio\Visual Studio 2005\VS2005SampleNET App\VS2005SampleNET (src)\obj\x86\Release\VS2005SampleNET.csproj.GenerateResource.Cache

View File

@@ -0,0 +1,877 @@
namespace VS2010SampleNET
{
partial class FormMain
{
/// <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.components = new System.ComponentModel.Container();
this.label1 = new System.Windows.Forms.Label();
this.btnOk = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.lIsRegistered = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.lTrialTimeUnitsTotal = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.lTrialTimeUnitsLeft = new System.Windows.Forms.Label();
this.btnShowRegistation = new System.Windows.Forms.Button();
this.btnSortArray = new System.Windows.Forms.Button();
this.lIsProtected = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.lLicenseType = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.timerUpdateUnits = new System.Windows.Forms.Timer(this.components);
this.label7 = new System.Windows.Forms.Label();
this.lCurrentActivationDate = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.lFirstRegistrationDate = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.lCurrentRegistrationDate = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.lCustomerName = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.lCustomerEMail = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.lLicenseExpirationDaysTotal = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.lLicenseExpirationDaysLeft = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.lLicenseCode = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.tbLicenseCode = new System.Windows.Forms.TextBox();
this.btnRegister = new System.Windows.Forms.Button();
this.label14 = new System.Windows.Forms.Label();
this.lIntelliProtectorVersion = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.lOrderDate = new System.Windows.Forms.Label();
this.lTrialDaysTotal = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.lTrialDaysLeft = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.lLicenseExpirationDate = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
this.lCurrentPPVersion = new System.Windows.Forms.Label();
this.label27 = new System.Windows.Forms.Label();
this.lLaunchesTotal = new System.Windows.Forms.Label();
this.label29 = new System.Windows.Forms.Label();
this.lLaunchesLeft = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.label31 = new System.Windows.Forms.Label();
this.lSupportExpirationDaysTotal = new System.Windows.Forms.Label();
this.lSupportExpirationDate = new System.Windows.Forms.Label();
this.lSupportExpirationDaysLeft = new System.Windows.Forms.Label();
this.label35 = new System.Windows.Forms.Label();
this.lSupportExpirationPPVersion = new System.Windows.Forms.Label();
this.label37 = new System.Windows.Forms.Label();
this.lRenewLicenseLink = new System.Windows.Forms.Label();
this.label39 = new System.Windows.Forms.Label();
this.lBuyNowLink = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.tbRenewalCode = new System.Windows.Forms.TextBox();
this.btnRenew = new System.Windows.Forms.Button();
this.lProtectionDate = new System.Windows.Forms.Label();
this.label26 = new System.Windows.Forms.Label();
this.btnRegistrationByEmail = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(471, 513);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(229, 13);
this.label1.TabIndex = 37;
this.label1.Text = "IntelliProtector sample. Visual Studio 2010.NET";
//
// btnOk
//
this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnOk.Location = new System.Drawing.Point(624, 7);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 33;
this.btnOk.Text = "Ok";
this.btnOk.UseVisualStyleBackColor = true;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(624, 36);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 34;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 29);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(101, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Software registered:";
//
// lIsRegistered
//
this.lIsRegistered.AutoSize = true;
this.lIsRegistered.Location = new System.Drawing.Point(142, 29);
this.lIsRegistered.Name = "lIsRegistered";
this.lIsRegistered.Size = new System.Drawing.Size(19, 13);
this.lIsRegistered.TabIndex = 3;
this.lIsRegistered.Text = "no";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(13, 178);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(100, 13);
this.label4.TabIndex = 16;
this.label4.Text = "Trial time units total:";
//
// lTrialTimeUnitsTotal
//
this.lTrialTimeUnitsTotal.AutoSize = true;
this.lTrialTimeUnitsTotal.Location = new System.Drawing.Point(120, 178);
this.lTrialTimeUnitsTotal.Name = "lTrialTimeUnitsTotal";
this.lTrialTimeUnitsTotal.Size = new System.Drawing.Size(208, 13);
this.lTrialTimeUnitsTotal.TabIndex = 17;
this.lTrialTimeUnitsTotal.Text = "* mins | * hours | * days | * weeks | * months";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(13, 214);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(94, 13);
this.label6.TabIndex = 18;
this.label6.Text = "Trial time units left:";
//
// lTrialTimeUnitsLeft
//
this.lTrialTimeUnitsLeft.AutoSize = true;
this.lTrialTimeUnitsLeft.Location = new System.Drawing.Point(120, 214);
this.lTrialTimeUnitsLeft.Name = "lTrialTimeUnitsLeft";
this.lTrialTimeUnitsLeft.Size = new System.Drawing.Size(208, 13);
this.lTrialTimeUnitsLeft.TabIndex = 19;
this.lTrialTimeUnitsLeft.Text = "* mins | * hours | * days | * weeks | * months";
//
// btnShowRegistation
//
this.btnShowRegistation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnShowRegistation.Location = new System.Drawing.Point(547, 84);
this.btnShowRegistation.Name = "btnShowRegistation";
this.btnShowRegistation.Size = new System.Drawing.Size(153, 23);
this.btnShowRegistation.TabIndex = 35;
this.btnShowRegistation.Text = "Show Registration Window";
this.btnShowRegistation.UseVisualStyleBackColor = true;
this.btnShowRegistation.Click += new System.EventHandler(this.btnShowRegistation_Click);
//
// btnSortArray
//
this.btnSortArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSortArray.Location = new System.Drawing.Point(547, 114);
this.btnSortArray.Name = "btnSortArray";
this.btnSortArray.Size = new System.Drawing.Size(153, 23);
this.btnSortArray.TabIndex = 36;
this.btnSortArray.Text = "Sort array (encrypted call)";
this.btnSortArray.UseVisualStyleBackColor = true;
this.btnSortArray.Click += new System.EventHandler(this.btnSortArray_Click);
//
// lIsProtected
//
this.lIsProtected.AutoSize = true;
this.lIsProtected.Location = new System.Drawing.Point(142, 12);
this.lIsProtected.Name = "lIsProtected";
this.lIsProtected.Size = new System.Drawing.Size(19, 13);
this.lIsProtected.TabIndex = 1;
this.lIsProtected.Text = "no";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(13, 12);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(100, 13);
this.label3.TabIndex = 0;
this.label3.Text = "Software protected:";
//
// lLicenseType
//
this.lLicenseType.AutoSize = true;
this.lLicenseType.Location = new System.Drawing.Point(142, 46);
this.lLicenseType.Name = "lLicenseType";
this.lLicenseType.Size = new System.Drawing.Size(16, 13);
this.lLicenseType.TabIndex = 5;
this.lLicenseType.Text = "-1";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(13, 46);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(70, 13);
this.label8.TabIndex = 4;
this.label8.Text = "License type:";
//
// timerUpdateUnits
//
this.timerUpdateUnits.Enabled = true;
this.timerUpdateUnits.Interval = 30000;
this.timerUpdateUnits.Tick += new System.EventHandler(this.timerUpdateUnits_Tick);
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(13, 93);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(117, 13);
this.label7.TabIndex = 10;
this.label7.Text = "Current activation date:";
//
// lCurrentActivationDate
//
this.lCurrentActivationDate.Location = new System.Drawing.Point(142, 93);
this.lCurrentActivationDate.Name = "lCurrentActivationDate";
this.lCurrentActivationDate.Size = new System.Drawing.Size(179, 13);
this.lCurrentActivationDate.TabIndex = 11;
this.lCurrentActivationDate.Text = "date";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(13, 112);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(107, 13);
this.label10.TabIndex = 12;
this.label10.Text = "First registration date:";
//
// lFirstRegistrationDate
//
this.lFirstRegistrationDate.Location = new System.Drawing.Point(142, 112);
this.lFirstRegistrationDate.Name = "lFirstRegistrationDate";
this.lFirstRegistrationDate.Size = new System.Drawing.Size(179, 13);
this.lFirstRegistrationDate.TabIndex = 13;
this.lFirstRegistrationDate.Text = "date";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(13, 131);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(122, 13);
this.label12.TabIndex = 14;
this.label12.Text = "Current registration date:";
//
// lCurrentRegistrationDate
//
this.lCurrentRegistrationDate.Location = new System.Drawing.Point(142, 131);
this.lCurrentRegistrationDate.Name = "lCurrentRegistrationDate";
this.lCurrentRegistrationDate.Size = new System.Drawing.Size(179, 13);
this.lCurrentRegistrationDate.TabIndex = 15;
this.lCurrentRegistrationDate.Text = "date";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(251, 12);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(83, 13);
this.label9.TabIndex = 6;
this.label9.Text = "Customer name:";
//
// lCustomerName
//
this.lCustomerName.Location = new System.Drawing.Point(342, 12);
this.lCustomerName.Name = "lCustomerName";
this.lCustomerName.Size = new System.Drawing.Size(209, 13);
this.lCustomerName.TabIndex = 8;
this.lCustomerName.Text = "customer name";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(251, 29);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(84, 13);
this.label13.TabIndex = 7;
this.label13.Text = "Customer e-mail:";
//
// lCustomerEMail
//
this.lCustomerEMail.Location = new System.Drawing.Point(342, 29);
this.lCustomerEMail.Name = "lCustomerEMail";
this.lCustomerEMail.Size = new System.Drawing.Size(209, 13);
this.lCustomerEMail.TabIndex = 9;
this.lCustomerEMail.Text = "customer e-mail";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(13, 312);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(143, 13);
this.label11.TabIndex = 20;
this.label11.Text = "License expiration days total:";
//
// lLicenseExpirationDaysTotal
//
this.lLicenseExpirationDaysTotal.AutoSize = true;
this.lLicenseExpirationDaysTotal.Location = new System.Drawing.Point(158, 312);
this.lLicenseExpirationDaysTotal.Name = "lLicenseExpirationDaysTotal";
this.lLicenseExpirationDaysTotal.Size = new System.Drawing.Size(13, 13);
this.lLicenseExpirationDaysTotal.TabIndex = 21;
this.lLicenseExpirationDaysTotal.Text = "0";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(13, 329);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(137, 13);
this.label15.TabIndex = 22;
this.label15.Text = "License expiration days left:";
//
// lLicenseExpirationDaysLeft
//
this.lLicenseExpirationDaysLeft.AutoSize = true;
this.lLicenseExpirationDaysLeft.Location = new System.Drawing.Point(158, 329);
this.lLicenseExpirationDaysLeft.Name = "lLicenseExpirationDaysLeft";
this.lLicenseExpirationDaysLeft.Size = new System.Drawing.Size(13, 13);
this.lLicenseExpirationDaysLeft.TabIndex = 23;
this.lLicenseExpirationDaysLeft.Text = "0";
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(10, 403);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(74, 13);
this.label17.TabIndex = 29;
this.label17.Text = "License code:";
//
// lLicenseCode
//
this.lLicenseCode.Location = new System.Drawing.Point(130, 403);
this.lLicenseCode.Name = "lLicenseCode";
this.lLicenseCode.Size = new System.Drawing.Size(301, 13);
this.lLicenseCode.TabIndex = 30;
this.lLicenseCode.Text = "license code";
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(13, 431);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(74, 13);
this.label19.TabIndex = 26;
this.label19.Text = "License code:";
//
// tbLicenseCode
//
this.tbLicenseCode.Location = new System.Drawing.Point(111, 428);
this.tbLicenseCode.Name = "tbLicenseCode";
this.tbLicenseCode.Size = new System.Drawing.Size(301, 20);
this.tbLicenseCode.TabIndex = 27;
//
// btnRegister
//
this.btnRegister.Location = new System.Drawing.Point(418, 428);
this.btnRegister.Name = "btnRegister";
this.btnRegister.Size = new System.Drawing.Size(75, 23);
this.btnRegister.TabIndex = 28;
this.btnRegister.Text = "Register";
this.btnRegister.UseVisualStyleBackColor = true;
this.btnRegister.Click += new System.EventHandler(this.btnRegister_Click);
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(13, 488);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(114, 13);
this.label14.TabIndex = 31;
this.label14.Text = "IntelliProtector version:";
//
// lIntelliProtectorVersion
//
this.lIntelliProtectorVersion.AutoSize = true;
this.lIntelliProtectorVersion.Location = new System.Drawing.Point(130, 488);
this.lIntelliProtectorVersion.Name = "lIntelliProtectorVersion";
this.lIntelliProtectorVersion.Size = new System.Drawing.Size(41, 13);
this.lIntelliProtectorVersion.TabIndex = 32;
this.lIntelliProtectorVersion.Text = "version";
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(13, 74);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(60, 13);
this.label16.TabIndex = 10;
this.label16.Text = "Order date:";
//
// lOrderDate
//
this.lOrderDate.Location = new System.Drawing.Point(142, 74);
this.lOrderDate.Name = "lOrderDate";
this.lOrderDate.Size = new System.Drawing.Size(179, 13);
this.lOrderDate.TabIndex = 11;
this.lOrderDate.Text = "date";
//
// lTrialDaysTotal
//
this.lTrialDaysTotal.AutoSize = true;
this.lTrialDaysTotal.Location = new System.Drawing.Point(120, 194);
this.lTrialDaysTotal.Name = "lTrialDaysTotal";
this.lTrialDaysTotal.Size = new System.Drawing.Size(13, 13);
this.lTrialDaysTotal.TabIndex = 39;
this.lTrialDaysTotal.Text = "0";
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(13, 194);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(78, 13);
this.label20.TabIndex = 38;
this.label20.Text = "Trial days total:";
//
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(13, 230);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(72, 13);
this.label21.TabIndex = 38;
this.label21.Text = "Trial days left:";
//
// lTrialDaysLeft
//
this.lTrialDaysLeft.AutoSize = true;
this.lTrialDaysLeft.Location = new System.Drawing.Point(120, 230);
this.lTrialDaysLeft.Name = "lTrialDaysLeft";
this.lTrialDaysLeft.Size = new System.Drawing.Size(13, 13);
this.lTrialDaysLeft.TabIndex = 39;
this.lTrialDaysLeft.Text = "0";
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(13, 295);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(119, 13);
this.label18.TabIndex = 20;
this.label18.Text = "License expiration date:";
//
// lLicenseExpirationDate
//
this.lLicenseExpirationDate.AutoSize = true;
this.lLicenseExpirationDate.Location = new System.Drawing.Point(158, 295);
this.lLicenseExpirationDate.Name = "lLicenseExpirationDate";
this.lLicenseExpirationDate.Size = new System.Drawing.Size(28, 13);
this.lLicenseExpirationDate.TabIndex = 21;
this.lLicenseExpirationDate.Text = "date";
//
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(251, 46);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(84, 13);
this.label25.TabIndex = 7;
this.label25.Text = "Product version:";
//
// lCurrentPPVersion
//
this.lCurrentPPVersion.Location = new System.Drawing.Point(342, 46);
this.lCurrentPPVersion.Name = "lCurrentPPVersion";
this.lCurrentPPVersion.Size = new System.Drawing.Size(131, 13);
this.lCurrentPPVersion.TabIndex = 9;
this.lCurrentPPVersion.Text = "1.0";
//
// label27
//
this.label27.AutoSize = true;
this.label27.Location = new System.Drawing.Point(13, 254);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(99, 13);
this.label27.TabIndex = 38;
this.label27.Text = "Trial launches total:";
//
// lLaunchesTotal
//
this.lLaunchesTotal.AutoSize = true;
this.lLaunchesTotal.Location = new System.Drawing.Point(120, 254);
this.lLaunchesTotal.Name = "lLaunchesTotal";
this.lLaunchesTotal.Size = new System.Drawing.Size(13, 13);
this.lLaunchesTotal.TabIndex = 39;
this.lLaunchesTotal.Text = "0";
//
// label29
//
this.label29.AutoSize = true;
this.label29.Location = new System.Drawing.Point(13, 272);
this.label29.Name = "label29";
this.label29.Size = new System.Drawing.Size(93, 13);
this.label29.TabIndex = 38;
this.label29.Text = "Trial launches left:";
//
// lLaunchesLeft
//
this.lLaunchesLeft.AutoSize = true;
this.lLaunchesLeft.Location = new System.Drawing.Point(120, 272);
this.lLaunchesLeft.Name = "lLaunchesLeft";
this.lLaunchesLeft.Size = new System.Drawing.Size(13, 13);
this.lLaunchesLeft.TabIndex = 39;
this.lLaunchesLeft.Text = "0";
//
// label23
//
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(337, 330);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(143, 13);
this.label23.TabIndex = 20;
this.label23.Text = "Support expiration days total:";
//
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(337, 295);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(119, 13);
this.label24.TabIndex = 20;
this.label24.Text = "Support expiration date:";
//
// label31
//
this.label31.AutoSize = true;
this.label31.Location = new System.Drawing.Point(337, 347);
this.label31.Name = "label31";
this.label31.Size = new System.Drawing.Size(137, 13);
this.label31.TabIndex = 22;
this.label31.Text = "Support expiration days left:";
//
// lSupportExpirationDaysTotal
//
this.lSupportExpirationDaysTotal.AutoSize = true;
this.lSupportExpirationDaysTotal.Location = new System.Drawing.Point(482, 330);
this.lSupportExpirationDaysTotal.Name = "lSupportExpirationDaysTotal";
this.lSupportExpirationDaysTotal.Size = new System.Drawing.Size(13, 13);
this.lSupportExpirationDaysTotal.TabIndex = 21;
this.lSupportExpirationDaysTotal.Text = "0";
//
// lSupportExpirationDate
//
this.lSupportExpirationDate.AutoSize = true;
this.lSupportExpirationDate.Location = new System.Drawing.Point(482, 295);
this.lSupportExpirationDate.Name = "lSupportExpirationDate";
this.lSupportExpirationDate.Size = new System.Drawing.Size(28, 13);
this.lSupportExpirationDate.TabIndex = 21;
this.lSupportExpirationDate.Text = "date";
//
// lSupportExpirationDaysLeft
//
this.lSupportExpirationDaysLeft.AutoSize = true;
this.lSupportExpirationDaysLeft.Location = new System.Drawing.Point(482, 347);
this.lSupportExpirationDaysLeft.Name = "lSupportExpirationDaysLeft";
this.lSupportExpirationDaysLeft.Size = new System.Drawing.Size(13, 13);
this.lSupportExpirationDaysLeft.TabIndex = 23;
this.lSupportExpirationDaysLeft.Text = "0";
//
// label35
//
this.label35.AutoSize = true;
this.label35.Location = new System.Drawing.Point(337, 312);
this.label35.Name = "label35";
this.label35.Size = new System.Drawing.Size(132, 13);
this.label35.TabIndex = 22;
this.label35.Text = "Support expiration version:";
//
// lSupportExpirationPPVersion
//
this.lSupportExpirationPPVersion.AutoSize = true;
this.lSupportExpirationPPVersion.Location = new System.Drawing.Point(482, 312);
this.lSupportExpirationPPVersion.Name = "lSupportExpirationPPVersion";
this.lSupportExpirationPPVersion.Size = new System.Drawing.Size(22, 13);
this.lSupportExpirationPPVersion.TabIndex = 23;
this.lSupportExpirationPPVersion.Text = "1.5";
//
// label37
//
this.label37.AutoSize = true;
this.label37.Location = new System.Drawing.Point(10, 387);
this.label37.Name = "label37";
this.label37.Size = new System.Drawing.Size(114, 13);
this.label37.TabIndex = 29;
this.label37.Text = "Purchase renewal link:";
//
// lRenewLicenseLink
//
this.lRenewLicenseLink.Location = new System.Drawing.Point(130, 387);
this.lRenewLicenseLink.Name = "lRenewLicenseLink";
this.lRenewLicenseLink.Size = new System.Drawing.Size(350, 13);
this.lRenewLicenseLink.TabIndex = 30;
this.lRenewLicenseLink.Text = "http://www.mysite.com/purchase2.html";
//
// label39
//
this.label39.AutoSize = true;
this.label39.Location = new System.Drawing.Point(10, 371);
this.label39.Name = "label39";
this.label39.Size = new System.Drawing.Size(110, 13);
this.label39.TabIndex = 29;
this.label39.Text = "Purchase license link:";
//
// lBuyNowLink
//
this.lBuyNowLink.Location = new System.Drawing.Point(130, 371);
this.lBuyNowLink.Name = "lBuyNowLink";
this.lBuyNowLink.Size = new System.Drawing.Size(350, 13);
this.lBuyNowLink.TabIndex = 30;
this.lBuyNowLink.Text = "http://www.mysite.com/purchase1.html";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(12, 457);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(79, 13);
this.label5.TabIndex = 26;
this.label5.Text = "Renewal code:";
//
// tbRenewalCode
//
this.tbRenewalCode.Location = new System.Drawing.Point(110, 454);
this.tbRenewalCode.Name = "tbRenewalCode";
this.tbRenewalCode.Size = new System.Drawing.Size(301, 20);
this.tbRenewalCode.TabIndex = 27;
//
// btnRenew
//
this.btnRenew.Location = new System.Drawing.Point(417, 454);
this.btnRenew.Name = "btnRenew";
this.btnRenew.Size = new System.Drawing.Size(75, 23);
this.btnRenew.TabIndex = 28;
this.btnRenew.Text = "Renew";
this.btnRenew.UseVisualStyleBackColor = true;
this.btnRenew.Click += new System.EventHandler(this.btnRenew_Click);
//
// lProtectionDate
//
this.lProtectionDate.Location = new System.Drawing.Point(142, 149);
this.lProtectionDate.Name = "lProtectionDate";
this.lProtectionDate.Size = new System.Drawing.Size(179, 13);
this.lProtectionDate.TabIndex = 41;
this.lProtectionDate.Text = "date";
//
// label26
//
this.label26.AutoSize = true;
this.label26.Location = new System.Drawing.Point(13, 149);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(82, 13);
this.label26.TabIndex = 40;
this.label26.Text = "Protection date:";
//
// btnRegistrationByEmail
//
this.btnRegistrationByEmail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRegistrationByEmail.Location = new System.Drawing.Point(547, 143);
this.btnRegistrationByEmail.Name = "btnRegistrationByEmail";
this.btnRegistrationByEmail.Size = new System.Drawing.Size(153, 23);
this.btnRegistrationByEmail.TabIndex = 42;
this.btnRegistrationByEmail.Text = "Registration By Email";
this.btnRegistrationByEmail.UseVisualStyleBackColor = true;
this.btnRegistrationByEmail.Click += new System.EventHandler(this.btnRegistrationByEmail_Click);
//
// FormMain
//
this.AcceptButton = this.btnOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(711, 535);
this.Controls.Add(this.btnRegistrationByEmail);
this.Controls.Add(this.lProtectionDate);
this.Controls.Add(this.label26);
this.Controls.Add(this.lLaunchesLeft);
this.Controls.Add(this.lLaunchesTotal);
this.Controls.Add(this.lTrialDaysLeft);
this.Controls.Add(this.lTrialDaysTotal);
this.Controls.Add(this.label29);
this.Controls.Add(this.label27);
this.Controls.Add(this.label21);
this.Controls.Add(this.label20);
this.Controls.Add(this.btnRenew);
this.Controls.Add(this.btnRegister);
this.Controls.Add(this.tbRenewalCode);
this.Controls.Add(this.tbLicenseCode);
this.Controls.Add(this.lCurrentRegistrationDate);
this.Controls.Add(this.label12);
this.Controls.Add(this.lFirstRegistrationDate);
this.Controls.Add(this.label10);
this.Controls.Add(this.lOrderDate);
this.Controls.Add(this.lCurrentActivationDate);
this.Controls.Add(this.label16);
this.Controls.Add(this.label7);
this.Controls.Add(this.lCurrentPPVersion);
this.Controls.Add(this.lCustomerEMail);
this.Controls.Add(this.lCustomerName);
this.Controls.Add(this.label25);
this.Controls.Add(this.label13);
this.Controls.Add(this.lIntelliProtectorVersion);
this.Controls.Add(this.lSupportExpirationPPVersion);
this.Controls.Add(this.lSupportExpirationDaysLeft);
this.Controls.Add(this.lLicenseExpirationDaysLeft);
this.Controls.Add(this.lSupportExpirationDate);
this.Controls.Add(this.lLicenseExpirationDate);
this.Controls.Add(this.lSupportExpirationDaysTotal);
this.Controls.Add(this.lLicenseExpirationDaysTotal);
this.Controls.Add(this.lBuyNowLink);
this.Controls.Add(this.lRenewLicenseLink);
this.Controls.Add(this.lLicenseCode);
this.Controls.Add(this.lLicenseType);
this.Controls.Add(this.label9);
this.Controls.Add(this.label14);
this.Controls.Add(this.label35);
this.Controls.Add(this.label31);
this.Controls.Add(this.label15);
this.Controls.Add(this.label5);
this.Controls.Add(this.label19);
this.Controls.Add(this.label24);
this.Controls.Add(this.label18);
this.Controls.Add(this.label23);
this.Controls.Add(this.label39);
this.Controls.Add(this.label11);
this.Controls.Add(this.label37);
this.Controls.Add(this.label17);
this.Controls.Add(this.label8);
this.Controls.Add(this.lIsProtected);
this.Controls.Add(this.label3);
this.Controls.Add(this.lTrialTimeUnitsLeft);
this.Controls.Add(this.lTrialTimeUnitsTotal);
this.Controls.Add(this.lIsRegistered);
this.Controls.Add(this.label6);
this.Controls.Add(this.label4);
this.Controls.Add(this.label2);
this.Controls.Add(this.btnSortArray);
this.Controls.Add(this.btnShowRegistation);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.label1);
this.Name = "FormMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FormMain. Sample .NET";
this.Load += new System.EventHandler(this.FormMain_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label lIsRegistered;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label lTrialTimeUnitsTotal;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label lTrialTimeUnitsLeft;
private System.Windows.Forms.Button btnShowRegistation;
private System.Windows.Forms.Button btnSortArray;
private System.Windows.Forms.Label lIsProtected;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lLicenseType;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Timer timerUpdateUnits;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label lCurrentActivationDate;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label lFirstRegistrationDate;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label lCurrentRegistrationDate;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label lCustomerName;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label lCustomerEMail;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label lLicenseExpirationDaysTotal;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label lLicenseExpirationDaysLeft;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label lLicenseCode;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.TextBox tbLicenseCode;
private System.Windows.Forms.Button btnRegister;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label lIntelliProtectorVersion;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label lOrderDate;
private System.Windows.Forms.Label lTrialDaysTotal;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.Label lTrialDaysLeft;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label lLicenseExpirationDate;
private System.Windows.Forms.Label label25;
private System.Windows.Forms.Label lCurrentPPVersion;
private System.Windows.Forms.Label label27;
private System.Windows.Forms.Label lLaunchesTotal;
private System.Windows.Forms.Label label29;
private System.Windows.Forms.Label lLaunchesLeft;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label31;
private System.Windows.Forms.Label lSupportExpirationDaysTotal;
private System.Windows.Forms.Label lSupportExpirationDate;
private System.Windows.Forms.Label lSupportExpirationDaysLeft;
private System.Windows.Forms.Label label35;
private System.Windows.Forms.Label lSupportExpirationPPVersion;
private System.Windows.Forms.Label label37;
private System.Windows.Forms.Label lRenewLicenseLink;
private System.Windows.Forms.Label label39;
private System.Windows.Forms.Label lBuyNowLink;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox tbRenewalCode;
private System.Windows.Forms.Button btnRenew;
private System.Windows.Forms.Label lProtectionDate;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.Button btnRegistrationByEmail;
}
}

View File

@@ -0,0 +1,201 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// == How to test this example ==
// 1. Build C# project (VS2010SampleNET)
// 2. Protect the VS2010SampleNET.exe with IntelliProtector
// 3. Start VS2010SampleNET.exe.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Text;
using System.Windows.Forms;
namespace VS2010SampleNET
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
}
private void btnOk_Click(object sender, EventArgs e)
{
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
Close();
}
private void btnSortArray_Click(object sender, EventArgs e)
{
try
{
SortArray();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
[IntelliProtectorService.attributes.Encrypt]
private void SortArray()
{
int[] array = new int[] { 10, 2, 3, 101, 3, 33, 7, 1 };
Array.Sort(array);
MessageBox.Show(@"Array is sorted");
}
private void FormMain_Load(object sender, EventArgs e)
{
try
{
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void UpdateControls()
{
lIsProtected.Text = IntelliProtectorService.IntelliProtector.IsSoftwareProtected() ? "yes" : "no";
lIsRegistered.Text = IntelliProtectorService.IntelliProtector.IsSoftwareRegistered() ? "yes" : "no";
lTrialTimeUnitsTotal.Text = string.Format("{0} mins | {1} hours | {2} days | {3} weeks | {4} months"
, IntelliProtectorService.IntelliProtector.GetTrialUnitsCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudMinutes)
, IntelliProtectorService.IntelliProtector.GetTrialUnitsCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudHours)
, IntelliProtectorService.IntelliProtector.GetTrialUnitsCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudDays)
, IntelliProtectorService.IntelliProtector.GetTrialUnitsCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudWeeks)
, IntelliProtectorService.IntelliProtector.GetTrialUnitsCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudMonths)
);
lLicenseType.Text = IntelliProtectorService.IntelliProtector.GetLicenseType().ToString();
int iDays = IntelliProtectorService.IntelliProtector.GetTrialDaysCount();
lTrialDaysTotal.Text = iDays.ToString();
iDays = IntelliProtectorService.IntelliProtector.GetTrialDaysLeftCount();
lTrialDaysLeft.Text = iDays.ToString();
iDays = IntelliProtectorService.IntelliProtector.GetLicenseExpirationDaysCount();
lLicenseExpirationDaysTotal.Text = iDays.ToString();
iDays = IntelliProtectorService.IntelliProtector.GetLicenseExpirationDaysLeftCount();
lLicenseExpirationDaysLeft.Text = iDays.ToString();
timerUpdateUnits_Tick(null, null);
lLaunchesTotal.Text = IntelliProtectorService.IntelliProtector.GetTrialLaunchesCount().ToString();
lLaunchesLeft.Text = IntelliProtectorService.IntelliProtector.GetTrialLaunchesLeftCount().ToString();
const int ciMaxBufferLen = 256;
StringBuilder stbBuffer = new StringBuilder(ciMaxBufferLen);
lBuyNowLink.Text = IntelliProtectorService.IntelliProtector.GetBuyNowLink();
lRenewLicenseLink.Text = IntelliProtectorService.IntelliProtector.GetRenewalPurchaseLink();
lCurrentPPVersion.Text = IntelliProtectorService.IntelliProtector.GetCurrentProductVersion();
lSupportExpirationPPVersion.Text = IntelliProtectorService.IntelliProtector.GetSupportExpirationProductVersion();
lLicenseCode.Text = IntelliProtectorService.IntelliProtector.GetLicenseCode();
lCustomerName.Text = IntelliProtectorService.IntelliProtector.GetCustomerName();
lCustomerEMail.Text = IntelliProtectorService.IntelliProtector.GetCustomerEMail();
lLicenseExpirationDaysTotal.Text = IntelliProtectorService.IntelliProtector.GetLicenseExpirationDaysCount().ToString();
lLicenseExpirationDaysLeft.Text = IntelliProtectorService.IntelliProtector.GetLicenseExpirationDaysLeftCount().ToString();
lSupportExpirationDaysTotal.Text = IntelliProtectorService.IntelliProtector.GetSupportExpirationDaysCount().ToString();
lSupportExpirationDaysLeft.Text = IntelliProtectorService.IntelliProtector.GetSupportExpirationDaysLeftCount().ToString();
DateTime dtOrder = IntelliProtectorService.IntelliProtector.GetOrderDate();
ShowDate(lOrderDate, dtOrder);
DateTime dtCurrentActivationDate = IntelliProtectorService.IntelliProtector.GetCurrentActivationDate();
ShowDate(lCurrentActivationDate, dtCurrentActivationDate);
DateTime dtFirstRegistrationDate = IntelliProtectorService.IntelliProtector.GetFirstRegistrationDate();
ShowDate(lFirstRegistrationDate, dtFirstRegistrationDate);
DateTime dtCurrentRegistrationDate = IntelliProtectorService.IntelliProtector.GetCurrentRegistrationDate();
ShowDate(lCurrentRegistrationDate, dtCurrentRegistrationDate);
DateTime dtProtectionDate = IntelliProtectorService.IntelliProtector.GetProtectionDate();
ShowDate(lProtectionDate, dtProtectionDate);
DateTime dtLicenseExpirationDate = IntelliProtectorService.IntelliProtector.GetLicenseExpirationDate();
ShowDate(lLicenseExpirationDate, dtLicenseExpirationDate);
DateTime dtSupportExpirationDate = IntelliProtectorService.IntelliProtector.GetSupportExpirationDate();
ShowDate(lSupportExpirationDate, dtSupportExpirationDate);
lIntelliProtectorVersion.Text = IntelliProtectorService.IntelliProtector.GetIntelliProtectorVersion();
}
private static void ShowDate(Control label, DateTime dt)
{
label.Text = (dt != DateTime.MinValue) ? string.Format("{0}.{1}.{2} {3}:{4}", dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute) : "Not applicable";
}
private void timerUpdateUnits_Tick(object sender, EventArgs e)
{
lTrialTimeUnitsLeft.Text = string.Format("{0} mins | {1} hours | {2} days | {3} weeks | {4} months"
, IntelliProtectorService.IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudMinutes)
, IntelliProtectorService.IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudHours)
, IntelliProtectorService.IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudDays)
, IntelliProtectorService.IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudWeeks)
, IntelliProtectorService.IntelliProtector.GetTrialUnitsLeftCount((int)IntelliProtectorService.IntelliProtector.enUnitDimension.eudMonths)
);
}
private void btnShowRegistation_Click(object sender, EventArgs e)
{
try
{
IntelliProtectorService.IntelliProtector.ShowRegistrationWindow();
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void btnRegister_Click(object sender, EventArgs e)
{
try
{
IntelliProtectorService.IntelliProtector.RegisterSoftware(tbLicenseCode.Text);
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void btnRenew_Click(object sender, EventArgs e)
{
try
{
IntelliProtectorService.IntelliProtector.RenewLicenseCode(tbRenewalCode.Text);
UpdateControls();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Text);
}
}
private void btnRegistrationByEmail_Click(object sender, EventArgs e)
{
using (FormRegistrationByEmail regByEmail = new FormRegistrationByEmail("VS2010 CS sample.dat"))
regByEmail.ShowDialog();
UpdateControls();
}
}
}

View File

@@ -0,0 +1,126 @@
<?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="timerUpdateUnits.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>51</value>
</metadata>
</root>

View File

@@ -0,0 +1,141 @@
namespace VS2010SampleNET
{
partial class FormRegistrationByEmail
{
/// <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.label1 = new System.Windows.Forms.Label();
this.tbLicenseCode = new System.Windows.Forms.TextBox();
this.btnSaveCertificate = new System.Windows.Forms.Button();
this.btnUseCertificate = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnClose = new System.Windows.Forms.Button();
this.lRegistrationStatus = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(74, 13);
this.label1.TabIndex = 0;
this.label1.Text = "License code:";
//
// tbLicenseCode
//
this.tbLicenseCode.Location = new System.Drawing.Point(92, 6);
this.tbLicenseCode.Name = "tbLicenseCode";
this.tbLicenseCode.Size = new System.Drawing.Size(347, 20);
this.tbLicenseCode.TabIndex = 1;
//
// btnSaveCertificate
//
this.btnSaveCertificate.Location = new System.Drawing.Point(127, 47);
this.btnSaveCertificate.Name = "btnSaveCertificate";
this.btnSaveCertificate.Size = new System.Drawing.Size(197, 23);
this.btnSaveCertificate.TabIndex = 2;
this.btnSaveCertificate.Text = "1. Save request certificate";
this.btnSaveCertificate.UseVisualStyleBackColor = true;
this.btnSaveCertificate.Click += new System.EventHandler(this.btnSaveCertificate_Click);
//
// btnUseCertificate
//
this.btnUseCertificate.Location = new System.Drawing.Point(127, 76);
this.btnUseCertificate.Name = "btnUseCertificate";
this.btnUseCertificate.Size = new System.Drawing.Size(197, 23);
this.btnUseCertificate.TabIndex = 2;
this.btnUseCertificate.Text = "2. Use response certificate";
this.btnUseCertificate.UseVisualStyleBackColor = true;
this.btnUseCertificate.Click += new System.EventHandler(this.btnUseCertificate_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.lRegistrationStatus);
this.groupBox1.Location = new System.Drawing.Point(12, 121);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(427, 73);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Registration status";
//
// btnClose
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnClose.Location = new System.Drawing.Point(181, 219);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(89, 23);
this.btnClose.TabIndex = 4;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// lRegistrationStatus
//
this.lRegistrationStatus.Location = new System.Drawing.Point(130, 27);
this.lRegistrationStatus.Name = "lRegistrationStatus";
this.lRegistrationStatus.Size = new System.Drawing.Size(166, 25);
this.lRegistrationStatus.TabIndex = 0;
this.lRegistrationStatus.Text = "status";
this.lRegistrationStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// FormRegistrationByEmail
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(451, 254);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnUseCertificate);
this.Controls.Add(this.btnSaveCertificate);
this.Controls.Add(this.tbLicenseCode);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormRegistrationByEmail";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Registration by e-mail";
this.Load += new System.EventHandler(this.FormRegistrationByEmail_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tbLicenseCode;
private System.Windows.Forms.Button btnSaveCertificate;
private System.Windows.Forms.Button btnUseCertificate;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label lRegistrationStatus;
private System.Windows.Forms.Button btnClose;
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Windows.Forms;
using IntelliProtectorService;
namespace VS2010SampleNET
{
public partial class FormRegistrationByEmail : Form
{
private readonly string _certificateName;
public FormRegistrationByEmail(string certificateName)
{
_certificateName = certificateName;
InitializeComponent();
}
private void btnSaveCertificate_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(tbLicenseCode.Text))
{
MessageBox.Show(@"Please specify the license code", @"License is empty");
return;
}
using(SaveFileDialog saveFileDialog = new SaveFileDialog())
{
saveFileDialog.FileName = _certificateName;
saveFileDialog.OverwritePrompt = true;
saveFileDialog.InitialDirectory = Application.StartupPath;
saveFileDialog.Filter = @"Data Files (*.dat)|*.dat|All Files (*.*)|*.*";
if (saveFileDialog.ShowDialog() != DialogResult.OK)
return;
bool result = IntelliProtector.CreateRegistrationRequestCertificate(saveFileDialog.FileName, tbLicenseCode.Text);
if (result == false)
MessageBox.Show(@"Error, certificate is not saved!");
}
}
private void btnUseCertificate_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.InitialDirectory = Application.StartupPath;
openFileDialog.Filter = @"Data Files (*.dat)|*.dat|All Files (*.*)|*.*";
if (openFileDialog.ShowDialog() != DialogResult.OK)
return;
bool result = IntelliProtector.UseRegistrationResponseCertificate(openFileDialog.FileName);
if (result == false)
MessageBox.Show(@"Error, certificate is not used!");
}
UpdateRegistrationStatus();
}
void UpdateRegistrationStatus()
{
lRegistrationStatus.Text = IntelliProtector.IsSoftwareRegistered() ? @"registered" : @"not registered";
}
private void btnClose_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void FormRegistrationByEmail_Load(object sender, EventArgs e)
{
UpdateRegistrationStatus();
}
}
}

View File

@@ -0,0 +1,120 @@
<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,930 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2010. IntelliProtector.com
// Web site: http://intelliprotector.com
// Version: v2.5
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace netprotector.api
{
internal delegate void dVoid_NoParams();
internal delegate void dVoid_BoolParam(out bool b1);
internal delegate void dVoid_IntParam(out int i1);
internal delegate void dVoid_2IntParam(out int i1, int i2);
internal delegate void dVoid_5IntParams(out int i1, out int i2, out int i3, out int i4, out int i5);
internal delegate void dVoid_StringBuilderParam([MarshalAs(UnmanagedType.LPWStr)] StringBuilder s1, int iMaxLength);
internal delegate void dBool_StringParam(out bool res, [MarshalAs(UnmanagedType.LPWStr)]String s1, int iMaxLength);
internal delegate void dBool_StringOnlyParam(out bool res, [MarshalAs(UnmanagedType.LPWStr)]String s1);
internal delegate void dBool_StringStringParam(out bool res, [MarshalAs(UnmanagedType.LPWStr)]String s1, [MarshalAs(UnmanagedType.LPWStr)]String s2);
}
namespace IntelliProtectorService.attributes
{
internal class Encrypt : Attribute { }
internal class GetBuyNowLinkAttribute : Attribute { }
internal class IsSoftwareProtectedAttribute : Attribute { }
internal class IsSoftwareRegisteredAttribute : Attribute { }
internal class GetTrialDaysCountAttribute : Attribute { }
internal class GetTrialUnitsCountAttribute : Attribute { }
internal class GetTrialDaysLeftCountAttribute : Attribute { }
internal class GetTrialUnitsLeftCountAttribute : Attribute { }
internal class GetTrialLaunchesCountAttribute : Attribute { }
internal class GetTrialLaunchesLeftCountAttribute : Attribute { }
internal class ShowRegistrationWindowAttribute : Attribute { }
internal class IsTrialElapsedAttribute : Attribute { }
internal class GetRenewalPurchaseLinkAttribute : Attribute { }
internal class GetLicenseTypeAttribute : Attribute { }
internal class GetLicenseExpirationDaysCountAttribute : Attribute { }
internal class GetLicenseExpirationDaysLeftCountAttribute : Attribute { }
internal class GetSupportExpirationDaysCountAttribute : Attribute { }
internal class GetSupportExpirationDaysLeftCountAttribute : Attribute { }
internal class GetCurrentProductVersionAttribute : Attribute { }
internal class GetCustomerNameAttribute : Attribute { }
internal class GetCustomerEMailAttribute : Attribute { }
internal class GetLicenseCodeAttribute : Attribute { }
internal class RegisterSoftwareAttribute : Attribute { }
internal class RenewLicenseCodeAttribute : Attribute { }
internal class GetCurrentActivationDateAttribute : Attribute { }
internal class GetCurrentRegistrationDateAttribute : Attribute { }
internal class GetFirstRegistrationDateAttribute : Attribute { }
internal class GetOrderDateAttribute : Attribute { }
internal class GetLicenseExpirationDateAttribute : Attribute { }
internal class GetProtectionDateAttribute : Attribute { }
internal class GetSupportExpirationDateAttribute : Attribute { }
internal class GetSupportExpirationProductVersionAttribute : Attribute { }
internal class GetIntelliProtectorVersionAttribute : Attribute { }
internal class CreateRegistrationRequestCertificateAttribute : Attribute { }
internal class UseRegistrationResponseCertificateAttribute : Attribute { }
internal class SystemFunction1Attribute : Attribute { }
}
namespace IntelliProtectorService
{
internal class IntelliProtector
{
public static double Version_2_5()
{
return 2.5f;
}
#if DEBUG
public static bool IsInDebugMode()
{
return true;
}
#endif
public enum enUnitDimension
{
eudMinutes,
eudHours,
eudDays,
eudWeeks,
eudMonths
};
private class Init32
{
[DllImport("JitHookCore.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Init")]
public static extern void Init();
};
private class Init64
{
[DllImport("JitHookCoreX64.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Init")]
public static extern void Init();
};
public static bool Init()
{
try
{
bool tryLoadX64 = false;
try
{
Init32.Init();
}
catch (BadImageFormatException)
{
tryLoadX64 = true;
}
if (tryLoadX64)
{
try
{
Init64.Init();
}
catch (BadImageFormatException)
{
return false;
}
}
return true;
}
catch (System.Exception)
{
return true;
}
}
#region GetBuyNowLink
[attributes.GetBuyNowLinkAttribute]
public static String GetBuyNowLink()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetBuyNowLinkTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetBuyNowLinkTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region IsSoftwareProtected
[attributes.IsSoftwareProtected]
public static bool IsSoftwareProtected()
{
UInt64 address = 0;
object[] obj = new object[] { false };
Type tp = typeof(netprotector.api.dVoid_BoolParam);
IsSoftwareProtectedTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void IsSoftwareProtectedTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(bool))
return;
obj[0] = false;
}
#endregion
#region IsSoftwareRegistered
[attributes.IsSoftwareRegistered]
public static bool IsSoftwareRegistered()
{
UInt64 address = 0;
object[] obj = new object[] { false };
Type tp = typeof(netprotector.api.dVoid_BoolParam);
IsSoftwareRegisteredTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void IsSoftwareRegisteredTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(bool))
return;
obj[0] = false;
}
#endregion
#region GetTrialDaysCount
[attributes.GetTrialDaysCount]
public static int GetTrialDaysCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialDaysCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
protected static void GetTrialDaysCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialUnitsCount
[attributes.GetTrialUnitsCount]
public static int GetTrialUnitsCount(int dimensions)
{
UInt64 address = 0;
object[] obj = new object[] { (int)0, dimensions };
Type tp = typeof(netprotector.api.dVoid_2IntParam);
GetTrialUnitsCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialUnitsCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) && obj[1].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialDaysLeftCount
[attributes.GetTrialDaysLeftCount]
public static int GetTrialDaysLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialDaysLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialDaysLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialUnitsLeftCount
[attributes.GetTrialUnitsLeftCount]
public static int GetTrialUnitsLeftCount(int dimension)
{
UInt64 address = 0;
object[] obj = new object[] { (int)0, dimension };
Type tp = typeof(netprotector.api.dVoid_2IntParam);
GetTrialUnitsLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialUnitsLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) && obj[1].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialLaunchesCount
[attributes.GetTrialLaunchesCount]
public static int GetTrialLaunchesCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialLaunchesCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialLaunchesCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetTrialLaunchesLeftCount
[attributes.GetTrialLaunchesLeftCount]
public static int GetTrialLaunchesLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetTrialLaunchesLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetTrialLaunchesLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region ShowRegistrationWindow
[attributes.ShowRegistrationWindow]
public static void ShowRegistrationWindow()
{
UInt64 address = 0;
Type tp = typeof(netprotector.api.dVoid_NoParams);
ShowRegistrationWindowTest(address, null, tp);
}
[attributes.Encrypt]
public static void ShowRegistrationWindowTest(UInt64 address, object[] obj, Type delegateType)
{
}
#endregion
#region IsTrialElapsed
[attributes.IsTrialElapsed]
public static bool IsTrialElapsed()
{
UInt64 address = 0;
object[] obj = new object[] { false };
Type tp = typeof(netprotector.api.dVoid_BoolParam);
IsTrialElapsedTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void IsTrialElapsedTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(bool))
return;
obj[0] = false;
}
#endregion
#region GetRenewalPurchaseLink
[attributes.GetRenewalPurchaseLink]
public static String GetRenewalPurchaseLink()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetRenewalPurchaseLinkTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetRenewalPurchaseLinkTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetLicenseType
[attributes.GetLicenseType]
public static int GetLicenseType()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetLicenseTypeTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetLicenseTypeTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetLicenseExpirationDaysCount
[attributes.GetLicenseExpirationDaysCount]
public static int GetLicenseExpirationDaysCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetLicenseExpirationDaysCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetLicenseExpirationDaysCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetLicenseExpirationDaysLeftCount
[attributes.GetLicenseExpirationDaysLeftCount]
public static int GetLicenseExpirationDaysLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetLicenseExpirationDaysLeftTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetLicenseExpirationDaysLeftTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetSupportExpirationDaysCount
[attributes.GetSupportExpirationDaysCount]
public static int GetSupportExpirationDaysCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetSupportExpirationDaysCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetSupportExpirationDaysCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetSupportExpirationDaysLeftCount
[attributes.GetSupportExpirationDaysLeftCount]
public static int GetSupportExpirationDaysLeftCount()
{
UInt64 address = 0;
object[] obj = new object[] { (int)0 };
Type tp = typeof(netprotector.api.dVoid_IntParam);
GetSupportExpirationDaysLeftCountTest(address, obj, tp);
return (int)obj[0];
}
[attributes.Encrypt]
public static void GetSupportExpirationDaysLeftCountTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int))
return;
obj[0] = -1;
}
#endregion
#region GetCurrentProductVersion
[attributes.GetCurrentProductVersion]
public static String GetCurrentProductVersion()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetCurrentProductVersionTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetCurrentProductVersionTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetCustomerName
[attributes.GetCustomerName]
public static String GetCustomerName()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetCustomerNameTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetCustomerNameTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetCustomerEMail
[attributes.GetCustomerEMail]
public static String GetCustomerEMail()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetCustomerEMailTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetCustomerEMailTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetLicenseCode
[attributes.GetLicenseCode]
public static String GetLicenseCode()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetLicenseCodeTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetLicenseCodeTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region RegisterSoftware
[attributes.RegisterSoftware]
public static bool RegisterSoftware(string licenseKey)
{
UInt64 address = 0;
bool res = false;
object[] obj = new object[] { res, licenseKey, licenseKey.Length };
Type tp = typeof(netprotector.api.dBool_StringParam);
RegisterSoftwareTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void RegisterSoftwareTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = false;
}
#endregion
#region RenewLicenseCode
[attributes.RenewLicenseCode]
public static bool RenewLicenseCode(string renewalCode)
{
UInt64 address = 0;
object[] obj = new object[] { false, renewalCode, renewalCode.Length };
Type tp = typeof(netprotector.api.dBool_StringParam);
RenewLicenseCodeTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void RenewLicenseCodeTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = false;
}
#endregion
#region GetCurrentActivationDate
[attributes.GetCurrentActivationDate]
public static DateTime GetCurrentActivationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetCurrentActivationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetCurrentActivationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetCurrentRegistrationDate
[attributes.GetCurrentRegistrationDate]
public static DateTime GetCurrentRegistrationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetCurrentRegistrationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetCurrentRegistrationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetFirstRegistrationDate
[attributes.GetFirstRegistrationDate]
public static DateTime GetFirstRegistrationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetFirstRegistrationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetFirstRegistrationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetOrderDate
[attributes.GetOrderDate]
public static DateTime GetOrderDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetOrderDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetOrderDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetLicenseExpirationDate
[attributes.GetLicenseExpirationDate]
public static DateTime GetLicenseExpirationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetLicenseExpirationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetLicenseExpirationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetProtectionDate
[attributes.GetProtectionDate]
public static DateTime GetProtectionDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetProtectionDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetProtectionDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetSupportExpirationDate
[attributes.GetSupportExpirationDate]
public static DateTime GetSupportExpirationDate()
{
UInt64 address = 0;
object[] obj = new object[] { 0, 0, 0, 0, 0 };
Type tp = typeof(netprotector.api.dVoid_5IntParams);
GetSupportExpirationDateTest(address, obj, tp);
if ((int)obj[0] < 0)
return DateTime.MinValue;
return new DateTime((int)obj[0], (int)obj[1], (int)obj[2], (int)obj[3], (int)obj[4], 0);
}
[attributes.Encrypt]
protected static void GetSupportExpirationDateTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(int) ||
obj[1].GetType() != typeof(int) ||
obj[2].GetType() != typeof(int) ||
obj[3].GetType() != typeof(int) ||
obj[4].GetType() != typeof(int))
{
return;
}
obj[0] = -1;
obj[1] = -1;
obj[2] = -1;
obj[3] = -1;
obj[4] = -1;
}
#endregion
#region GetSupportExpirationProductVersion
[attributes.GetSupportExpirationProductVersion]
public static String GetSupportExpirationProductVersion()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetSupportExpirationProductVersionTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetSupportExpirationProductVersionTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region GetIntelliProtectorVersion
[attributes.GetIntelliProtectorVersion]
public static String GetIntelliProtectorVersion()
{
UInt64 address = 0;
int ciMinLength = 0;
int ciMaxLength = 1024;
StringBuilder rValue = new StringBuilder(ciMaxLength);
object[] obj = new object[] { rValue, ciMaxLength - ciMinLength };
Type tp = typeof(netprotector.api.dVoid_StringBuilderParam);
GetIntelliProtectorVersionTest(address, obj, tp);
return rValue.ToString();
}
[attributes.Encrypt]
protected static void GetIntelliProtectorVersionTest(UInt64 address, object[] obj, Type delegateType)
{
if (obj[0].GetType() != typeof(StringBuilder))
return;
string strLink = "";
if ((int)obj[1] >= strLink.Length)
((StringBuilder)obj[0]).Append(strLink);
}
#endregion
#region CreateRegistrationRequestCertificate
[attributes.CreateRegistrationRequestCertificate]
public static bool CreateRegistrationRequestCertificate(string path, string licenseCode)
{
UInt64 address = 0;
bool res = false;
object[] obj = new object[] { res, path, licenseCode };
Type tp = typeof(netprotector.api.dBool_StringStringParam);
CreateRegistrationRequestCertificateTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void CreateRegistrationRequestCertificateTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = true;
}
#endregion
#region UseRegistrationResponseCertificate
[attributes.UseRegistrationResponseCertificate]
public static bool UseRegistrationResponseCertificate(string path)
{
UInt64 address = 0;
bool res = false;
object[] obj = new object[] { res, path };
Type tp = typeof(netprotector.api.dBool_StringOnlyParam);
UseRegistrationResponseCertificateTest(address, obj, tp);
return (bool)obj[0];
}
[attributes.Encrypt]
protected static void UseRegistrationResponseCertificateTest(UInt64 address, object[] obj, Type delegateType)
{
obj[0] = true;
}
#endregion
#region SystemFunction1
[attributes.SystemFunction1]
protected static void SystemFunction1(UInt64 address, object[] parameters, Type delegateType)
{
Delegate delegateFunc = Marshal.GetDelegateForFunctionPointer((IntPtr)address, delegateType);
delegateFunc.DynamicInvoke(parameters);
}
#endregion
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Windows.Forms;
using IntelliProtectorService;
namespace VS2010SampleNET
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
if (!IntelliProtector.Init())
{
MessageBox.Show(@"Cannot load protector module");
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormMain());
}
}
}

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VS2010SampleNET")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VS2010SampleNET")]
[assembly: AssemblyCopyright("Copyright © 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("91a67379-6bfb-45b4-ae9d-b22210819234")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.6.0.0")]
[assembly: AssemblyFileVersion("2.6.0.0")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VS2010SampleNET.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VS2010SampleNET.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VS2010SampleNET.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,35 @@
<Configuration>
<SettingsComponent>
<string />
<integer />
<boolean>
<setting name="SolutionAnalysisEnabled">False</setting>
</boolean>
</SettingsComponent>
<RecentFiles>
<RecentFiles>
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:FormMain.cs" caret="7517" fromTop="23" />
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:FormRegistrationByEmail.Designer.cs" caret="16" fromTop="0" />
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:IntelliProtector.cs" caret="27811" fromTop="33" />
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:FormRegistrationByEmail.cs" caret="1161" fromTop="12" />
</RecentFiles>
<RecentEdits>
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:FormMain.cs" caret="7744" fromTop="27" />
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:FormMain.cs" caret="7587" fromTop="27" />
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:FormMain.cs" caret="7514" fromTop="23" />
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:FormRegistrationByEmail.Designer.cs" caret="16" fromTop="0" />
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:FormRegistrationByEmail.cs" caret="79" fromTop="4" />
<File id="4F0D7244-BACD-44B6-AB93-9FA89A867B59/f:FormRegistrationByEmail.cs" caret="1161" fromTop="12" />
</RecentEdits>
</RecentFiles>
<NAntValidationSettings>
<NAntPath value="" />
</NAntValidationSettings>
<UnitTestRunner>
<Providers />
</UnitTestRunner>
<UnitTestRunnerNUnit>
<NUnitInstallDir>C:\Program Files (x86)\NUnit 2.4.8\bin\net-2.0\</NUnitInstallDir>
<UseAddins>Never</UseAddins>
</UnitTestRunnerNUnit>
</Configuration>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4F0D7244-BACD-44B6-AB93-9FA89A867B59}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VS2010SampleNET</RootNamespace>
<AssemblyName>VS2010SampleNET</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FormMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormMain.Designer.cs">
<DependentUpon>FormMain.cs</DependentUpon>
</Compile>
<Compile Include="FormRegistrationByEmail.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormRegistrationByEmail.Designer.cs">
<DependentUpon>FormRegistrationByEmail.cs</DependentUpon>
</Compile>
<Compile Include="IntelliProtector.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FormMain.resx">
<DependentUpon>FormMain.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FormRegistrationByEmail.resx">
<DependentUpon>FormRegistrationByEmail.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,26 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS2010SampleNET", "VS2010SampleNET.csproj", "{4F0D7244-BACD-44B6-AB93-9FA89A867B59}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4F0D7244-BACD-44B6-AB93-9FA89A867B59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F0D7244-BACD-44B6-AB93-9FA89A867B59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F0D7244-BACD-44B6-AB93-9FA89A867B59}.Debug|x86.ActiveCfg = Debug|x86
{4F0D7244-BACD-44B6-AB93-9FA89A867B59}.Debug|x86.Build.0 = Debug|x86
{4F0D7244-BACD-44B6-AB93-9FA89A867B59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F0D7244-BACD-44B6-AB93-9FA89A867B59}.Release|Any CPU.Build.0 = Release|Any CPU
{4F0D7244-BACD-44B6-AB93-9FA89A867B59}.Release|x86.ActiveCfg = Release|x86
{4F0D7244-BACD-44B6-AB93-9FA89A867B59}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

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

31
puttysrc/BE_ALL.C Normal file
View File

@@ -0,0 +1,31 @@
/*
* Linking module for PuTTY proper: list the available backends
* including ssh.
*/
#include <stdio.h>
#include "putty.h"
/*
* This appname is not strictly in the right place, since Plink
* also uses this module. However, Plink doesn't currently use any
* of the dialog-box sorts of things that make use of appname, so
* it shouldn't do any harm here. I'm trying to avoid having to
* have tiny little source modules containing nothing but
* declarations of appname, for as long as I can...
*/
const char *const appname = "PuTTY";
#ifdef TELNET_DEFAULT
const int be_default_protocol = PROT_TELNET;
#else
const int be_default_protocol = PROT_SSH;
#endif
struct backend_list backends[] = {
{PROT_SSH, "ssh", &ssh_backend},
{PROT_TELNET, "telnet", &telnet_backend},
{PROT_RLOGIN, "rlogin", &rlogin_backend},
{PROT_RAW, "raw", &raw_backend},
{0, NULL}
};

32
puttysrc/BE_ALL_S.C Normal file
View File

@@ -0,0 +1,32 @@
/*
* Linking module for PuTTY proper: list the available backends
* including ssh, plus the serial backend.
*/
#include <stdio.h>
#include "putty.h"
/*
* This appname is not strictly in the right place, since Plink
* also uses this module. However, Plink doesn't currently use any
* of the dialog-box sorts of things that make use of appname, so
* it shouldn't do any harm here. I'm trying to avoid having to
* have tiny little source modules containing nothing but
* declarations of appname, for as long as I can...
*/
const char *const appname = "PuTTY";
#ifdef TELNET_DEFAULT
const int be_default_protocol = PROT_TELNET;
#else
const int be_default_protocol = PROT_SSH;
#endif
struct backend_list backends[] = {
{PROT_SSH, "ssh", &ssh_backend},
{PROT_TELNET, "telnet", &telnet_backend},
{PROT_RLOGIN, "rlogin", &rlogin_backend},
{PROT_RAW, "raw", &raw_backend},
{PROT_SERIAL, "serial", &serial_backend},
{0, NULL}
};

16
puttysrc/BE_NONE.C Normal file
View File

@@ -0,0 +1,16 @@
/*
* Linking module for PSCP: list the available backends, but
* without accompanying function suites. Used only for name
* lookups.
*/
#include <stdio.h>
#include "putty.h"
struct backend_list backends[] = {
{PROT_SSH, "ssh", NULL},
{PROT_TELNET, "telnet", NULL},
{PROT_RLOGIN, "rlogin", NULL},
{PROT_RAW, "raw", NULL},
{0, NULL}
};

33
puttysrc/BE_NOSSH.C Normal file
View File

@@ -0,0 +1,33 @@
/*
* Linking module for PuTTYtel: list the available backends not
* including ssh.
*/
#include <stdio.h>
#include "putty.h"
const int be_default_protocol = PROT_TELNET;
const char *const appname = "PuTTYtel";
struct backend_list backends[] = {
{PROT_TELNET, "telnet", &telnet_backend},
{PROT_RLOGIN, "rlogin", &rlogin_backend},
{PROT_RAW, "raw", &raw_backend},
{0, NULL}
};
/*
* Stub implementations of functions not used in non-ssh versions.
*/
void random_save_seed(void)
{
}
void random_destroy_seed(void)
{
}
void noise_ultralight(unsigned long data)
{
}

34
puttysrc/BE_NOS_S.C Normal file
View File

@@ -0,0 +1,34 @@
/*
* Linking module for PuTTYtel: list the available backends not
* including ssh.
*/
#include <stdio.h>
#include "putty.h"
const int be_default_protocol = PROT_TELNET;
const char *const appname = "PuTTYtel";
struct backend_list backends[] = {
{PROT_TELNET, "telnet", &telnet_backend},
{PROT_RLOGIN, "rlogin", &rlogin_backend},
{PROT_RAW, "raw", &raw_backend},
{PROT_SERIAL, "serial", &serial_backend},
{0, NULL}
};
/*
* Stub implementations of functions not used in non-ssh versions.
*/
void random_save_seed(void)
{
}
void random_destroy_seed(void)
{
}
void noise_ultralight(unsigned long data)
{
}

113
puttysrc/BUILDSCR Normal file
View File

@@ -0,0 +1,113 @@
# -*- sh -*-
# Build script to construct a full distribution directory of PuTTY.
module putty
# Set up the arguments for the main make command.
set Makever -DSVN_REV=$(revision)
ifneq "$(!numeric $(revision))" "yes" set Makever $(Makever) -DMODIFIED
ifneq "$(RELEASE)" "" set Makever $(Makever) -DRELEASE=$(RELEASE)
ifneq "$(date)" "" set Makever $(Makever) -DSNAPSHOT=$(date)
set Makeargs VER="$(Makever)"
ifneq "$(XFLAGS)" "" set Makeargs $(Makeargs) XFLAGS="$(XFLAGS)"
ifneq "$(MAKEARGS)" "" set Makeargs $(Makeargs) $(MAKEARGS)
# Set up the version string for the docs build.
set Docmakeargs VERSION="PuTTY revision $(revision)"
ifneq "$(RELEASE)" "" set Docmakeargs VERSION="PuTTY release $(RELEASE)"
ifneq "$(date)" "" set Docmakeargs VERSION="PuTTY development snapshot $(date)"
# Set up the version string for the Unix source archive.
set Unxver r$(revision)
ifneq "$(RELEASE)" "" set Unxver $(RELEASE)
ifneq "$(date)" "" set Unxver $(date)
# Set up the various version strings for the installer.
set Iversion r$(revision)
set Iname PuTTY revision $(revision)
set Ivertext Revision $(revision)
set Irev $(revision)
set Ifilename putty-$(Iversion)-installer.exe
ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
ifneq "$(RELEASE)" "" set Iname PuTTY version $(RELEASE)
ifneq "$(RELEASE)" "" set Ivertext Release $(RELEASE)
ifneq "$(RELEASE)" "" set Irev 0
ifneq "$(RELEASE)" "" set Ifilename putty-$(RELEASE)-installer.exe
ifneq "$(date)" "" set Iversion $(date):r$(revision)
ifneq "$(date)" "" set Iname PuTTY development snapshot $(date):r$(revision)
ifneq "$(date)" "" set Ivertext Development snapshot $(date):r$(revision)
ifneq "$(date)" "" set Ifilename putty-$(date)-installer.exe
# Set up the version string for the installer.
set Iversion r$(revision)
ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
ifneq "$(date)" "" set Iversion $(date):r$(revision)
in putty do ./mksrcarc.sh
in putty do ./mkunxarc.sh $(Unxver)
in putty do perl mkfiles.pl
in putty/doc do make $(Docmakeargs) putty.hlp
in putty/doc do make $(Docmakeargs) chm
# Munge the installer script locally so that it reports the version
# we're really building.
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(AppVerName=).*$$/$$1$$a/' '$(Iname)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(VersionInfoTextVersion=).*$$/$$1$$a/' '$(Ivertext)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(AppVersion=).*$$/$$1$$a/' '$(Iversion)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;$$a=~s/M//;}s/^(VersionInfoVersion=\d+\.\d+\.)\d+(\.\d+)\r?$$/$$1$$a$$2/' '$(Irev)' putty.iss
# Windowsify LICENCE, since it's going in the Windows installer.
in putty do perl -i~ -pe 'y/\015//d;s/$$/\015/' LICENCE
delegate windows
# FIXME: Cygwin alternative?
in putty/windows do cmd /c vcvars32 \& nmake -f Makefile.vc $(Makeargs)
# Ignore exit code from hhc, in favour of seeing whether the .chm
# file was created. (Yuck; but hhc appears to return non-zero
# exit codes on whim.)
in putty/doc do hhc putty.hhp; test -f putty.chm
in putty/windows do iscc putty.iss
return putty/windows/*.exe
return putty/windows/*.map
return putty/doc/putty.chm
return putty/windows/Output/setup.exe
enddelegate
in putty/doc do make mostlyclean
in putty/doc do make $(Docmakeargs)
in putty/windows do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../doc/putty.chm ../doc/putty.hlp ../doc/putty.cnt
in putty/doc do zip puttydoc.zip *.html
# Deliver the actual PuTTY release directory into a subdir `putty'.
deliver putty/windows/*.exe putty/x86/$@
deliver putty/windows/putty.zip putty/x86/$@
deliver putty/windows/Output/setup.exe putty/x86/$(Ifilename)
deliver putty/doc/puttydoc.zip putty/$@
deliver putty/doc/putty.chm putty/$@
deliver putty/doc/putty.hlp putty/$@
deliver putty/doc/putty.cnt putty/$@
deliver putty/doc/puttydoc.txt putty/$@
deliver putty/doc/*.html putty/htmldoc/$@
deliver putty/putty-src.zip putty/$@
deliver putty/*.tar.gz putty/$@
# Deliver the map files alongside the `proper' release deliverables.
deliver putty/windows/*.map maps-x86/$@
# Deliver sign.sh, so that whoever has just built PuTTY (the
# snapshot scripts or me, depending) can conveniently sign it with
# whatever key they want.
deliver putty/sign.sh $@
# Building the md5sums file is most easily done in the destination
# directory.
in-dest putty do md5sum `\find * -type f -print` > md5sums
# And construct .htaccess files. One in the top-level directory,
# setting the MIME types for Windows help files and providing an
# appropriate link to the source archive:
in-dest putty do echo "AddType application/octet-stream .chm" >> .htaccess
in-dest putty do echo "AddType application/octet-stream .hlp" >> .htaccess
in-dest putty do echo "AddType application/octet-stream .cnt" >> .htaccess
in-dest putty do set -- putty*.tar.gz; for k in '' .DSA .RSA; do echo RedirectMatch temp '(.*/)'putty.tar.gz$$k\$$ '$$1'"$$1$$k" >> .htaccess; done
# And one in the x86 directory, providing a link for the installer.
in-dest putty/x86 do set -- putty*installer.exe; for k in '' .DSA .RSA; do echo RedirectMatch temp '(.*/)'putty-installer.exe$$k\$$ '$$1'"$$1$$k" >> .htaccess; done

154
puttysrc/CHARSET/CHARSET.H Normal file
View File

@@ -0,0 +1,154 @@
/*
* charset.h - header file for general character set conversion
* routines.
*/
#ifndef charset_charset_h
#define charset_charset_h
#include <stddef.h>
/*
* Enumeration that lists all the multibyte or single-byte
* character sets known to this library.
*/
typedef enum {
CS_NONE, /* used for reporting errors, etc */
CS_ISO8859_1,
CS_ISO8859_1_X11, /* X font encoding with VT100 glyphs */
CS_ISO8859_2,
CS_ISO8859_3,
CS_ISO8859_4,
CS_ISO8859_5,
CS_ISO8859_6,
CS_ISO8859_7,
CS_ISO8859_8,
CS_ISO8859_9,
CS_ISO8859_10,
CS_ISO8859_11,
CS_ISO8859_13,
CS_ISO8859_14,
CS_ISO8859_15,
CS_ISO8859_16,
CS_CP437,
CS_CP850,
CS_CP866,
CS_CP1250,
CS_CP1251,
CS_CP1252,
CS_CP1253,
CS_CP1254,
CS_CP1255,
CS_CP1256,
CS_CP1257,
CS_CP1258,
CS_KOI8_R,
CS_KOI8_U,
CS_MAC_ROMAN,
CS_MAC_TURKISH,
CS_MAC_CROATIAN,
CS_MAC_ICELAND,
CS_MAC_ROMANIAN,
CS_MAC_GREEK,
CS_MAC_CYRILLIC,
CS_MAC_THAI,
CS_MAC_CENTEURO,
CS_MAC_SYMBOL,
CS_MAC_DINGBATS,
CS_MAC_ROMAN_OLD,
CS_MAC_CROATIAN_OLD,
CS_MAC_ICELAND_OLD,
CS_MAC_ROMANIAN_OLD,
CS_MAC_GREEK_OLD,
CS_MAC_CYRILLIC_OLD,
CS_MAC_UKRAINE,
CS_MAC_VT100,
CS_MAC_VT100_OLD,
CS_VISCII,
CS_HP_ROMAN8,
CS_DEC_MCS,
CS_UTF8
} charset_t;
typedef struct {
unsigned long s0;
} charset_state;
/*
* Routine to convert a MB/SB character set to Unicode.
*
* This routine accepts some number of bytes, updates a state
* variable, and outputs some number of Unicode characters. There
* are no guarantees. You can't even guarantee that at most one
* Unicode character will be output per byte you feed in; for
* example, suppose you're reading UTF-8, you've seen E1 80, and
* then you suddenly see FE. Now you need to output _two_ error
* characters - one for the incomplete sequence E1 80, and one for
* the completely invalid UTF-8 byte FE.
*
* Returns the number of wide characters output; will never output
* more than the size of the buffer (as specified on input).
* Advances the `input' pointer and decrements `inlen', to indicate
* how far along the input string it got.
*
* The sequence of `errlen' wide characters pointed to by `errstr'
* will be used to indicate a conversion error. If `errstr' is
* NULL, `errlen' will be ignored, and the library will choose
* something sensible to do on its own. For Unicode, this will be
* U+FFFD (REPLACEMENT CHARACTER).
*/
int charset_to_unicode(char **input, int *inlen, wchar_t *output, int outlen,
int charset, charset_state *state,
const wchar_t *errstr, int errlen);
/*
* Routine to convert Unicode to an MB/SB character set.
*
* This routine accepts some number of Unicode characters, updates
* a state variable, and outputs some number of bytes.
*
* Returns the number of bytes characters output; will never output
* more than the size of the buffer (as specified on input), and
* will never output a partial MB character. Advances the `input'
* pointer and decrements `inlen', to indicate how far along the
* input string it got.
*
* The sequence of `errlen' characters pointed to by `errstr' will
* be used to indicate a conversion error. If `errstr' is NULL,
* `errlen' will be ignored, and the library will choose something
* sensible to do on its own (which will vary depending on the
* output charset).
*/
int charset_from_unicode(wchar_t **input, int *inlen, char *output, int outlen,
int charset, charset_state *state,
const char *errstr, int errlen);
/*
* Convert X11 encoding names to and from our charset identifiers.
*/
const char *charset_to_xenc(int charset);
int charset_from_xenc(const char *name);
/*
* Convert MIME encoding names to and from our charset identifiers.
*/
const char *charset_to_mimeenc(int charset);
int charset_from_mimeenc(const char *name);
/*
* Convert our own encoding names to and from our charset
* identifiers.
*/
const char *charset_to_localenc(int charset);
int charset_from_localenc(const char *name);
int charset_localenc_nth(int n);
/*
* Convert Mac OS script/region/font to our charset identifiers.
*/
int charset_from_macenc(int script, int region, int sysvers,
const char *fontname);
#endif /* charset_charset_h */

19
puttysrc/CHARSET/ENUM.C Normal file
View File

@@ -0,0 +1,19 @@
/*
* enum.c - enumerate all charsets defined by the library.
*
* This file maintains a list of every other source file which
* contains ENUM_CHARSET definitions. It #includes each one with
* ENUM_CHARSETS defined, which causes those source files to do
* nothing at all except call the ENUM_CHARSET macro on each
* charset they define.
*
* This file in turn is included from various other places, with
* the ENUM_CHARSET macro defined to various different things. This
* allows us to have multiple implementations of the master charset
* lookup table (a static one and a dynamic one).
*/
#define ENUM_CHARSETS
#include "sbcsdat.c"
#include "utf8.c"
#undef ENUM_CHARSETS

View File

@@ -0,0 +1,91 @@
/*
* fromucs.c - convert Unicode to other character sets.
*/
#include "charset.h"
#include "internal.h"
struct charset_emit_param {
char *output;
int outlen;
const char *errstr;
int errlen;
int stopped;
};
static void charset_emit(void *ctx, long int output)
{
struct charset_emit_param *param = (struct charset_emit_param *)ctx;
char outval;
char const *p;
int outlen;
if (output == ERROR) {
p = param->errstr;
outlen = param->errlen;
} else {
outval = output;
p = &outval;
outlen = 1;
}
if (param->outlen >= outlen) {
while (outlen > 0) {
*param->output++ = *p++;
param->outlen--;
outlen--;
}
} else {
param->stopped = 1;
}
}
int charset_from_unicode(wchar_t **input, int *inlen, char *output, int outlen,
int charset, charset_state *state,
const char *errstr, int errlen)
{
charset_spec const *spec = charset_find_spec(charset);
charset_state localstate;
struct charset_emit_param param;
param.output = output;
param.outlen = outlen;
param.stopped = 0;
/*
* charset_emit will expect a valid errstr.
*/
if (!errstr) {
/* *shrug* this is good enough, and consistent across all SBCS... */
param.errstr = ".";
param.errlen = 1;
}
param.errstr = errstr;
param.errlen = errlen;
if (!state) {
localstate.s0 = 0;
} else {
localstate = *state; /* structure copy */
}
state = &localstate;
while (*inlen > 0) {
int lenbefore = param.output - output;
spec->write(spec, **input, &localstate, charset_emit, &param);
if (param.stopped) {
/*
* The emit function has _tried_ to output some
* characters, but ran up against the end of the
* buffer. Leave immediately, and return what happened
* _before_ attempting to process this character.
*/
return lenbefore;
}
if (state)
*state = localstate; /* structure copy */
(*input)++;
(*inlen)--;
}
return param.output - output;
}

View File

@@ -0,0 +1,89 @@
/*
* internal.h - internal header stuff for the charset library.
*/
#ifndef charset_internal_h
#define charset_internal_h
/* This invariably comes in handy */
#define lenof(x) ( sizeof((x)) / sizeof(*(x)) )
/* This is an invalid Unicode value used to indicate an error. */
#define ERROR 0xFFFFL /* Unicode value representing error */
typedef struct charset_spec charset_spec;
typedef struct sbcs_data sbcs_data;
struct charset_spec {
int charset; /* numeric identifier */
/*
* A function to read the character set and output Unicode
* characters. The `emit' function expects to get Unicode chars
* passed to it; it should be sent ERROR for any encoding error
* on the input.
*/
void (*read)(charset_spec const *charset, long int input_chr,
charset_state *state,
void (*emit)(void *ctx, long int output), void *emitctx);
/*
* A function to read Unicode characters and output in this
* character set. The `emit' function expects to get byte
* values passed to it; it should be sent ERROR for any
* non-representable characters on the input.
*/
void (*write)(charset_spec const *charset, long int input_chr,
charset_state *state,
void (*emit)(void *ctx, long int output), void *emitctx);
void const *data;
};
/*
* This is the format of `data' used by the SBCS read and write
* functions; so it's the format used in all SBCS definitions.
*/
struct sbcs_data {
/*
* This is a simple mapping table converting each SBCS position
* to a Unicode code point. Some positions may contain ERROR,
* indicating that that byte value is not defined in the SBCS
* in question and its occurrence in input is an error.
*/
unsigned long sbcs2ucs[256];
/*
* This lookup table is used to convert Unicode back to the
* SBCS. It consists of the valid byte values in the SBCS,
* sorted in order of their Unicode translation. So given a
* Unicode value U, you can do a binary search on this table
* using the above table as a lookup: when testing the Xth
* position in this table, you branch according to whether
* sbcs2ucs[ucs2sbcs[X]] is less than, greater than, or equal
* to U.
*
* Note that since there may be fewer than 256 valid byte
* values in a particular SBCS, we must supply the length of
* this table as well as the contents.
*/
unsigned char ucs2sbcs[256];
int nvalid;
};
/*
* Prototypes for internal library functions.
*/
charset_spec const *charset_find_spec(int charset);
void read_sbcs(charset_spec const *charset, long int input_chr,
charset_state *state,
void (*emit)(void *ctx, long int output), void *emitctx);
void write_sbcs(charset_spec const *charset, long int input_chr,
charset_state *state,
void (*emit)(void *ctx, long int output), void *emitctx);
/*
* Placate compiler warning about unused parameters, of which we
* expect to have some in this library.
*/
#define UNUSEDARG(x) ( (x) = (x) )
#endif /* charset_internal_h */

125
puttysrc/CHARSET/LOCALENC.C Normal file
View File

@@ -0,0 +1,125 @@
/*
* local.c - translate our internal character set codes to and from
* our own set of plausibly legible character-set names. Also
* provides a canonical name for each encoding (useful for software
* announcing what character set it will be using), and a set of
* enumeration functions which return a list of supported
* encodings one by one.
*
* charset_from_localenc will attempt all other text translations
* as well as this table, to maximise the number of different ways
* you can select a supported charset.
*/
#include <ctype.h>
#include "charset.h"
#include "internal.h"
static const struct {
const char *name;
int charset;
int return_in_enum; /* enumeration misses some charsets */
} localencs[] = {
{ "<UNKNOWN>", CS_NONE, 0 },
{ "ISO-8859-1", CS_ISO8859_1, 1 },
{ "ISO-8859-1 with X11 line drawing", CS_ISO8859_1_X11, 0 },
{ "ISO-8859-2", CS_ISO8859_2, 1 },
{ "ISO-8859-3", CS_ISO8859_3, 1 },
{ "ISO-8859-4", CS_ISO8859_4, 1 },
{ "ISO-8859-5", CS_ISO8859_5, 1 },
{ "ISO-8859-6", CS_ISO8859_6, 1 },
{ "ISO-8859-7", CS_ISO8859_7, 1 },
{ "ISO-8859-8", CS_ISO8859_8, 1 },
{ "ISO-8859-9", CS_ISO8859_9, 1 },
{ "ISO-8859-10", CS_ISO8859_10, 1 },
{ "ISO-8859-11", CS_ISO8859_11, 1 },
{ "ISO-8859-13", CS_ISO8859_13, 1 },
{ "ISO-8859-14", CS_ISO8859_14, 1 },
{ "ISO-8859-15", CS_ISO8859_15, 1 },
{ "ISO-8859-16", CS_ISO8859_16, 1 },
{ "CP437", CS_CP437, 1 },
{ "CP850", CS_CP850, 1 },
{ "CP866", CS_CP866, 1 },
{ "CP1250", CS_CP1250, 1 },
{ "CP1251", CS_CP1251, 1 },
{ "CP1252", CS_CP1252, 1 },
{ "CP1253", CS_CP1253, 1 },
{ "CP1254", CS_CP1254, 1 },
{ "CP1255", CS_CP1255, 1 },
{ "CP1256", CS_CP1256, 1 },
{ "CP1257", CS_CP1257, 1 },
{ "CP1258", CS_CP1258, 1 },
{ "KOI8-R", CS_KOI8_R, 1 },
{ "KOI8-U", CS_KOI8_U, 1 },
{ "Mac Roman", CS_MAC_ROMAN, 1 },
{ "Mac Turkish", CS_MAC_TURKISH, 1 },
{ "Mac Croatian", CS_MAC_CROATIAN, 1 },
{ "Mac Iceland", CS_MAC_ICELAND, 1 },
{ "Mac Romanian", CS_MAC_ROMANIAN, 1 },
{ "Mac Greek", CS_MAC_GREEK, 1 },
{ "Mac Cyrillic", CS_MAC_CYRILLIC, 1 },
{ "Mac Thai", CS_MAC_THAI, 1 },
{ "Mac Centeuro", CS_MAC_CENTEURO, 1 },
{ "Mac Symbol", CS_MAC_SYMBOL, 1 },
{ "Mac Dingbats", CS_MAC_DINGBATS, 1 },
{ "Mac Roman (old)", CS_MAC_ROMAN_OLD, 0 },
{ "Mac Croatian (old)", CS_MAC_CROATIAN_OLD, 0 },
{ "Mac Iceland (old)", CS_MAC_ICELAND_OLD, 0 },
{ "Mac Romanian (old)", CS_MAC_ROMANIAN_OLD, 0 },
{ "Mac Greek (old)", CS_MAC_GREEK_OLD, 0 },
{ "Mac Cyrillic (old)", CS_MAC_CYRILLIC_OLD, 0 },
{ "Mac Ukraine", CS_MAC_UKRAINE, 1 },
{ "Mac VT100", CS_MAC_VT100, 1 },
{ "Mac VT100 (old)", CS_MAC_VT100_OLD, 0 },
{ "VISCII", CS_VISCII, 1 },
{ "HP ROMAN8", CS_HP_ROMAN8, 1 },
{ "DEC MCS", CS_DEC_MCS, 1 },
{ "UTF-8", CS_UTF8, 1 },
};
const char *charset_to_localenc(int charset)
{
int i;
for (i = 0; i < (int)lenof(localencs); i++)
if (charset == localencs[i].charset)
return localencs[i].name;
return NULL; /* not found */
}
int charset_from_localenc(const char *name)
{
int i;
if ( (i = charset_from_mimeenc(name)) != CS_NONE)
return i;
if ( (i = charset_from_xenc(name)) != CS_NONE)
return i;
for (i = 0; i < (int)lenof(localencs); i++) {
const char *p, *q;
p = name;
q = localencs[i].name;
while (*p || *q) {
if (tolower(*p) != tolower(*q))
break;
p++; q++;
}
if (!*p && !*q)
return localencs[i].charset;
}
return CS_NONE; /* not found */
}
int charset_localenc_nth(int n)
{
int i;
for (i = 0; i < (int)lenof(localencs); i++)
if (localencs[i].return_in_enum && !n--)
return localencs[i].charset;
return CS_NONE; /* end of list */
}

169
puttysrc/CHARSET/MACENC.C Normal file
View File

@@ -0,0 +1,169 @@
/* $Id: macenc.c 4787 2004-11-16 15:27:00Z simon $ */
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/*
* macenc.c -- Convert a Mac OS script/region/font combination to our
* internal charset code.
*/
#include <string.h>
#include "charset.h"
#include "internal.h"
/*
* These are defined by Mac OS's <Script.h>, but we'd like to be
* independent of that.
*/
#define smRoman 0
#define smJapanese 1
#define smTradChinese 2
#define smKorean 3
#define smArabic 4
#define smHebrew 5
#define smCyrillic 7
#define smDevenagari 9
#define smGurmukhi 10
#define smGujurati 11
#define smThai 21
#define smSimpChinese 25
#define smTibetan 26
#define smEthiopic 28
#define smCentralEuroRoman 29
#define verGreece 20
#define verIceland 21
#define verTurkey 24
#define verYugoCroatian 25
#define verRomania 39
#define verFaroeIsl 47
#define verIran 48
#define verRussia 49
#define verSlovenian 66
#define verCroatia 68
#define verBulgaria 72
#define verScottishGaelic 75
#define verManxGaelic 76
#define verBreton 77
#define verNunavut 78
#define verWelsh 79
#define verIrishGaelicScript 81
static const struct {
int script;
int region;
int sysvermin;
char const *fontname;
int charset;
} macencs[] = {
{ smRoman, -1, 0x850, "VT100", CS_MAC_VT100 },
{ smRoman, -1, 0, "VT100", CS_MAC_VT100_OLD },
/*
* From here on, this table is largely derived from
* <http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT>,
* with _OLD version added based on the comments in individual
* mapping files.
*/
{ smRoman, -1, 0, "Symbol", CS_MAC_SYMBOL },
{ smRoman, -1, 0, "Zapf Dingbats", CS_MAC_DINGBATS },
{ smRoman, verTurkey, 0, NULL, CS_MAC_TURKISH },
{ smRoman, verYugoCroatian, 0x850, NULL, CS_MAC_CROATIAN },
{ smRoman, verYugoCroatian, 0, NULL, CS_MAC_CROATIAN_OLD },
{ smRoman, verSlovenian, 0x850, NULL, CS_MAC_CROATIAN },
{ smRoman, verSlovenian, 0, NULL, CS_MAC_CROATIAN_OLD },
{ smRoman, verCroatia, 0x850, NULL, CS_MAC_CROATIAN },
{ smRoman, verCroatia, 0, NULL, CS_MAC_CROATIAN_OLD },
{ smRoman, verIceland, 0x850, NULL, CS_MAC_ICELAND },
{ smRoman, verIceland, 0, NULL, CS_MAC_ICELAND_OLD },
{ smRoman, verFaroeIsl, 0x850, NULL, CS_MAC_ICELAND },
{ smRoman, verFaroeIsl, 0, NULL, CS_MAC_ICELAND_OLD },
{ smRoman, verRomania, 0x850, NULL, CS_MAC_ROMANIAN },
{ smRoman, verRomania, 0, NULL, CS_MAC_ROMANIAN_OLD },
#if 0 /* No mapping table on ftp.unicode.org */
{ smRoman, verIreland, 0x850, NULL, CS_MAC_CELTIC },
{ smRoman, verIreland, 0, NULL, CS_MAC_CELTIC_OLD },
{ smRoman, verScottishGaelic, 0x850, NULL, CS_MAC_CELTIC },
{ smRoman, verScottishGaelic, 0, NULL, CS_MAC_CELTIC_OLD },
{ smRoman, verManxGaelic, 0x850, NULL, CS_MAC_CELTIC },
{ smRoman, verManxGaelic, 0, NULL, CS_MAC_CELTIC_OLD },
{ smRoman, verBreton, 0x850, NULL, CS_MAC_CELTIC },
{ smRoman, verBreton, 0, NULL, CS_MAC_CELTIC_OLD },
{ smRoman, verWelsh, 0x850, NULL, CS_MAC_CELTIC },
{ smRoman, verWelsh, 0, NULL, CS_MAC_CELTIC_OLD },
{ smRoman, verIrishGaelicScript, 0x850, NULL, CS_MAC_GAELIC },
{ smRoman, verIrishGaelicScript, 0, NULL, CS_MAC_GAELIC_OLD },
#endif
{ smRoman, verGreece, 0x922, NULL, CS_MAC_GREEK },
{ smRoman, verGreece, 0, NULL, CS_MAC_GREEK_OLD },
{ smRoman, -1, 0x850, NULL, CS_MAC_ROMAN },
{ smRoman, -1, 0, NULL, CS_MAC_ROMAN_OLD },
#if 0 /* Multi-byte encodings, not yet supported */
{ smJapanese, -1, 0, NULL, CS_MAC_JAPANESE },
{ smTradChinese, -1, 0, NULL, CS_MAC_CHINTRAD },
{ smKorean, -1, 0, NULL, CS_MAC_KOREAN },
#endif
#if 0 /* Bidirectional encodings, not yet supported */
{ smArabic, verIran, 0, NULL, CS_MAC_FARSI },
{ smArabic, -1, 0, NULL, CS_MAC_ARABIC },
{ smHebrew, -1, 0, NULL, CS_MAC_HEBREW },
#endif
{ smCyrillic, -1, 0x900, NULL, CS_MAC_CYRILLIC },
{ smCyrillic, verRussia, 0, NULL, CS_MAC_CYRILLIC_OLD },
{ smCyrillic, verBulgaria, 0, NULL, CS_MAC_CYRILLIC_OLD },
{ smCyrillic, -1, 0, NULL, CS_MAC_UKRAINE },
#if 0 /* Complex Indic scripts, not yet supported */
{ smDevanagari, -1, 0, NULL, CS_MAC_DEVENAGA },
{ smGurmukhi, -1, 0, NULL, CS_MAC_GURMUKHI },
{ smGujurati, -1, 0, NULL, CS_MAC_GUJURATI },
#endif
{ smThai, -1, 0, NULL, CS_MAC_THAI },
#if 0 /* Multi-byte encoding, not yet supported */
{ smSimpChinese, -1, 0, NULL, CS_MAC_CHINSIMP },
#endif
#if 0 /* No mapping table on ftp.unicode.org */
{ smTibetan, -1, 0, NULL, CS_MAC_TIBETAN },
{ smEthiopic, -1, 0, NULL, CS_MAC_ETHIOPIC },
{ smEthiopic, verNanavut, 0, NULL, CS_MAC_INUIT },
#endif
{ smCentralEuroRoman, -1, 0, NULL, CS_MAC_CENTEURO },
};
int charset_from_macenc(int script, int region, int sysvers,
char const *fontname)
{
int i;
for (i = 0; i < (int)lenof(macencs); i++)
if ((macencs[i].script == script) &&
(macencs[i].region < 0 || macencs[i].region == region) &&
(macencs[i].sysvermin <= sysvers) &&
(macencs[i].fontname == NULL ||
(fontname != NULL && strcmp(macencs[i].fontname, fontname) == 0)))
return macencs[i].charset;
return CS_NONE;
}

214
puttysrc/CHARSET/MIMEENC.C Normal file
View File

@@ -0,0 +1,214 @@
/*
* mimeenc.c - translate our internal character set codes to and
* from MIME standard character-set names.
*
*/
#include <ctype.h>
#include "charset.h"
#include "internal.h"
static const struct {
const char *name;
int charset;
} mimeencs[] = {
/*
* These names are taken from
*
* http://www.iana.org/assignments/character-sets
*
* Where multiple encoding names map to the same encoding id
* (such as the variety of aliases for ISO-8859-1), the first
* is considered canonical and will be returned when
* translating the id to a string.
*/
{ "ISO-8859-1", CS_ISO8859_1 },
{ "iso-ir-100", CS_ISO8859_1 },
{ "ISO_8859-1", CS_ISO8859_1 },
{ "ISO_8859-1:1987", CS_ISO8859_1 },
{ "latin1", CS_ISO8859_1 },
{ "l1", CS_ISO8859_1 },
{ "IBM819", CS_ISO8859_1 },
{ "CP819", CS_ISO8859_1 },
{ "csISOLatin1", CS_ISO8859_1 },
{ "ISO-8859-2", CS_ISO8859_2 },
{ "ISO_8859-2:1987", CS_ISO8859_2 },
{ "iso-ir-101", CS_ISO8859_2 },
{ "ISO_8859-2", CS_ISO8859_2 },
{ "latin2", CS_ISO8859_2 },
{ "l2", CS_ISO8859_2 },
{ "csISOLatin2", CS_ISO8859_2 },
{ "ISO-8859-3", CS_ISO8859_3 },
{ "ISO_8859-3:1988", CS_ISO8859_3 },
{ "iso-ir-109", CS_ISO8859_3 },
{ "ISO_8859-3", CS_ISO8859_3 },
{ "latin3", CS_ISO8859_3 },
{ "l3", CS_ISO8859_3 },
{ "csISOLatin3", CS_ISO8859_3 },
{ "ISO-8859-4", CS_ISO8859_4 },
{ "ISO_8859-4:1988", CS_ISO8859_4 },
{ "iso-ir-110", CS_ISO8859_4 },
{ "ISO_8859-4", CS_ISO8859_4 },
{ "latin4", CS_ISO8859_4 },
{ "l4", CS_ISO8859_4 },
{ "csISOLatin4", CS_ISO8859_4 },
{ "ISO-8859-5", CS_ISO8859_5 },
{ "ISO_8859-5:1988", CS_ISO8859_5 },
{ "iso-ir-144", CS_ISO8859_5 },
{ "ISO_8859-5", CS_ISO8859_5 },
{ "cyrillic", CS_ISO8859_5 },
{ "csISOLatinCyrillic", CS_ISO8859_5 },
{ "ISO-8859-6", CS_ISO8859_6 },
{ "ISO_8859-6:1987", CS_ISO8859_6 },
{ "iso-ir-127", CS_ISO8859_6 },
{ "ISO_8859-6", CS_ISO8859_6 },
{ "ECMA-114", CS_ISO8859_6 },
{ "ASMO-708", CS_ISO8859_6 },
{ "arabic", CS_ISO8859_6 },
{ "csISOLatinArabic", CS_ISO8859_6 },
{ "ISO-8859-7", CS_ISO8859_7 },
{ "ISO_8859-7:1987", CS_ISO8859_7 },
{ "iso-ir-126", CS_ISO8859_7 },
{ "ISO_8859-7", CS_ISO8859_7 },
{ "ELOT_928", CS_ISO8859_7 },
{ "ECMA-118", CS_ISO8859_7 },
{ "greek", CS_ISO8859_7 },
{ "greek8", CS_ISO8859_7 },
{ "csISOLatinGreek", CS_ISO8859_7 },
{ "ISO-8859-8", CS_ISO8859_8 },
{ "ISO_8859-8:1988", CS_ISO8859_8 },
{ "iso-ir-138", CS_ISO8859_8 },
{ "ISO_8859-8", CS_ISO8859_8 },
{ "hebrew", CS_ISO8859_8 },
{ "csISOLatinHebrew", CS_ISO8859_8 },
{ "ISO-8859-9", CS_ISO8859_9 },
{ "ISO_8859-9:1989", CS_ISO8859_9 },
{ "iso-ir-148", CS_ISO8859_9 },
{ "ISO_8859-9", CS_ISO8859_9 },
{ "latin5", CS_ISO8859_9 },
{ "l5", CS_ISO8859_9 },
{ "csISOLatin5", CS_ISO8859_9 },
{ "ISO-8859-10", CS_ISO8859_10 },
{ "iso-ir-157", CS_ISO8859_10 },
{ "l6", CS_ISO8859_10 },
{ "ISO_8859-10:1992", CS_ISO8859_10 },
{ "csISOLatin6", CS_ISO8859_10 },
{ "latin6", CS_ISO8859_10 },
{ "ISO-8859-13", CS_ISO8859_13 },
{ "ISO-8859-14", CS_ISO8859_14 },
{ "iso-ir-199", CS_ISO8859_14 },
{ "ISO_8859-14:1998", CS_ISO8859_14 },
{ "ISO_8859-14", CS_ISO8859_14 },
{ "latin8", CS_ISO8859_14 },
{ "iso-celtic", CS_ISO8859_14 },
{ "l8", CS_ISO8859_14 },
{ "ISO-8859-15", CS_ISO8859_15 },
{ "ISO_8859-15", CS_ISO8859_15 },
{ "Latin-9", CS_ISO8859_15 },
{ "ISO-8859-16", CS_ISO8859_16 },
{ "iso-ir-226", CS_ISO8859_16 },
{ "ISO_8859-16", CS_ISO8859_16 },
{ "ISO_8859-16:2001", CS_ISO8859_16 },
{ "latin10", CS_ISO8859_16 },
{ "l10", CS_ISO8859_16 },
{ "IBM437", CS_CP437 },
{ "cp437", CS_CP437 },
{ "437", CS_CP437 },
{ "csPC8CodePage437", CS_CP437 },
{ "IBM850", CS_CP850 },
{ "cp850", CS_CP850 },
{ "850", CS_CP850 },
{ "csPC850Multilingual", CS_CP850 },
{ "IBM866", CS_CP866 },
{ "cp866", CS_CP866 },
{ "866", CS_CP866 },
{ "csIBM866", CS_CP866 },
{ "windows-1250", CS_CP1250 },
{ "windows-1251", CS_CP1251 },
{ "windows-1252", CS_CP1252 },
{ "windows-1253", CS_CP1253 },
{ "windows-1254", CS_CP1254 },
{ "windows-1255", CS_CP1255 },
{ "windows-1256", CS_CP1256 },
{ "windows-1257", CS_CP1257 },
{ "windows-1258", CS_CP1258 },
{ "KOI8-R", CS_KOI8_R },
{ "csKOI8R", CS_KOI8_R },
{ "KOI8-U", CS_KOI8_U },
{ "macintosh", CS_MAC_ROMAN_OLD },
{ "mac", CS_MAC_ROMAN_OLD },
{ "csMacintosh", CS_MAC_ROMAN_OLD },
{ "VISCII", CS_VISCII },
{ "csVISCII", CS_VISCII },
{ "hp-roman8", CS_HP_ROMAN8 },
{ "roman8", CS_HP_ROMAN8 },
{ "r8", CS_HP_ROMAN8 },
{ "csHPRoman8", CS_HP_ROMAN8 },
{ "DEC-MCS", CS_DEC_MCS },
{ "dec", CS_DEC_MCS },
{ "csDECMCS", CS_DEC_MCS },
{ "UTF-8", CS_UTF8 },
};
const char *charset_to_mimeenc(int charset)
{
int i;
for (i = 0; i < (int)lenof(mimeencs); i++)
if (charset == mimeencs[i].charset)
return mimeencs[i].name;
return NULL; /* not found */
}
int charset_from_mimeenc(const char *name)
{
int i;
for (i = 0; i < (int)lenof(mimeencs); i++) {
const char *p, *q;
p = name;
q = mimeencs[i].name;
while (*p || *q) {
if (tolower(*p) != tolower(*q))
break;
p++; q++;
}
if (!*p && !*q)
return mimeencs[i].charset;
}
return CS_NONE; /* not found */
}

15
puttysrc/CHARSET/README Normal file
View File

@@ -0,0 +1,15 @@
This subdirectory contains a general character-set conversion
library, used in the Unix port of PuTTY, and available for use in
other ports if it should happen to be useful.
This is a variant of a library that's currently used in some other
programs such as Timber and Halibut. At some future date, we would
like to merge the two libraries, so that all programs use the same
libcharset.
It is therefore a _strong_ design goal that this library should remain
perfectly general, and not tied to particulars of PuTTY. It must not
reference any code outside its own subdirectory; it should not have
PuTTY-specific helper routines added to it unless they can be
documented in a general manner which might make them useful in other
circumstances as well.

53
puttysrc/CHARSET/SBCS.C Normal file
View File

@@ -0,0 +1,53 @@
/*
* sbcs.c - routines to handle single-byte character sets.
*/
#include "charset.h"
#include "internal.h"
/*
* The charset_spec for any single-byte character set should
* provide read_sbcs() as its read function, and its `data' field
* should be a wchar_t string constant containing the 256 entries
* of the translation table.
*/
void read_sbcs(charset_spec const *charset, long int input_chr,
charset_state *state,
void (*emit)(void *ctx, long int output), void *emitctx)
{
const struct sbcs_data *sd = charset->data;
UNUSEDARG(state);
emit(emitctx, sd->sbcs2ucs[input_chr]);
}
void write_sbcs(charset_spec const *charset, long int input_chr,
charset_state *state,
void (*emit)(void *ctx, long int output), void *emitctx)
{
const struct sbcs_data *sd = charset->data;
int i, j, k, c;
UNUSEDARG(state);
/*
* Binary-search in the ucs2sbcs table.
*/
i = -1;
j = sd->nvalid;
while (i+1 < j) {
k = (i+j)/2;
c = sd->ucs2sbcs[k];
if (input_chr < sd->sbcs2ucs[c])
j = k;
else if (input_chr > sd->sbcs2ucs[c])
i = k;
else {
emit(emitctx, c);
return;
}
}
emit(emitctx, ERROR);
}

1117
puttysrc/CHARSET/SBCS.DAT Normal file

File diff suppressed because it is too large Load Diff

4018
puttysrc/CHARSET/SBCSDAT.C Normal file

File diff suppressed because it is too large Load Diff

110
puttysrc/CHARSET/SBCSGEN.PL Normal file
View File

@@ -0,0 +1,110 @@
#!/usr/bin/env perl -w
# This script generates sbcsdat.c (the data for all the SBCSes) from its
# source form sbcs.dat.
$infile = "sbcs.dat";
$outfile = "sbcsdat.c";
open FOO, $infile;
open BAR, ">$outfile";
select BAR;
print "/*\n";
print " * sbcsdat.c - data definitions for single-byte character sets.\n";
print " *\n";
print " * Generated by sbcsgen.pl from sbcs.dat.\n";
print " * You should edit those files rather than editing this one.\n";
print " */\n";
print "\n";
print "#ifndef ENUM_CHARSETS\n";
print "\n";
print "#include \"charset.h\"\n";
print "#include \"internal.h\"\n";
print "\n";
my $charsetname = undef;
my @vals = ();
my @charsetnames = ();
my @sortpriority = ();
while (<FOO>) {
chomp;
if (/^charset (.*)$/) {
$charsetname = $1;
@vals = ();
@sortpriority = map { 0 } 0..255;
} elsif (/^sortpriority ([^-]*)-([^-]*) (.*)$/) {
for ($i = hex $1; $i <= hex $2; $i++) {
$sortpriority[$i] += $3;
}
} elsif (/^[0-9a-fA-FX]/) {
push @vals, map { $_ eq "XXXX" ? -1 : hex $_ } split / +/, $_;
if (scalar @vals > 256) {
die "$infile:$.: charset $charsetname has more than 256 values\n";
} elsif (scalar @vals == 256) {
&outcharset($charsetname, \@vals, \@sortpriority);
push @charsetnames, $charsetname;
$charsetname = undef;
@vals = ();
@sortpriority = map { 0 } 0..255;
}
}
}
print "#else /* ENUM_CHARSETS */\n";
print "\n";
foreach $i (@charsetnames) {
print "ENUM_CHARSET($i)\n";
}
print "\n";
print "#endif /* ENUM_CHARSETS */\n";
sub outcharset($$$) {
my ($name, $vals, $sortpriority) = @_;
my ($prefix, $i, @sorted);
print "static const sbcs_data data_$name = {\n";
print " {\n";
$prefix = " ";
@sorted = ();
for ($i = 0; $i < 256; $i++) {
if ($vals->[$i] < 0) {
printf "%sERROR ", $prefix;
} else {
printf "%s0x%04x", $prefix, $vals->[$i];
die "ooh? $i\n" unless defined $sortpriority->[$i];
push @sorted, [$i, $vals->[$i], 0+$sortpriority->[$i]];
}
if ($i % 8 == 7) {
$prefix = ",\n ";
} else {
$prefix = ", ";
}
}
print "\n },\n {\n";
@sorted = sort { ($a->[1] == $b->[1] ?
$b->[2] <=> $a->[2] :
$a->[1] <=> $b->[1]) ||
$a->[0] <=> $b->[0] } @sorted;
$prefix = " ";
$uval = -1;
for ($i = $j = 0; $i < scalar @sorted; $i++) {
next if ($uval == $sorted[$i]->[1]); # low-priority alternative
$uval = $sorted[$i]->[1];
printf "%s0x%02x", $prefix, $sorted[$i]->[0];
if ($j % 8 == 7) {
$prefix = ",\n ";
} else {
$prefix = ", ";
}
$j++;
}
printf "\n },\n %d\n", $j;
print "};\n";
print "const charset_spec charset_$name = {\n" .
" $name, read_sbcs, write_sbcs, &data_$name\n};\n\n";
}

View File

@@ -0,0 +1,29 @@
/*
* slookup.c - static lookup of character sets.
*/
#include "charset.h"
#include "internal.h"
#define ENUM_CHARSET(x) extern charset_spec const charset_##x;
#include "enum.c"
#undef ENUM_CHARSET
static charset_spec const *const cs_table[] = {
#define ENUM_CHARSET(x) &charset_##x,
#include "enum.c"
#undef ENUM_CHARSET
};
charset_spec const *charset_find_spec(int charset)
{
int i;
for (i = 0; i < (int)lenof(cs_table); i++)
if (cs_table[i]->charset == charset)
return cs_table[i];
return NULL;
}

89
puttysrc/CHARSET/TOUCS.C Normal file
View File

@@ -0,0 +1,89 @@
/*
* toucs.c - convert charsets to Unicode.
*/
#include "charset.h"
#include "internal.h"
struct unicode_emit_param {
wchar_t *output;
int outlen;
const wchar_t *errstr;
int errlen;
int stopped;
};
static void unicode_emit(void *ctx, long int output)
{
struct unicode_emit_param *param = (struct unicode_emit_param *)ctx;
wchar_t outval;
wchar_t const *p;
int outlen;
if (output == ERROR) {
if (param->errstr) {
p = param->errstr;
outlen = param->errlen;
} else {
outval = 0xFFFD; /* U+FFFD REPLACEMENT CHARACTER */
p = &outval;
outlen = 1;
}
} else {
outval = output;
p = &outval;
outlen = 1;
}
if (param->outlen >= outlen) {
while (outlen > 0) {
*param->output++ = *p++;
param->outlen--;
outlen--;
}
} else {
param->stopped = 1;
}
}
int charset_to_unicode(char **input, int *inlen, wchar_t *output, int outlen,
int charset, charset_state *state,
const wchar_t *errstr, int errlen)
{
charset_spec const *spec = charset_find_spec(charset);
charset_state localstate;
struct unicode_emit_param param;
param.output = output;
param.outlen = outlen;
param.errstr = errstr;
param.errlen = errlen;
param.stopped = 0;
if (!state) {
localstate.s0 = 0;
} else {
localstate = *state; /* structure copy */
}
while (*inlen > 0) {
int lenbefore = param.output - output;
spec->read(spec, (unsigned char)**input, &localstate,
unicode_emit, &param);
if (param.stopped) {
/*
* The emit function has _tried_ to output some
* characters, but ran up against the end of the
* buffer. Leave immediately, and return what happened
* _before_ attempting to process this character.
*/
return lenbefore;
}
if (state)
*state = localstate; /* structure copy */
(*input)++;
(*inlen)--;
}
return param.output - output;
}

882
puttysrc/CHARSET/UTF8.C Normal file
View File

@@ -0,0 +1,882 @@
/*
* utf8.c - routines to handle UTF-8.
*/
#ifndef ENUM_CHARSETS
#include "charset.h"
#include "internal.h"
void read_utf8(charset_spec const *, long int, charset_state *,
void (*)(void *, long int), void *);
void write_utf8(charset_spec const *, long int,
charset_state *, void (*)(void *, long int), void *);
/*
* UTF-8 has no associated data, so `charset' may be ignored.
*/
void read_utf8(charset_spec const *charset, long int input_chr,
charset_state *state,
void (*emit)(void *ctx, long int output), void *emitctx)
{
UNUSEDARG(charset);
/*
* For reading UTF-8, the `state' word contains:
*
* - in bits 29-31, the number of bytes expected to be in the
* current multibyte character (which we can tell instantly
* from the first byte, of course).
*
* - in bits 26-28, the number of bytes _seen so far_ in the
* current multibyte character.
*
* - in the remainder of the word, the current value of the
* character, which is shifted upwards by 6 bits to
* accommodate each new byte.
*
* As required, the state is zero when we are not in the middle
* of a multibyte character at all.
*
* For example, when reading E9 8D 8B, starting at state=0:
*
* - after E9, the state is 0x64000009
* - after 8D, the state is 0x6800024d
* - after 8B, the state conceptually becomes 0x6c00934b, at
* which point we notice we've got as many characters as we
* were expecting, output U+934B, and reset the state to
* zero.
*
* Note that the maximum number of bits we might need to store
* in the character value field is 25 (U+7FFFFFFF contains 31
* bits, but we will never actually store its full value
* because when we receive the last 6 bits in the final
* continuation byte we will output it and revert the state to
* zero). Hence the character value field never collides with
* the byte counts.
*/
if (input_chr < 0x80) {
/*
* Single-byte character. If the state is nonzero before
* coming here, output an error for an incomplete sequence.
* Then output the character.
*/
if (state->s0 != 0) {
emit(emitctx, ERROR);
state->s0 = 0;
}
emit(emitctx, input_chr);
} else if (input_chr == 0xFE || input_chr == 0xFF) {
/*
* FE and FF bytes should _never_ occur in UTF-8. They are
* automatic errors; if the state was nonzero to start
* with, output a further error for an incomplete sequence.
*/
if (state->s0 != 0) {
emit(emitctx, ERROR);
state->s0 = 0;
}
emit(emitctx, ERROR);
} else if (input_chr >= 0x80 && input_chr < 0xC0) {
/*
* Continuation byte. Output an error for an unexpected
* continuation byte, if the state is zero.
*/
if (state->s0 == 0) {
emit(emitctx, ERROR);
} else {
unsigned long charval;
unsigned long topstuff;
int bytes;
/*
* Otherwise, accumulate more of the character value.
*/
charval = state->s0 & 0x03ffffffL;
charval = (charval << 6) | (input_chr & 0x3F);
/*
* Check the byte counts; if we have not reached the
* end of the character, update the state and return.
*/
topstuff = state->s0 & 0xfc000000L;
topstuff += 0x04000000L; /* add one to the byte count */
if (((topstuff << 3) ^ topstuff) & 0xe0000000L) {
state->s0 = topstuff | charval;
return;
}
/*
* Now we know we've reached the end of the character.
* `charval' is the Unicode value. We should check for
* various invalid things, and then either output
* charval or an error. In all cases we reset the state
* to zero.
*/
bytes = topstuff >> 29;
state->s0 = 0;
if (charval >= 0xD800 && charval < 0xE000) {
/*
* Surrogates (0xD800-0xDFFF) may never be encoded
* in UTF-8. A surrogate pair in Unicode should
* have been encoded as a single UTF-8 character
* occupying more than three bytes.
*/
emit(emitctx, ERROR);
} else if (charval == 0xFFFE || charval == 0xFFFF) {
/*
* U+FFFE and U+FFFF are invalid Unicode characters
* and may never be encoded in UTF-8. (This is one
* reason why U+FFFF is our way of signalling an
* error to our `emit' function :-)
*/
emit(emitctx, ERROR);
} else if ((charval <= 0x7FL /* && bytes > 1 */) ||
(charval <= 0x7FFL && bytes > 2) ||
(charval <= 0xFFFFL && bytes > 3) ||
(charval <= 0x1FFFFFL && bytes > 4) ||
(charval <= 0x3FFFFFFL && bytes > 5)) {
/*
* Overlong sequences are not to be tolerated,
* under any circumstances.
*/
emit(emitctx, ERROR);
} else {
/*
* Oh, all right. We'll let this one off.
*/
emit(emitctx, charval);
}
}
} else {
/*
* Lead byte. First output an error for an incomplete
* sequence, if the state is nonzero.
*/
if (state->s0 != 0)
emit(emitctx, ERROR);
/*
* Now deal with the lead byte: work out the number of
* bytes we expect to see in this character, and extract
* the initial bits of it too.
*/
if (input_chr >= 0xC0 && input_chr < 0xE0) {
state->s0 = 0x44000000L | (input_chr & 0x1F);
} else if (input_chr >= 0xE0 && input_chr < 0xF0) {
state->s0 = 0x64000000L | (input_chr & 0x0F);
} else if (input_chr >= 0xF0 && input_chr < 0xF8) {
state->s0 = 0x84000000L | (input_chr & 0x07);
} else if (input_chr >= 0xF8 && input_chr < 0xFC) {
state->s0 = 0xa4000000L | (input_chr & 0x03);
} else if (input_chr >= 0xFC && input_chr < 0xFE) {
state->s0 = 0xc4000000L | (input_chr & 0x01);
}
}
}
/*
* UTF-8 is a stateless multi-byte encoding (in the sense that just
* after any character has been completed, the state is always the
* same); hence when writing it, there is no need to use the
* charset_state.
*/
void write_utf8(charset_spec const *charset, long int input_chr,
charset_state *state,
void (*emit)(void *ctx, long int output), void *emitctx)
{
UNUSEDARG(charset);
UNUSEDARG(state);
/*
* Refuse to output any illegal code points.
*/
if (input_chr == 0xFFFE || input_chr == 0xFFFF ||
(input_chr >= 0xD800 && input_chr < 0xE000)) {
emit(emitctx, ERROR);
} else if (input_chr < 0x80) { /* one-byte character */
emit(emitctx, input_chr);
} else if (input_chr < 0x800) { /* two-byte character */
emit(emitctx, 0xC0 | (0x1F & (input_chr >> 6)));
emit(emitctx, 0x80 | (0x3F & (input_chr )));
} else if (input_chr < 0x10000) { /* three-byte character */
emit(emitctx, 0xE0 | (0x0F & (input_chr >> 12)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 6)));
emit(emitctx, 0x80 | (0x3F & (input_chr )));
} else if (input_chr < 0x200000) { /* four-byte character */
emit(emitctx, 0xF0 | (0x07 & (input_chr >> 18)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 12)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 6)));
emit(emitctx, 0x80 | (0x3F & (input_chr )));
} else if (input_chr < 0x4000000) {/* five-byte character */
emit(emitctx, 0xF8 | (0x03 & (input_chr >> 24)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 18)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 12)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 6)));
emit(emitctx, 0x80 | (0x3F & (input_chr )));
} else { /* six-byte character */
emit(emitctx, 0xFC | (0x01 & (input_chr >> 30)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 24)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 18)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 12)));
emit(emitctx, 0x80 | (0x3F & (input_chr >> 6)));
emit(emitctx, 0x80 | (0x3F & (input_chr )));
}
}
#ifdef TESTMODE
#include <stdio.h>
#include <stdarg.h>
int total_errs = 0;
void utf8_emit(void *ctx, long output)
{
wchar_t **p = (wchar_t **)ctx;
*(*p)++ = output;
}
void utf8_read_test(int line, char *input, int inlen, ...)
{
va_list ap;
wchar_t *p, str[512];
int i;
charset_state state;
unsigned long l;
state.s0 = 0;
p = str;
for (i = 0; i < inlen; i++)
read_utf8(NULL, input[i] & 0xFF, &state, utf8_emit, &p);
va_start(ap, inlen);
l = 0;
for (i = 0; i < p - str; i++) {
l = va_arg(ap, long int);
if (l == -1) {
printf("%d: correct string shorter than output\n", line);
total_errs++;
break;
}
if (l != str[i]) {
printf("%d: char %d came out as %08x, should be %08x\n",
line, i, str[i], l);
total_errs++;
}
}
if (l != -1) {
l = va_arg(ap, long int);
if (l != -1) {
printf("%d: correct string longer than output\n", line);
total_errs++;
}
}
va_end(ap);
}
void utf8_write_test(int line, const long *input, int inlen, ...)
{
va_list ap;
wchar_t *p, str[512];
int i;
charset_state state;
unsigned long l;
state.s0 = 0;
p = str;
for (i = 0; i < inlen; i++)
write_utf8(NULL, input[i], &state, utf8_emit, &p);
va_start(ap, inlen);
l = 0;
for (i = 0; i < p - str; i++) {
l = va_arg(ap, long int);
if (l == -1) {
printf("%d: correct string shorter than output\n", line);
total_errs++;
break;
}
if (l != str[i]) {
printf("%d: char %d came out as %08x, should be %08x\n",
line, i, str[i], l);
total_errs++;
}
}
if (l != -1) {
l = va_arg(ap, long int);
if (l != -1) {
printf("%d: correct string longer than output\n", line);
total_errs++;
}
}
va_end(ap);
}
/* Macro to concoct the first three parameters of utf8_read_test. */
#define TESTSTR(x) __LINE__, x, lenof(x)
int main(void)
{
printf("read tests beginning\n");
utf8_read_test(TESTSTR("\xCE\xBA\xE1\xBD\xB9\xCF\x83\xCE\xBC\xCE\xB5"),
0x000003BA, /* GREEK SMALL LETTER KAPPA */
0x00001F79, /* GREEK SMALL LETTER OMICRON WITH OXIA */
0x000003C3, /* GREEK SMALL LETTER SIGMA */
0x000003BC, /* GREEK SMALL LETTER MU */
0x000003B5, /* GREEK SMALL LETTER EPSILON */
0, -1);
utf8_read_test(TESTSTR("\x00"),
0x00000000, /* <control> */
0, -1);
utf8_read_test(TESTSTR("\xC2\x80"),
0x00000080, /* <control> */
0, -1);
utf8_read_test(TESTSTR("\xE0\xA0\x80"),
0x00000800, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\xF0\x90\x80\x80"),
0x00010000, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\xF8\x88\x80\x80\x80"),
0x00200000, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\xFC\x84\x80\x80\x80\x80"),
0x04000000, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\x7F"),
0x0000007F, /* <control> */
0, -1);
utf8_read_test(TESTSTR("\xDF\xBF"),
0x000007FF, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\xEF\xBF\xBD"),
0x0000FFFD, /* REPLACEMENT CHARACTER */
0, -1);
utf8_read_test(TESTSTR("\xEF\xBF\xBF"),
ERROR, /* <no name available> (invalid char) */
0, -1);
utf8_read_test(TESTSTR("\xF7\xBF\xBF\xBF"),
0x001FFFFF, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\xFB\xBF\xBF\xBF\xBF"),
0x03FFFFFF, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\xFD\xBF\xBF\xBF\xBF\xBF"),
0x7FFFFFFF, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\xED\x9F\xBF"),
0x0000D7FF, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\xEE\x80\x80"),
0x0000E000, /* <Private Use, First> */
0, -1);
utf8_read_test(TESTSTR("\xEF\xBF\xBD"),
0x0000FFFD, /* REPLACEMENT CHARACTER */
0, -1);
utf8_read_test(TESTSTR("\xF4\x8F\xBF\xBF"),
0x0010FFFF, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\xF4\x90\x80\x80"),
0x00110000, /* <no name available> */
0, -1);
utf8_read_test(TESTSTR("\x80"),
ERROR, /* (unexpected continuation byte) */
0, -1);
utf8_read_test(TESTSTR("\xBF"),
ERROR, /* (unexpected continuation byte) */
0, -1);
utf8_read_test(TESTSTR("\x80\xBF"),
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
0, -1);
utf8_read_test(TESTSTR("\x80\xBF\x80"),
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
0, -1);
utf8_read_test(TESTSTR("\x80\xBF\x80\xBF"),
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
0, -1);
utf8_read_test(TESTSTR("\x80\xBF\x80\xBF\x80"),
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
0, -1);
utf8_read_test(TESTSTR("\x80\xBF\x80\xBF\x80\xBF"),
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
0, -1);
utf8_read_test(TESTSTR("\x80\xBF\x80\xBF\x80\xBF\x80"),
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
0, -1);
utf8_read_test(TESTSTR("\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF"),
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
ERROR, /* (unexpected continuation byte) */
0, -1);
utf8_read_test(TESTSTR("\xC0\x20\xC1\x20\xC2\x20\xC3\x20\xC4\x20\xC5\x20\xC6\x20\xC7\x20"),
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
0, -1);
utf8_read_test(TESTSTR("\xE0\x20\xE1\x20\xE2\x20\xE3\x20\xE4\x20\xE5\x20\xE6\x20\xE7\x20\xE8\x20\xE9\x20\xEA\x20\xEB\x20\xEC\x20\xED\x20\xEE\x20\xEF\x20"),
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
0, -1);
utf8_read_test(TESTSTR("\xF0\x20\xF1\x20\xF2\x20\xF3\x20\xF4\x20\xF5\x20\xF6\x20\xF7\x20"),
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
0, -1);
utf8_read_test(TESTSTR("\xF8\x20\xF9\x20\xFA\x20\xFB\x20"),
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
0, -1);
utf8_read_test(TESTSTR("\xFC\x20\xFD\x20"),
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
ERROR, /* (incomplete sequence) */
0x00000020, /* SPACE */
0, -1);
utf8_read_test(TESTSTR("\xC0"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xE0\x80"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xF0\x80\x80"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xF8\x80\x80\x80"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xFC\x80\x80\x80\x80"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xDF"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xEF\xBF"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xF7\xBF\xBF"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xFB\xBF\xBF\xBF"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xFD\xBF\xBF\xBF\xBF"),
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xC0\xE0\x80\xF0\x80\x80\xF8\x80\x80\x80\xFC\x80\x80\x80\x80\xDF\xEF\xBF\xF7\xBF\xBF\xFB\xBF\xBF\xBF\xFD\xBF\xBF\xBF\xBF"),
ERROR, /* (incomplete sequence) */
ERROR, /* (incomplete sequence) */
ERROR, /* (incomplete sequence) */
ERROR, /* (incomplete sequence) */
ERROR, /* (incomplete sequence) */
ERROR, /* (incomplete sequence) */
ERROR, /* (incomplete sequence) */
ERROR, /* (incomplete sequence) */
ERROR, /* (incomplete sequence) */
ERROR, /* (incomplete sequence) */
0, -1);
utf8_read_test(TESTSTR("\xFE"),
ERROR, /* (invalid UTF-8 byte) */
0, -1);
utf8_read_test(TESTSTR("\xFF"),
ERROR, /* (invalid UTF-8 byte) */
0, -1);
utf8_read_test(TESTSTR("\xFE\xFE\xFF\xFF"),
ERROR, /* (invalid UTF-8 byte) */
ERROR, /* (invalid UTF-8 byte) */
ERROR, /* (invalid UTF-8 byte) */
ERROR, /* (invalid UTF-8 byte) */
0, -1);
utf8_read_test(TESTSTR("\xC0\xAF"),
ERROR, /* SOLIDUS (overlong form of 2F) */
0, -1);
utf8_read_test(TESTSTR("\xE0\x80\xAF"),
ERROR, /* SOLIDUS (overlong form of 2F) */
0, -1);
utf8_read_test(TESTSTR("\xF0\x80\x80\xAF"),
ERROR, /* SOLIDUS (overlong form of 2F) */
0, -1);
utf8_read_test(TESTSTR("\xF8\x80\x80\x80\xAF"),
ERROR, /* SOLIDUS (overlong form of 2F) */
0, -1);
utf8_read_test(TESTSTR("\xFC\x80\x80\x80\x80\xAF"),
ERROR, /* SOLIDUS (overlong form of 2F) */
0, -1);
utf8_read_test(TESTSTR("\xC1\xBF"),
ERROR, /* <control> (overlong form of 7F) */
0, -1);
utf8_read_test(TESTSTR("\xE0\x9F\xBF"),
ERROR, /* <no name available> (overlong form of DF BF) */
0, -1);
utf8_read_test(TESTSTR("\xF0\x8F\xBF\xBF"),
ERROR, /* <no name available> (overlong form of EF BF BF) (invalid char) */
0, -1);
utf8_read_test(TESTSTR("\xF8\x87\xBF\xBF\xBF"),
ERROR, /* <no name available> (overlong form of F7 BF BF BF) */
0, -1);
utf8_read_test(TESTSTR("\xFC\x83\xBF\xBF\xBF\xBF"),
ERROR, /* <no name available> (overlong form of FB BF BF BF BF) */
0, -1);
utf8_read_test(TESTSTR("\xC0\x80"),
ERROR, /* <control> (overlong form of 00) */
0, -1);
utf8_read_test(TESTSTR("\xE0\x80\x80"),
ERROR, /* <control> (overlong form of 00) */
0, -1);
utf8_read_test(TESTSTR("\xF0\x80\x80\x80"),
ERROR, /* <control> (overlong form of 00) */
0, -1);
utf8_read_test(TESTSTR("\xF8\x80\x80\x80\x80"),
ERROR, /* <control> (overlong form of 00) */
0, -1);
utf8_read_test(TESTSTR("\xFC\x80\x80\x80\x80\x80"),
ERROR, /* <control> (overlong form of 00) */
0, -1);
utf8_read_test(TESTSTR("\xED\xA0\x80"),
ERROR, /* <Non Private Use High Surrogate, First> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xAD\xBF"),
ERROR, /* <Non Private Use High Surrogate, Last> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xAE\x80"),
ERROR, /* <Private Use High Surrogate, First> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xAF\xBF"),
ERROR, /* <Private Use High Surrogate, Last> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xB0\x80"),
ERROR, /* <Low Surrogate, First> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xBE\x80"),
ERROR, /* <no name available> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xBF\xBF"),
ERROR, /* <Low Surrogate, Last> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xA0\x80\xED\xB0\x80"),
ERROR, /* <Non Private Use High Surrogate, First> (surrogate) */
ERROR, /* <Low Surrogate, First> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xA0\x80\xED\xBF\xBF"),
ERROR, /* <Non Private Use High Surrogate, First> (surrogate) */
ERROR, /* <Low Surrogate, Last> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xAD\xBF\xED\xB0\x80"),
ERROR, /* <Non Private Use High Surrogate, Last> (surrogate) */
ERROR, /* <Low Surrogate, First> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xAD\xBF\xED\xBF\xBF"),
ERROR, /* <Non Private Use High Surrogate, Last> (surrogate) */
ERROR, /* <Low Surrogate, Last> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xAE\x80\xED\xB0\x80"),
ERROR, /* <Private Use High Surrogate, First> (surrogate) */
ERROR, /* <Low Surrogate, First> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xAE\x80\xED\xBF\xBF"),
ERROR, /* <Private Use High Surrogate, First> (surrogate) */
ERROR, /* <Low Surrogate, Last> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xAF\xBF\xED\xB0\x80"),
ERROR, /* <Private Use High Surrogate, Last> (surrogate) */
ERROR, /* <Low Surrogate, First> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xED\xAF\xBF\xED\xBF\xBF"),
ERROR, /* <Private Use High Surrogate, Last> (surrogate) */
ERROR, /* <Low Surrogate, Last> (surrogate) */
0, -1);
utf8_read_test(TESTSTR("\xEF\xBF\xBE"),
ERROR, /* <no name available> (invalid char) */
0, -1);
utf8_read_test(TESTSTR("\xEF\xBF\xBF"),
ERROR, /* <no name available> (invalid char) */
0, -1);
printf("read tests completed\n");
printf("write tests beginning\n");
{
const static long str[] =
{0x03BAL, 0x1F79L, 0x03C3L, 0x03BCL, 0x03B5L, 0};
utf8_write_test(TESTSTR(str),
0xCE, 0xBA,
0xE1, 0xBD, 0xB9,
0xCF, 0x83,
0xCE, 0xBC,
0xCE, 0xB5,
0, -1);
}
{
const static long str[] = {0x0000L, 0};
utf8_write_test(TESTSTR(str),
0x00,
0, -1);
}
{
const static long str[] = {0x0080L, 0};
utf8_write_test(TESTSTR(str),
0xC2, 0x80,
0, -1);
}
{
const static long str[] = {0x0800L, 0};
utf8_write_test(TESTSTR(str),
0xE0, 0xA0, 0x80,
0, -1);
}
{
const static long str[] = {0x00010000L, 0};
utf8_write_test(TESTSTR(str),
0xF0, 0x90, 0x80, 0x80,
0, -1);
}
{
const static long str[] = {0x00200000L, 0};
utf8_write_test(TESTSTR(str),
0xF8, 0x88, 0x80, 0x80, 0x80,
0, -1);
}
{
const static long str[] = {0x04000000L, 0};
utf8_write_test(TESTSTR(str),
0xFC, 0x84, 0x80, 0x80, 0x80, 0x80,
0, -1);
}
{
const static long str[] = {0x007FL, 0};
utf8_write_test(TESTSTR(str),
0x7F,
0, -1);
}
{
const static long str[] = {0x07FFL, 0};
utf8_write_test(TESTSTR(str),
0xDF, 0xBF,
0, -1);
}
{
const static long str[] = {0xFFFDL, 0};
utf8_write_test(TESTSTR(str),
0xEF, 0xBF, 0xBD,
0, -1);
}
{
const static long str[] = {0xFFFFL, 0};
utf8_write_test(TESTSTR(str),
ERROR,
0, -1);
}
{
const static long str[] = {0x001FFFFFL, 0};
utf8_write_test(TESTSTR(str),
0xF7, 0xBF, 0xBF, 0xBF,
0, -1);
}
{
const static long str[] = {0x03FFFFFFL, 0};
utf8_write_test(TESTSTR(str),
0xFB, 0xBF, 0xBF, 0xBF, 0xBF,
0, -1);
}
{
const static long str[] = {0x7FFFFFFFL, 0};
utf8_write_test(TESTSTR(str),
0xFD, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF,
0, -1);
}
{
const static long str[] = {0xD7FFL, 0};
utf8_write_test(TESTSTR(str),
0xED, 0x9F, 0xBF,
0, -1);
}
{
const static long str[] = {0xD800L, 0};
utf8_write_test(TESTSTR(str),
ERROR,
0, -1);
}
{
const static long str[] = {0xD800L, 0xDC00L, 0};
utf8_write_test(TESTSTR(str),
ERROR,
ERROR,
0, -1);
}
{
const static long str[] = {0xDFFFL, 0};
utf8_write_test(TESTSTR(str),
ERROR,
0, -1);
}
{
const static long str[] = {0xE000L, 0};
utf8_write_test(TESTSTR(str),
0xEE, 0x80, 0x80,
0, -1);
}
printf("write tests completed\n");
printf("total: %d errors\n", total_errs);
return (total_errs != 0);
}
#endif /* TESTMODE */
const charset_spec charset_CS_UTF8 = {
CS_UTF8, read_utf8, write_utf8, NULL
};
#else /* ENUM_CHARSETS */
ENUM_CHARSET(CS_UTF8)
#endif /* ENUM_CHARSETS */

93
puttysrc/CHARSET/XENC.C Normal file
View File

@@ -0,0 +1,93 @@
/*
* xenc.c - translate our internal character set codes to and from
* X11 character encoding names.
*
*/
#include <ctype.h>
#include "charset.h"
#include "internal.h"
static const struct {
const char *name;
int charset;
} xencs[] = {
/*
* Officially registered encoding names. This list is derived
* from the font encodings section of
*
* http://ftp.x.org/pub/DOCS/registry
*
* Where multiple encoding names map to the same encoding id
* (such as iso8859-15 and fcd8859-15), the first is considered
* canonical and will be returned when translating the id to a
* string.
*/
{ "iso8859-1", CS_ISO8859_1 },
{ "iso8859-2", CS_ISO8859_2 },
{ "iso8859-3", CS_ISO8859_3 },
{ "iso8859-4", CS_ISO8859_4 },
{ "iso8859-5", CS_ISO8859_5 },
{ "iso8859-6", CS_ISO8859_6 },
{ "iso8859-7", CS_ISO8859_7 },
{ "iso8859-8", CS_ISO8859_8 },
{ "iso8859-9", CS_ISO8859_9 },
{ "iso8859-10", CS_ISO8859_10 },
{ "iso8859-13", CS_ISO8859_13 },
{ "iso8859-14", CS_ISO8859_14 },
{ "iso8859-15", CS_ISO8859_15 },
{ "fcd8859-15", CS_ISO8859_15 },
{ "hp-roman8", CS_HP_ROMAN8 },
{ "koi8-r", CS_KOI8_R },
/*
* Unofficial encoding names found in the wild.
*/
{ "iso8859-16", CS_ISO8859_16 },
{ "koi8-u", CS_KOI8_U },
{ "ibm-cp437", CS_CP437 },
{ "ibm-cp850", CS_CP850 },
{ "ibm-cp866", CS_CP866 },
{ "microsoft-cp1250", CS_CP1250 },
{ "microsoft-cp1251", CS_CP1251 },
{ "microsoft-cp1252", CS_CP1252 },
{ "microsoft-cp1253", CS_CP1253 },
{ "microsoft-cp1254", CS_CP1254 },
{ "microsoft-cp1255", CS_CP1255 },
{ "microsoft-cp1256", CS_CP1256 },
{ "microsoft-cp1257", CS_CP1257 },
{ "microsoft-cp1258", CS_CP1258 },
{ "mac-roman", CS_MAC_ROMAN },
{ "viscii1.1-1", CS_VISCII },
{ "viscii1-1", CS_VISCII },
};
const char *charset_to_xenc(int charset)
{
int i;
for (i = 0; i < (int)lenof(xencs); i++)
if (charset == xencs[i].charset)
return xencs[i].name;
return NULL; /* not found */
}
int charset_from_xenc(const char *name)
{
int i;
for (i = 0; i < (int)lenof(xencs); i++) {
const char *p, *q;
p = name;
q = xencs[i].name;
while (*p || *q) {
if (tolower(*p) != tolower(*q))
break;
p++; q++;
}
if (!*p && !*q)
return xencs[i].charset;
}
return CS_NONE; /* not found */
}

1576
puttysrc/CMDGEN.C Normal file

File diff suppressed because it is too large Load Diff

442
puttysrc/CMDLINE.C Normal file
View File

@@ -0,0 +1,442 @@
/*
* cmdline.c - command-line parsing shared between many of the
* PuTTY applications
*/
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include "putty.h"
/*
* Some command-line parameters need to be saved up until after
* we've loaded the saved session which will form the basis of our
* eventual running configuration. For this we use the macro
* SAVEABLE, which notices if the `need_save' parameter is set and
* saves the parameter and value on a list.
*
* We also assign priorities to saved parameters, just to slightly
* ameliorate silly ordering problems. For example, if you specify
* a saved session to load, it will be loaded _before_ all your
* local modifications such as -L are evaluated; and if you specify
* a protocol and a port, the protocol is set up first so that the
* port can override its choice of port number.
*
* (In fact -load is not saved at all, since in at least Plink the
* processing of further command-line options depends on whether or
* not the loaded session contained a hostname. So it must be
* executed immediately.)
*/
#define NPRIORITIES 2
struct cmdline_saved_param {
char *p, *value;
};
struct cmdline_saved_param_set {
struct cmdline_saved_param *params;
int nsaved, savesize;
};
/*
* C guarantees this structure will be initialised to all zero at
* program start, which is exactly what we want.
*/
static struct cmdline_saved_param_set saves[NPRIORITIES];
static void cmdline_save_param(char *p, char *value, int pri)
{
if (saves[pri].nsaved >= saves[pri].savesize) {
saves[pri].savesize = saves[pri].nsaved + 32;
saves[pri].params = sresize(saves[pri].params, saves[pri].savesize,
struct cmdline_saved_param);
}
saves[pri].params[saves[pri].nsaved].p = p;
saves[pri].params[saves[pri].nsaved].value = value;
saves[pri].nsaved++;
}
void cmdline_cleanup(void)
{
int pri;
for (pri = 0; pri < NPRIORITIES; pri++)
sfree(saves[pri].params);
}
#define SAVEABLE(pri) do { \
if (need_save) { cmdline_save_param(p, value, pri); return ret; } \
} while (0)
static char *cmdline_password = NULL;
/*
* Similar interface to get_userpass_input(), except that here a -1
* return means that we aren't capable of processing the prompt and
* someone else should do it.
*/
int cmdline_get_passwd_input(prompts_t *p, unsigned char *in, int inlen) {
static int tried_once = 0;
/*
* We only handle prompts which don't echo (which we assume to be
* passwords), and (currently) we only cope with a password prompt
* that comes in a prompt-set on its own.
*/
if (!cmdline_password || in || p->n_prompts != 1 || p->prompts[0]->echo) {
return -1;
}
/*
* If we've tried once, return utter failure (no more passwords left
* to try).
*/
if (tried_once)
return 0;
strncpy(p->prompts[0]->result, cmdline_password,
p->prompts[0]->result_len);
p->prompts[0]->result[p->prompts[0]->result_len-1] = '\0';
memset(cmdline_password, 0, strlen(cmdline_password));
tried_once = 1;
return 1;
}
/*
* Here we have a flags word which describes the capabilities of
* the particular tool on whose behalf we're running. We will
* refuse certain command-line options if a particular tool
* inherently can't do anything sensible. For example, the file
* transfer tools (psftp, pscp) can't do a great deal with protocol
* selections (ever tried running scp over telnet?) or with port
* forwarding (even if it wasn't a hideously bad idea, they don't
* have the select() infrastructure to make them work).
*/
int cmdline_tooltype = 0;
static int cmdline_check_unavailable(int flag, char *p)
{
if (cmdline_tooltype & flag) {
cmdline_error("option \"%s\" not available in this tool", p);
return 1;
}
return 0;
}
#define UNAVAILABLE_IN(flag) do { \
if (cmdline_check_unavailable(flag, p)) return ret; \
} while (0)
/*
* Process a standard command-line parameter. `p' is the parameter
* in question; `value' is the subsequent element of argv, which
* may or may not be required as an operand to the parameter.
* If `need_save' is 1, arguments which need to be saved as
* described at this top of this file are, for later execution;
* if 0, they are processed normally. (-1 is a special value used
* by pterm to count arguments for a preliminary pass through the
* argument list; it causes immediate return with an appropriate
* value with no action taken.)
* Return value is 2 if both arguments were used; 1 if only p was
* used; 0 if the parameter wasn't one we recognised; -2 if it
* should have been 2 but value was NULL.
*/
#define RETURN(x) do { \
if ((x) == 2 && !value) return -2; \
ret = x; \
if (need_save < 0) return x; \
} while (0)
int cmdline_process_param(char *p, char *value, int need_save, Config *cfg)
{
int ret = 0;
if (!strcmp(p, "-load")) {
RETURN(2);
/* This parameter must be processed immediately rather than being
* saved. */
do_defaults(value, cfg);
loaded_session = TRUE;
return 2;
}
if (!strcmp(p, "-ssh")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
default_protocol = cfg->protocol = PROT_SSH;
default_port = cfg->port = 22;
return 1;
}
if (!strcmp(p, "-telnet")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
default_protocol = cfg->protocol = PROT_TELNET;
default_port = cfg->port = 23;
return 1;
}
if (!strcmp(p, "-rlogin")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
default_protocol = cfg->protocol = PROT_RLOGIN;
default_port = cfg->port = 513;
return 1;
}
if (!strcmp(p, "-raw")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
default_protocol = cfg->protocol = PROT_RAW;
}
if (!strcmp(p, "-v")) {
RETURN(1);
flags |= FLAG_VERBOSE;
}
if (!strcmp(p, "-l")) {
RETURN(2);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(0);
strncpy(cfg->username, value, sizeof(cfg->username));
cfg->username[sizeof(cfg->username) - 1] = '\0';
}
if ((!strcmp(p, "-L") || !strcmp(p, "-R") || !strcmp(p, "-D"))) {
char *fwd, *ptr, *q, *qq;
int dynamic, i=0;
RETURN(2);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
dynamic = !strcmp(p, "-D");
fwd = value;
ptr = cfg->portfwd;
/* if existing forwards, find end of list */
while (*ptr) {
while (*ptr)
ptr++;
ptr++;
}
i = ptr - cfg->portfwd;
ptr[0] = p[1]; /* insert a 'L', 'R' or 'D' at the start */
ptr++;
if (1 + strlen(fwd) + 2 > sizeof(cfg->portfwd) - i) {
cmdline_error("out of space for port forwardings");
return ret;
}
strncpy(ptr, fwd, sizeof(cfg->portfwd) - i - 2);
if (!dynamic) {
/*
* We expect _at least_ two colons in this string. The
* possible formats are `sourceport:desthost:destport',
* or `sourceip:sourceport:desthost:destport' if you're
* specifying a particular loopback address. We need to
* replace the one between source and dest with a \t;
* this means we must find the second-to-last colon in
* the string.
*/
q = qq = strchr(ptr, ':');
while (qq) {
char *qqq = strchr(qq+1, ':');
if (qqq)
q = qq;
qq = qqq;
}
if (q) *q = '\t'; /* replace second-last colon with \t */
}
cfg->portfwd[sizeof(cfg->portfwd) - 1] = '\0';
cfg->portfwd[sizeof(cfg->portfwd) - 2] = '\0';
ptr[strlen(ptr)+1] = '\000'; /* append 2nd '\000' */
}
if ((!strcmp(p, "-nc"))) {
char *host, *portp;
RETURN(2);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
host = portp = value;
while (*portp && *portp != ':')
portp++;
if (*portp) {
unsigned len = portp - host;
if (len >= sizeof(cfg->ssh_nc_host))
len = sizeof(cfg->ssh_nc_host) - 1;
strncpy(cfg->ssh_nc_host, value, len);
cfg->ssh_nc_host[sizeof(cfg->ssh_nc_host) - 1] = '\0';
cfg->ssh_nc_port = atoi(portp+1);
} else {
cmdline_error("-nc expects argument of form 'host:port'");
return ret;
}
}
if (!strcmp(p, "-m")) {
char *filename, *command;
int cmdlen, cmdsize;
FILE *fp;
int c, d;
RETURN(2);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
filename = value;
cmdlen = cmdsize = 0;
command = NULL;
fp = fopen(filename, "r");
if (!fp) {
cmdline_error("unable to open command "
"file \"%s\"", filename);
return ret;
}
do {
c = fgetc(fp);
d = c;
if (c == EOF)
d = 0;
if (cmdlen >= cmdsize) {
cmdsize = cmdlen + 512;
command = sresize(command, cmdsize, char);
}
command[cmdlen++] = d;
} while (c != EOF);
cfg->remote_cmd_ptr = command;
cfg->remote_cmd_ptr2 = NULL;
cfg->nopty = TRUE; /* command => no terminal */
}
if (!strcmp(p, "-P")) {
RETURN(2);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(1); /* lower priority than -ssh,-telnet */
cfg->port = atoi(value);
}
if (!strcmp(p, "-pw")) {
RETURN(2);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(1);
/* We delay evaluating this until after the protocol is decided,
* so that we can warn if it's of no use with the selected protocol */
if (cfg->protocol != PROT_SSH)
cmdline_error("the -pw option can only be used with the "
"SSH protocol");
else {
cmdline_password = dupstr(value);
/* Assuming that `value' is directly from argv, make a good faith
* attempt to trample it, to stop it showing up in `ps' output
* on Unix-like systems. Not guaranteed, of course. */
memset(value, 0, strlen(value));
}
}
if (!strcmp(p, "-agent") || !strcmp(p, "-pagent") ||
!strcmp(p, "-pageant")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->tryagent = TRUE;
}
if (!strcmp(p, "-noagent") || !strcmp(p, "-nopagent") ||
!strcmp(p, "-nopageant")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->tryagent = FALSE;
}
if (!strcmp(p, "-A")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->agentfwd = 1;
}
if (!strcmp(p, "-a")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->agentfwd = 0;
}
if (!strcmp(p, "-X")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->x11_forward = 1;
}
if (!strcmp(p, "-x")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->x11_forward = 0;
}
if (!strcmp(p, "-t")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(1); /* lower priority than -m */
cfg->nopty = 0;
}
if (!strcmp(p, "-T")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(1);
cfg->nopty = 1;
}
if (!strcmp(p, "-N")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->ssh_no_shell = 1;
}
if (!strcmp(p, "-C")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->compression = 1;
}
if (!strcmp(p, "-1")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->sshprot = 0; /* ssh protocol 1 only */
}
if (!strcmp(p, "-2")) {
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->sshprot = 3; /* ssh protocol 2 only */
}
if (!strcmp(p, "-i")) {
RETURN(2);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(0);
cfg->keyfile = filename_from_str(value);
}
if (!strcmp(p, "-4") || !strcmp(p, "-ipv4")) {
RETURN(1);
SAVEABLE(1);
cfg->addressfamily = ADDRTYPE_IPV4;
}
if (!strcmp(p, "-6") || !strcmp(p, "-ipv6")) {
RETURN(1);
SAVEABLE(1);
cfg->addressfamily = ADDRTYPE_IPV6;
}
return ret; /* unrecognised */
}
void cmdline_run_saved(Config *cfg)
{
int pri, i;
for (pri = 0; pri < NPRIORITIES; pri++)
for (i = 0; i < saves[pri].nsaved; i++)
cmdline_process_param(saves[pri].params[i].p,
saves[pri].params[i].value, 0, cfg);
}

2253
puttysrc/CONFIG.C Normal file

File diff suppressed because it is too large Load Diff

150
puttysrc/CONTRIB/KH2REG.PY Normal file
View File

@@ -0,0 +1,150 @@
#! /usr/bin/env python
# $Id: kh2reg.py 5480 2005-03-10 16:36:05Z jacob $
# Convert OpenSSH known_hosts and known_hosts2 files to "new format" PuTTY
# host keys.
# usage:
# kh2reg.py [ --win ] known_hosts1 2 3 4 ... > hosts.reg
# Creates a Windows .REG file (double-click to install).
# kh2reg.py --unix known_hosts1 2 3 4 ... > sshhostkeys
# Creates data suitable for storing in ~/.putty/sshhostkeys (Unix).
# Line endings are someone else's problem as is traditional.
# Developed for Python 1.5.2.
import fileinput
import base64
import struct
import string
import re
import sys
import getopt
def winmungestr(s):
"Duplicate of PuTTY's mungestr() in winstore.c:1.10 for Registry keys"
candot = 0
r = ""
for c in s:
if c in ' \*?%~' or ord(c)<ord(' ') or (c == '.' and not candot):
r = r + ("%%%02X" % ord(c))
else:
r = r + c
candot = 1
return r
def strtolong(s):
"Convert arbitrary-length big-endian binary data to a Python long"
bytes = struct.unpack(">%luB" % len(s), s)
return reduce ((lambda a, b: (long(a) << 8) + long(b)), bytes)
def longtohex(n):
"""Convert long int to lower-case hex.
Ick, Python (at least in 1.5.2) doesn't appear to have a way to
turn a long int into an unadorned hex string -- % gets upset if the
number is too big, and raw hex() uses uppercase (sometimes), and
adds unwanted "0x...L" around it."""
plain=string.lower(re.match(r"0x([0-9A-Fa-f]*)l?$", hex(n), re.I).group(1))
return "0x" + plain
output_type = 'windows'
try:
optlist, args = getopt.getopt(sys.argv[1:], '', [ 'win', 'unix' ])
if filter(lambda x: x[0] == '--unix', optlist):
output_type = 'unix'
except getopt.error, e:
sys.stderr.write(str(e) + "\n")
sys.exit(1)
if output_type == 'windows':
# Output REG file header.
sys.stdout.write("""REGEDIT4
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys]
""")
# Now process all known_hosts input.
for line in fileinput.input(args):
try:
# Remove leading/trailing whitespace (should zap CR and LF)
line = string.strip (line)
# Skip blanks and comments
if line == '' or line[0] == '#':
raise "Skipping input line"
# Split line on spaces.
fields = string.split (line, ' ')
# Common fields
hostpat = fields[0]
magicnumbers = [] # placeholder
keytype = "" # placeholder
# Grotty heuristic to distinguish known_hosts from known_hosts2:
# is second field entirely decimal digits?
if re.match (r"\d*$", fields[1]):
# Treat as SSH-1-type host key.
# Format: hostpat bits10 exp10 mod10 comment...
# (PuTTY doesn't store the number of bits.)
magicnumbers = map (long, fields[2:4])
keytype = "rsa"
else:
# Treat as SSH-2-type host key.
# Format: hostpat keytype keyblob64 comment...
sshkeytype, blob = fields[1], base64.decodestring (fields[2])
# 'blob' consists of a number of
# uint32 N (big-endian)
# uint8[N] field_data
subfields = []
while blob:
sizefmt = ">L"
(size,) = struct.unpack (sizefmt, blob[0:4])
size = int(size) # req'd for slicage
(data,) = struct.unpack (">%lus" % size, blob[4:size+4])
subfields.append(data)
blob = blob [struct.calcsize(sizefmt) + size : ]
# The first field is keytype again, and the rest we can treat as
# an opaque list of bignums (same numbers and order as stored
# by PuTTY). (currently embedded keytype is ignored entirely)
magicnumbers = map (strtolong, subfields[1:])
# Translate key type into something PuTTY can use.
if sshkeytype == "ssh-rsa": keytype = "rsa2"
elif sshkeytype == "ssh-dss": keytype = "dss"
else:
raise "Unknown SSH key type", sshkeytype
# Now print out one line per host pattern, discarding wildcards.
for host in string.split (hostpat, ','):
if re.search (r"[*?!]", host):
sys.stderr.write("Skipping wildcard host pattern '%s'\n"
% host)
continue
else:
# Slightly bizarre key format: 'type@port:hostname'
# As far as I know, the input never specifies a port.
port = 22
# XXX: does PuTTY do anything useful with literal IP[v4]s?
key = keytype + ("@%d:%s" % (port, host))
value = string.join (map (longtohex, magicnumbers), ',')
if output_type == 'unix':
# Unix format.
sys.stdout.write('%s %s\n' % (key, value))
else:
# Windows format.
# XXX: worry about double quotes?
sys.stdout.write("\"%s\"=\"%s\"\n"
% (winmungestr(key), value))
except "Unknown SSH key type", k:
sys.stderr.write("Unknown SSH key type '%s', skipping\n" % k)
except "Skipping input line":
pass

190
puttysrc/CPROXY.C Normal file
View File

@@ -0,0 +1,190 @@
/*
* Routines to do cryptographic interaction with proxies in PuTTY.
* This is in a separate module from proxy.c, so that it can be
* conveniently removed in PuTTYtel by replacing this module with
* the stub version nocproxy.c.
*/
#include <assert.h>
#include <ctype.h>
#include <string.h>
#define DEFINE_PLUG_METHOD_MACROS
#include "putty.h"
#include "ssh.h" /* For MD5 support */
#include "network.h"
#include "proxy.h"
static void hmacmd5_chap(const unsigned char *challenge, int challen,
const char *passwd, unsigned char *response)
{
void *hmacmd5_ctx;
int pwlen;
hmacmd5_ctx = hmacmd5_make_context();
pwlen = strlen(passwd);
if (pwlen>64) {
unsigned char md5buf[16];
MD5Simple(passwd, pwlen, md5buf);
hmacmd5_key(hmacmd5_ctx, md5buf, 16);
} else {
hmacmd5_key(hmacmd5_ctx, passwd, pwlen);
}
hmacmd5_do_hmac(hmacmd5_ctx, challenge, challen, response);
hmacmd5_free_context(hmacmd5_ctx);
}
void proxy_socks5_offerencryptedauth(char *command, int *len)
{
command[*len] = 0x03; /* CHAP */
(*len)++;
}
int proxy_socks5_handlechap (Proxy_Socket p)
{
/* CHAP authentication reply format:
* version number (1 bytes) = 1
* number of commands (1 byte)
*
* For each command:
* command identifier (1 byte)
* data length (1 byte)
*/
unsigned char data[260];
unsigned char outbuf[20];
while(p->chap_num_attributes == 0 ||
p->chap_num_attributes_processed < p->chap_num_attributes) {
if (p->chap_num_attributes == 0 ||
p->chap_current_attribute == -1) {
/* CHAP normally reads in two bytes, either at the
* beginning or for each attribute/value pair. But if
* we're waiting for the value's data, we might not want
* to read 2 bytes.
*/
if (bufchain_size(&p->pending_input_data) < 2)
return 1; /* not got anything yet */
/* get the response */
bufchain_fetch(&p->pending_input_data, data, 2);
bufchain_consume(&p->pending_input_data, 2);
}
if (p->chap_num_attributes == 0) {
/* If there are no attributes, this is our first msg
* with the server, where we negotiate version and
* number of attributes
*/
if (data[0] != 0x01) {
plug_closing(p->plug, "Proxy error: SOCKS proxy wants"
" a different CHAP version",
PROXY_ERROR_GENERAL, 0);
return 1;
}
if (data[1] == 0x00) {
plug_closing(p->plug, "Proxy error: SOCKS proxy won't"
" negotiate CHAP with us",
PROXY_ERROR_GENERAL, 0);
return 1;
}
p->chap_num_attributes = data[1];
} else {
if (p->chap_current_attribute == -1) {
/* We have to read in each attribute/value pair -
* those we don't understand can be ignored, but
* there are a few we'll need to handle.
*/
p->chap_current_attribute = data[0];
p->chap_current_datalen = data[1];
}
if (bufchain_size(&p->pending_input_data) <
p->chap_current_datalen)
return 1; /* not got everything yet */
/* get the response */
bufchain_fetch(&p->pending_input_data, data,
p->chap_current_datalen);
bufchain_consume(&p->pending_input_data,
p->chap_current_datalen);
switch (p->chap_current_attribute) {
case 0x00:
/* Successful authentication */
if (data[0] == 0x00)
p->state = 2;
else {
plug_closing(p->plug, "Proxy error: SOCKS proxy"
" refused CHAP authentication",
PROXY_ERROR_GENERAL, 0);
return 1;
}
break;
case 0x03:
outbuf[0] = 0x01; /* Version */
outbuf[1] = 0x01; /* One attribute */
outbuf[2] = 0x04; /* Response */
outbuf[3] = 0x10; /* Length */
hmacmd5_chap(data, p->chap_current_datalen,
p->cfg.proxy_password, &outbuf[4]);
sk_write(p->sub_socket, (char *)outbuf, 20);
break;
case 0x11:
/* Chose a protocol */
if (data[0] != 0x85) {
plug_closing(p->plug, "Proxy error: Server chose "
"CHAP of other than HMAC-MD5 but we "
"didn't offer it!",
PROXY_ERROR_GENERAL, 0);
return 1;
}
break;
}
p->chap_current_attribute = -1;
p->chap_num_attributes_processed++;
}
if (p->state == 8 &&
p->chap_num_attributes_processed >= p->chap_num_attributes) {
p->chap_num_attributes = 0;
p->chap_num_attributes_processed = 0;
p->chap_current_datalen = 0;
}
}
return 0;
}
int proxy_socks5_selectchap(Proxy_Socket p)
{
if (p->cfg.proxy_username[0] || p->cfg.proxy_password[0]) {
char chapbuf[514];
int ulen;
chapbuf[0] = '\x01'; /* Version */
chapbuf[1] = '\x02'; /* Number of attributes sent */
chapbuf[2] = '\x11'; /* First attribute - algorithms list */
chapbuf[3] = '\x01'; /* Only one CHAP algorithm */
chapbuf[4] = '\x85'; /* ...and it's HMAC-MD5, the core one */
chapbuf[5] = '\x02'; /* Second attribute - username */
ulen = strlen(p->cfg.proxy_username);
if (ulen > 255) ulen = 255; if (ulen < 1) ulen = 1;
chapbuf[6] = ulen;
memcpy(chapbuf+7, p->cfg.proxy_username, ulen);
sk_write(p->sub_socket, chapbuf, ulen + 7);
p->chap_num_attributes = 0;
p->chap_num_attributes_processed = 0;
p->chap_current_attribute = -1;
p->chap_current_datalen = 0;
p->state = 8;
} else
plug_closing(p->plug, "Proxy error: Server chose "
"CHAP authentication but we didn't offer it!",
PROXY_ERROR_GENERAL, 0);
return 1;
}

595
puttysrc/DIALOG.C Normal file
View File

@@ -0,0 +1,595 @@
/*
* dialog.c - a reasonably platform-independent mechanism for
* describing dialog boxes.
*/
#include <assert.h>
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#define DEFINE_INTORPTR_FNS
#include "putty.h"
#include "dialog.h"
int ctrl_path_elements(char *path)
{
int i = 1;
while (*path) {
if (*path == '/') i++;
path++;
}
return i;
}
/* Return the number of matching path elements at the starts of p1 and p2,
* or INT_MAX if the paths are identical. */
int ctrl_path_compare(char *p1, char *p2)
{
int i = 0;
while (*p1 || *p2) {
if ((*p1 == '/' || *p1 == '\0') &&
(*p2 == '/' || *p2 == '\0'))
i++; /* a whole element matches, ooh */
if (*p1 != *p2)
return i; /* mismatch */
p1++, p2++;
}
return INT_MAX; /* exact match */
}
struct controlbox *ctrl_new_box(void)
{
struct controlbox *ret = snew(struct controlbox);
ret->nctrlsets = ret->ctrlsetsize = 0;
ret->ctrlsets = NULL;
ret->nfrees = ret->freesize = 0;
ret->frees = NULL;
return ret;
}
void ctrl_free_box(struct controlbox *b)
{
int i;
for (i = 0; i < b->nctrlsets; i++) {
ctrl_free_set(b->ctrlsets[i]);
}
for (i = 0; i < b->nfrees; i++)
sfree(b->frees[i]);
sfree(b->ctrlsets);
sfree(b->frees);
sfree(b);
}
void ctrl_free_set(struct controlset *s)
{
int i;
sfree(s->pathname);
sfree(s->boxname);
sfree(s->boxtitle);
for (i = 0; i < s->ncontrols; i++) {
ctrl_free(s->ctrls[i]);
}
sfree(s->ctrls);
sfree(s);
}
/*
* Find the index of first controlset in a controlbox for a given
* path. If that path doesn't exist, return the index where it
* should be inserted.
*/
static int ctrl_find_set(struct controlbox *b, char *path, int start)
{
int i, last, thisone;
last = 0;
for (i = 0; i < b->nctrlsets; i++) {
thisone = ctrl_path_compare(path, b->ctrlsets[i]->pathname);
/*
* If `start' is true and there exists a controlset with
* exactly the path we've been given, we should return the
* index of the first such controlset we find. Otherwise,
* we should return the index of the first entry in which
* _fewer_ path elements match than they did last time.
*/
if ((start && thisone == INT_MAX) || thisone < last)
return i;
last = thisone;
}
return b->nctrlsets; /* insert at end */
}
/*
* Find the index of next controlset in a controlbox for a given
* path, or -1 if no such controlset exists. If -1 is passed as
* input, finds the first.
*/
int ctrl_find_path(struct controlbox *b, char *path, int index)
{
if (index < 0)
index = ctrl_find_set(b, path, 1);
else
index++;
if (index < b->nctrlsets && !strcmp(path, b->ctrlsets[index]->pathname))
return index;
else
return -1;
}
/* Set up a panel title. */
struct controlset *ctrl_settitle(struct controlbox *b,
char *path, char *title)
{
struct controlset *s = snew(struct controlset);
int index = ctrl_find_set(b, path, 1);
s->pathname = dupstr(path);
s->boxname = NULL;
s->boxtitle = dupstr(title);
s->ncontrols = s->ctrlsize = 0;
s->ncolumns = 0; /* this is a title! */
s->ctrls = NULL;
if (b->nctrlsets >= b->ctrlsetsize) {
b->ctrlsetsize = b->nctrlsets + 32;
b->ctrlsets = sresize(b->ctrlsets, b->ctrlsetsize,struct controlset *);
}
if (index < b->nctrlsets)
memmove(&b->ctrlsets[index+1], &b->ctrlsets[index],
(b->nctrlsets-index) * sizeof(*b->ctrlsets));
b->ctrlsets[index] = s;
b->nctrlsets++;
return s;
}
/* Retrieve a pointer to a controlset, creating it if absent. */
struct controlset *ctrl_getset(struct controlbox *b,
char *path, char *name, char *boxtitle)
{
struct controlset *s;
int index = ctrl_find_set(b, path, 1);
while (index < b->nctrlsets &&
!strcmp(b->ctrlsets[index]->pathname, path)) {
if (b->ctrlsets[index]->boxname &&
!strcmp(b->ctrlsets[index]->boxname, name))
return b->ctrlsets[index];
index++;
}
s = snew(struct controlset);
s->pathname = dupstr(path);
s->boxname = dupstr(name);
s->boxtitle = boxtitle ? dupstr(boxtitle) : NULL;
s->ncolumns = 1;
s->ncontrols = s->ctrlsize = 0;
s->ctrls = NULL;
if (b->nctrlsets >= b->ctrlsetsize) {
b->ctrlsetsize = b->nctrlsets + 32;
b->ctrlsets = sresize(b->ctrlsets, b->ctrlsetsize,struct controlset *);
}
if (index < b->nctrlsets)
memmove(&b->ctrlsets[index+1], &b->ctrlsets[index],
(b->nctrlsets-index) * sizeof(*b->ctrlsets));
b->ctrlsets[index] = s;
b->nctrlsets++;
return s;
}
/* Allocate some private data in a controlbox. */
void *ctrl_alloc(struct controlbox *b, size_t size)
{
void *p;
/*
* This is an internal allocation routine, so it's allowed to
* use smalloc directly.
*/
p = smalloc(size);
if (b->nfrees >= b->freesize) {
b->freesize = b->nfrees + 32;
b->frees = sresize(b->frees, b->freesize, void *);
}
b->frees[b->nfrees++] = p;
return p;
}
static union control *ctrl_new(struct controlset *s, int type,
intorptr helpctx, handler_fn handler,
intorptr context)
{
union control *c = snew(union control);
if (s->ncontrols >= s->ctrlsize) {
s->ctrlsize = s->ncontrols + 32;
s->ctrls = sresize(s->ctrls, s->ctrlsize, union control *);
}
s->ctrls[s->ncontrols++] = c;
/*
* Fill in the standard fields.
*/
c->generic.type = type;
c->generic.tabdelay = 0;
c->generic.column = COLUMN_FIELD(0, s->ncolumns);
c->generic.helpctx = helpctx;
c->generic.handler = handler;
c->generic.context = context;
c->generic.label = NULL;
return c;
}
/* `ncolumns' is followed by that many percentages, as integers. */
union control *ctrl_columns(struct controlset *s, int ncolumns, ...)
{
union control *c = ctrl_new(s, CTRL_COLUMNS, P(NULL), NULL, P(NULL));
assert(s->ncolumns == 1 || ncolumns == 1);
c->columns.ncols = ncolumns;
s->ncolumns = ncolumns;
if (ncolumns == 1) {
c->columns.percentages = NULL;
} else {
va_list ap;
int i;
c->columns.percentages = snewn(ncolumns, int);
va_start(ap, ncolumns);
for (i = 0; i < ncolumns; i++)
c->columns.percentages[i] = va_arg(ap, int);
va_end(ap);
}
return c;
}
union control *ctrl_editbox(struct controlset *s, char *label, char shortcut,
int percentage,
intorptr helpctx, handler_fn handler,
intorptr context, intorptr context2)
{
union control *c = ctrl_new(s, CTRL_EDITBOX, helpctx, handler, context);
c->editbox.label = label ? dupstr(label) : NULL;
c->editbox.shortcut = shortcut;
c->editbox.percentwidth = percentage;
c->editbox.password = 0;
c->editbox.has_list = 0;
c->editbox.context2 = context2;
return c;
}
union control *ctrl_combobox(struct controlset *s, char *label, char shortcut,
int percentage,
intorptr helpctx, handler_fn handler,
intorptr context, intorptr context2)
{
union control *c = ctrl_new(s, CTRL_EDITBOX, helpctx, handler, context);
c->editbox.label = label ? dupstr(label) : NULL;
c->editbox.shortcut = shortcut;
c->editbox.percentwidth = percentage;
c->editbox.password = 0;
c->editbox.has_list = 1;
c->editbox.context2 = context2;
return c;
}
/*
* `ncolumns' is followed by (alternately) radio button titles and
* intorptrs, until a NULL in place of a title string is seen. Each
* title is expected to be followed by a shortcut _iff_ `shortcut'
* is NO_SHORTCUT.
*/
union control *ctrl_radiobuttons(struct controlset *s, char *label,
char shortcut, int ncolumns, intorptr helpctx,
handler_fn handler, intorptr context, ...)
{
va_list ap;
int i;
union control *c = ctrl_new(s, CTRL_RADIO, helpctx, handler, context);
c->radio.label = label ? dupstr(label) : NULL;
c->radio.shortcut = shortcut;
c->radio.ncolumns = ncolumns;
/*
* Initial pass along variable argument list to count the
* buttons.
*/
va_start(ap, context);
i = 0;
while (va_arg(ap, char *) != NULL) {
i++;
if (c->radio.shortcut == NO_SHORTCUT)
(void)va_arg(ap, int); /* char promotes to int in arg lists */
(void)va_arg(ap, intorptr);
}
va_end(ap);
c->radio.nbuttons = i;
if (c->radio.shortcut == NO_SHORTCUT)
c->radio.shortcuts = snewn(c->radio.nbuttons, char);
else
c->radio.shortcuts = NULL;
c->radio.buttons = snewn(c->radio.nbuttons, char *);
c->radio.buttondata = snewn(c->radio.nbuttons, intorptr);
/*
* Second pass along variable argument list to actually fill in
* the structure.
*/
va_start(ap, context);
for (i = 0; i < c->radio.nbuttons; i++) {
c->radio.buttons[i] = dupstr(va_arg(ap, char *));
if (c->radio.shortcut == NO_SHORTCUT)
c->radio.shortcuts[i] = va_arg(ap, int);
/* char promotes to int in arg lists */
c->radio.buttondata[i] = va_arg(ap, intorptr);
}
va_end(ap);
return c;
}
union control *ctrl_pushbutton(struct controlset *s,char *label,char shortcut,
intorptr helpctx, handler_fn handler,
intorptr context)
{
union control *c = ctrl_new(s, CTRL_BUTTON, helpctx, handler, context);
c->button.label = label ? dupstr(label) : NULL;
c->button.shortcut = shortcut;
c->button.isdefault = 0;
c->button.iscancel = 0;
return c;
}
union control *ctrl_listbox(struct controlset *s,char *label,char shortcut,
intorptr helpctx, handler_fn handler,
intorptr context)
{
union control *c = ctrl_new(s, CTRL_LISTBOX, helpctx, handler, context);
c->listbox.label = label ? dupstr(label) : NULL;
c->listbox.shortcut = shortcut;
c->listbox.height = 5; /* *shrug* a plausible default */
c->listbox.draglist = 0;
c->listbox.multisel = 0;
c->listbox.percentwidth = 100;
c->listbox.ncols = 0;
c->listbox.percentages = NULL;
return c;
}
union control *ctrl_droplist(struct controlset *s, char *label, char shortcut,
int percentage, intorptr helpctx,
handler_fn handler, intorptr context)
{
union control *c = ctrl_new(s, CTRL_LISTBOX, helpctx, handler, context);
c->listbox.label = label ? dupstr(label) : NULL;
c->listbox.shortcut = shortcut;
c->listbox.height = 0; /* means it's a drop-down list */
c->listbox.draglist = 0;
c->listbox.multisel = 0;
c->listbox.percentwidth = percentage;
c->listbox.ncols = 0;
c->listbox.percentages = NULL;
return c;
}
union control *ctrl_draglist(struct controlset *s,char *label,char shortcut,
intorptr helpctx, handler_fn handler,
intorptr context)
{
union control *c = ctrl_new(s, CTRL_LISTBOX, helpctx, handler, context);
c->listbox.label = label ? dupstr(label) : NULL;
c->listbox.shortcut = shortcut;
c->listbox.height = 5; /* *shrug* a plausible default */
c->listbox.draglist = 1;
c->listbox.multisel = 0;
c->listbox.percentwidth = 100;
c->listbox.ncols = 0;
c->listbox.percentages = NULL;
return c;
}
union control *ctrl_filesel(struct controlset *s,char *label,char shortcut,
char const *filter, int write, char *title,
intorptr helpctx, handler_fn handler,
intorptr context)
{
union control *c = ctrl_new(s, CTRL_FILESELECT, helpctx, handler, context);
c->fileselect.label = label ? dupstr(label) : NULL;
c->fileselect.shortcut = shortcut;
c->fileselect.filter = filter;
c->fileselect.for_writing = write;
c->fileselect.title = dupstr(title);
return c;
}
union control *ctrl_fontsel(struct controlset *s,char *label,char shortcut,
intorptr helpctx, handler_fn handler,
intorptr context)
{
union control *c = ctrl_new(s, CTRL_FONTSELECT, helpctx, handler, context);
c->fontselect.label = label ? dupstr(label) : NULL;
c->fontselect.shortcut = shortcut;
return c;
}
union control *ctrl_tabdelay(struct controlset *s, union control *ctrl)
{
union control *c = ctrl_new(s, CTRL_TABDELAY, P(NULL), NULL, P(NULL));
c->tabdelay.ctrl = ctrl;
return c;
}
union control *ctrl_text(struct controlset *s, char *text, intorptr helpctx)
{
union control *c = ctrl_new(s, CTRL_TEXT, helpctx, NULL, P(NULL));
c->text.label = dupstr(text);
return c;
}
union control *ctrl_checkbox(struct controlset *s, char *label, char shortcut,
intorptr helpctx, handler_fn handler,
intorptr context)
{
union control *c = ctrl_new(s, CTRL_CHECKBOX, helpctx, handler, context);
c->checkbox.label = label ? dupstr(label) : NULL;
c->checkbox.shortcut = shortcut;
return c;
}
void ctrl_free(union control *ctrl)
{
int i;
sfree(ctrl->generic.label);
switch (ctrl->generic.type) {
case CTRL_RADIO:
for (i = 0; i < ctrl->radio.nbuttons; i++)
sfree(ctrl->radio.buttons[i]);
sfree(ctrl->radio.buttons);
sfree(ctrl->radio.shortcuts);
sfree(ctrl->radio.buttondata);
break;
case CTRL_COLUMNS:
sfree(ctrl->columns.percentages);
break;
case CTRL_LISTBOX:
sfree(ctrl->listbox.percentages);
break;
case CTRL_FILESELECT:
sfree(ctrl->fileselect.title);
break;
}
sfree(ctrl);
}
void dlg_stdradiobutton_handler(union control *ctrl, void *dlg,
void *data, int event)
{
int button;
/*
* For a standard radio button set, the context parameter gives
* offsetof(targetfield, Config), and the extra data per button
* gives the value the target field should take if that button
* is the one selected.
*/
if (event == EVENT_REFRESH) {
for (button = 0; button < ctrl->radio.nbuttons; button++)
if (*(int *)ATOFFSET(data, ctrl->radio.context.i) ==
ctrl->radio.buttondata[button].i)
break;
/* We expected that `break' to happen, in all circumstances. */
assert(button < ctrl->radio.nbuttons);
dlg_radiobutton_set(ctrl, dlg, button);
} else if (event == EVENT_VALCHANGE) {
button = dlg_radiobutton_get(ctrl, dlg);
assert(button >= 0 && button < ctrl->radio.nbuttons);
*(int *)ATOFFSET(data, ctrl->radio.context.i) =
ctrl->radio.buttondata[button].i;
}
}
void dlg_stdcheckbox_handler(union control *ctrl, void *dlg,
void *data, int event)
{
int offset, invert;
/*
* For a standard checkbox, the context parameter gives
* offsetof(targetfield, Config), optionally ORed with
* CHECKBOX_INVERT.
*/
offset = ctrl->checkbox.context.i;
if (offset & CHECKBOX_INVERT) {
offset &= ~CHECKBOX_INVERT;
invert = 1;
} else
invert = 0;
/*
* C lacks a logical XOR, so the following code uses the idiom
* (!a ^ !b) to obtain the logical XOR of a and b. (That is, 1
* iff exactly one of a and b is nonzero, otherwise 0.)
*/
if (event == EVENT_REFRESH) {
dlg_checkbox_set(ctrl,dlg, (!*(int *)ATOFFSET(data,offset) ^ !invert));
} else if (event == EVENT_VALCHANGE) {
*(int *)ATOFFSET(data, offset) = !dlg_checkbox_get(ctrl,dlg) ^ !invert;
}
}
void dlg_stdeditbox_handler(union control *ctrl, void *dlg,
void *data, int event)
{
/*
* The standard edit-box handler expects the main `context'
* field to contain the `offsetof' a field in the structure
* pointed to by `data'. The secondary `context2' field
* indicates the type of this field:
*
* - if context2 > 0, the field is a char array and context2
* gives its size.
* - if context2 == -1, the field is an int and the edit box
* is numeric.
* - if context2 < -1, the field is an int and the edit box is
* _floating_, and (-context2) gives the scale. (E.g. if
* context2 == -1000, then typing 1.2 into the box will set
* the field to 1200.)
*/
int offset = ctrl->editbox.context.i;
int length = ctrl->editbox.context2.i;
if (length > 0) {
char *field = (char *)ATOFFSET(data, offset);
if (event == EVENT_REFRESH) {
dlg_editbox_set(ctrl, dlg, field);
} else if (event == EVENT_VALCHANGE) {
dlg_editbox_get(ctrl, dlg, field, length);
}
} else if (length < 0) {
int *field = (int *)ATOFFSET(data, offset);
char data[80];
if (event == EVENT_REFRESH) {
if (length == -1)
sprintf(data, "%d", *field);
else
sprintf(data, "%g", (double)*field / (double)(-length));
dlg_editbox_set(ctrl, dlg, data);
} else if (event == EVENT_VALCHANGE) {
dlg_editbox_get(ctrl, dlg, data, lenof(data));
if (length == -1)
*field = atoi(data);
else
*field = (int)((-length) * atof(data));
}
}
}
void dlg_stdfilesel_handler(union control *ctrl, void *dlg,
void *data, int event)
{
/*
* The standard file-selector handler expects the `context'
* field to contain the `offsetof' a Filename field in the
* structure pointed to by `data'.
*/
int offset = ctrl->fileselect.context.i;
if (event == EVENT_REFRESH) {
dlg_filesel_set(ctrl, dlg, *(Filename *)ATOFFSET(data, offset));
} else if (event == EVENT_VALCHANGE) {
dlg_filesel_get(ctrl, dlg, (Filename *)ATOFFSET(data, offset));
}
}
void dlg_stdfontsel_handler(union control *ctrl, void *dlg,
void *data, int event)
{
/*
* The standard file-selector handler expects the `context'
* field to contain the `offsetof' a FontSpec field in the
* structure pointed to by `data'.
*/
int offset = ctrl->fontselect.context.i;
if (event == EVENT_REFRESH) {
dlg_fontsel_set(ctrl, dlg, *(FontSpec *)ATOFFSET(data, offset));
} else if (event == EVENT_VALCHANGE) {
dlg_fontsel_get(ctrl, dlg, (FontSpec *)ATOFFSET(data, offset));
}
}

699
puttysrc/DIALOG.H Normal file
View File

@@ -0,0 +1,699 @@
/*
* Exports and types from dialog.c.
*/
/*
* This will come in handy for generic control handlers. Anyone
* knows how to make this more portable, let me know :-)
*/
#define ATOFFSET(data, offset) ( (void *) ( (char *)(data) + (offset) ) )
/*
* This is the big union which defines a single control, of any
* type.
*
* General principles:
* - _All_ pointers in this structure are expected to point to
* dynamically allocated things, unless otherwise indicated.
* - `char' fields giving keyboard shortcuts are expected to be
* NO_SHORTCUT if no shortcut is desired for a particular control.
* - The `label' field can often be NULL, which will cause the
* control to not have a label at all. This doesn't apply to
* checkboxes and push buttons, in which the label is not
* separate from the control.
*/
#define NO_SHORTCUT '\0'
enum {
CTRL_TEXT, /* just a static line of text */
CTRL_EDITBOX, /* label plus edit box */
CTRL_RADIO, /* label plus radio buttons */
CTRL_CHECKBOX, /* checkbox (contains own label) */
CTRL_BUTTON, /* simple push button (no label) */
CTRL_LISTBOX, /* label plus list box */
CTRL_COLUMNS, /* divide window into columns */
CTRL_FILESELECT, /* label plus filename selector */
CTRL_FONTSELECT, /* label plus font selector */
CTRL_TABDELAY /* see `tabdelay' below */
};
/*
* Many controls have `intorptr' unions for storing user data,
* since the user might reasonably want to store either an integer
* or a void * pointer. Here I define a union, and two convenience
* functions to create that union from actual integers or pointers.
*
* The convenience functions are declared as inline if possible.
* Otherwise, they're declared here and defined when this header is
* included with DEFINE_INTORPTR_FNS defined. This is a total pain,
* but such is life.
*/
typedef union { void *p; int i; } intorptr;
#ifndef INLINE
intorptr I(int i);
intorptr P(void *p);
#endif
#if defined DEFINE_INTORPTR_FNS || defined INLINE
#ifdef INLINE
#define PREFIX INLINE
#else
#define PREFIX
#endif
PREFIX intorptr I(int i) { intorptr ret; ret.i = i; return ret; }
PREFIX intorptr P(void *p) { intorptr ret; ret.p = p; return ret; }
#undef PREFIX
#endif
/*
* Each control has an `int' field specifying which columns it
* occupies in a multi-column part of the dialog box. These macros
* pack and unpack that field.
*
* If a control belongs in exactly one column, just specifying the
* column number is perfectly adequate.
*/
#define COLUMN_FIELD(start, span) ( (((span)-1) << 16) + (start) )
#define COLUMN_START(field) ( (field) & 0xFFFF )
#define COLUMN_SPAN(field) ( (((field) >> 16) & 0xFFFF) + 1 )
union control;
/*
* The number of event types is being deliberately kept small, on
* the grounds that not all platforms might be able to report a
* large number of subtle events. We have:
* - the special REFRESH event, called when a control's value
* needs setting
* - the ACTION event, called when the user does something that
* positively requests action (double-clicking a list box item,
* or pushing a push-button)
* - the VALCHANGE event, called when the user alters the setting
* of the control in a way that is usually considered to alter
* the underlying data (toggling a checkbox or radio button,
* moving the items around in a drag-list, editing an edit
* control)
* - the SELCHANGE event, called when the user alters the setting
* of the control in a more minor way (changing the selected
* item in a list box).
* - the CALLBACK event, which happens after the handler routine
* has requested a subdialog (file selector, font selector,
* colour selector) and it has come back with information.
*/
enum {
EVENT_REFRESH,
EVENT_ACTION,
EVENT_VALCHANGE,
EVENT_SELCHANGE,
EVENT_CALLBACK
};
typedef void (*handler_fn)(union control *ctrl, void *dlg,
void *data, int event);
#define STANDARD_PREFIX \
int type; \
char *label; \
int tabdelay; \
int column; \
handler_fn handler; \
intorptr context; \
intorptr helpctx
union control {
/*
* The first possibility in this union is the generic header
* shared by all the structures, which we are therefore allowed
* to access through any one of them.
*/
struct {
int type;
/*
* Every control except CTRL_COLUMNS has _some_ sort of
* label. By putting it in the `generic' union as well as
* everywhere else, we avoid having to have an irritating
* switch statement when we go through and deallocate all
* the memory in a config-box structure.
*
* Yes, this does mean that any non-NULL value in this
* field is expected to be dynamically allocated and
* freeable.
*
* For CTRL_COLUMNS, this field MUST be NULL.
*/
char *label;
/*
* If `tabdelay' is non-zero, it indicates that this
* particular control should not yet appear in the tab
* order. A subsequent CTRL_TABDELAY entry will place it.
*/
int tabdelay;
/*
* Indicate which column(s) this control occupies. This can
* be unpacked into starting column and column span by the
* COLUMN macros above.
*/
int column;
/*
* Most controls need to provide a function which gets
* called when that control's setting is changed, or when
* the control's setting needs initialising.
*
* The `data' parameter points to the writable data being
* modified as a result of the configuration activity; for
* example, the PuTTY `Config' structure, although not
* necessarily.
*
* The `dlg' parameter is passed back to the platform-
* specific routines to read and write the actual control
* state.
*/
handler_fn handler;
/*
* Almost all of the above functions will find it useful to
* be able to store a piece of `void *' or `int' data.
*/
intorptr context;
/*
* For any control, we also allow the storage of a piece of
* data for use by context-sensitive help. For example, on
* Windows you can click the magic question mark and then
* click a control, and help for that control should spring
* up. Hence, here is a slot in which to store per-control
* data that a particular platform-specific driver can use
* to ensure it brings up the right piece of help text.
*/
intorptr helpctx;
} generic;
struct {
STANDARD_PREFIX;
union control *ctrl;
} tabdelay;
struct {
STANDARD_PREFIX;
} text;
struct {
STANDARD_PREFIX;
char shortcut; /* keyboard shortcut */
/*
* Percentage of the dialog-box width used by the edit box.
* If this is set to 100, the label is on its own line;
* otherwise the label is on the same line as the box
* itself.
*/
int percentwidth;
int password; /* details of input are hidden */
/*
* A special case of the edit box is the combo box, which
* has a drop-down list built in. (Note that a _non_-
* editable drop-down list is done as a special case of a
* list box.)
*/
int has_list;
/*
* Edit boxes tend to need two items of context, so here's
* a spare.
*/
intorptr context2;
} editbox;
struct {
STANDARD_PREFIX;
/*
* `shortcut' here is a single keyboard shortcut which is
* expected to select the whole group of radio buttons. It
* can be NO_SHORTCUT if required, and there is also a way
* to place individual shortcuts on each button; see below.
*/
char shortcut;
/*
* There are separate fields for `ncolumns' and `nbuttons'
* for several reasons.
*
* Firstly, we sometimes want the last of a set of buttons
* to have a longer label than the rest; we achieve this by
* setting `ncolumns' higher than `nbuttons', and the
* layout code is expected to understand that the final
* button should be given all the remaining space on the
* line. This sounds like a ludicrously specific special
* case (if we're doing this sort of thing, why not have
* the general ability to have a particular button span
* more than one column whether it's the last one or not?)
* but actually it's reasonably common for the sort of
* three-way control you get a lot of in PuTTY: `yes'
* versus `no' versus `some more complex way to decide'.
*
* Secondly, setting `nbuttons' higher than `ncolumns' lets
* us have more than one line of radio buttons for a single
* setting. A very important special case of this is
* setting `ncolumns' to 1, so that each button is on its
* own line.
*/
int ncolumns;
int nbuttons;
/*
* This points to a dynamically allocated array of `char *'
* pointers, each of which points to a dynamically
* allocated string.
*/
char **buttons; /* `nbuttons' button labels */
/*
* This points to a dynamically allocated array of `char'
* giving the individual keyboard shortcuts for each radio
* button. The array may be NULL if none are required.
*/
char *shortcuts; /* `nbuttons' shortcuts; may be NULL */
/*
* This points to a dynamically allocated array of
* intorptr, giving helpful data for each button.
*/
intorptr *buttondata; /* `nbuttons' entries; may be NULL */
} radio;
struct {
STANDARD_PREFIX;
char shortcut;
} checkbox;
struct {
STANDARD_PREFIX;
char shortcut;
/*
* At least Windows has the concept of a `default push
* button', which gets implicitly pressed when you hit
* Return even if it doesn't have the input focus.
*/
int isdefault;
/*
* Also, the reverse of this: a default cancel-type button,
* which is implicitly pressed when you hit Escape.
*/
int iscancel;
} button;
struct {
STANDARD_PREFIX;
char shortcut; /* keyboard shortcut */
/*
* Height of the list box, in approximate number of lines.
* If this is zero, the list is a drop-down list.
*/
int height; /* height in lines */
/*
* If this is set, the list elements can be reordered by
* the user (by drag-and-drop or by Up and Down buttons,
* whatever the per-platform implementation feels
* comfortable with). This is not guaranteed to work on a
* drop-down list, so don't try it!
*/
int draglist;
/*
* If this is non-zero, the list can have more than one
* element selected at a time. This is not guaranteed to
* work on a drop-down list, so don't try it!
*
* Different non-zero values request slightly different
* types of multi-selection (this may well be meaningful
* only in GTK, so everyone else can ignore it if they
* want). 1 means the list box expects to have individual
* items selected, whereas 2 means it expects the user to
* want to select a large contiguous range at a time.
*/
int multisel;
/*
* Percentage of the dialog-box width used by the list box.
* If this is set to 100, the label is on its own line;
* otherwise the label is on the same line as the box
* itself. Setting this to anything other than 100 is not
* guaranteed to work on a _non_-drop-down list, so don't
* try it!
*/
int percentwidth;
/*
* Some list boxes contain strings that contain tab
* characters. If `ncols' is greater than 0, then
* `percentages' is expected to be non-zero and to contain
* the respective widths of `ncols' columns, which together
* will exactly fit the width of the list box. Otherwise
* `percentages' must be NULL.
*/
int ncols; /* number of columns */
int *percentages; /* % width of each column */
} listbox;
struct {
STANDARD_PREFIX;
char shortcut;
/*
* `filter' dictates what type of files will be selected by
* default; for example, when selecting private key files
* the file selector would do well to only show .PPK files
* (on those systems where this is the chosen extension).
*
* The precise contents of `filter' are platform-defined,
* unfortunately. The special value NULL means `all files'
* and is always a valid fallback.
*
* Unlike almost all strings in this structure, this value
* is NOT expected to require freeing (although of course
* you can always use ctrl_alloc if you do need to create
* one on the fly). This is because the likely mode of use
* is to define string constants in a platform-specific
* header file, and directly reference those. Or worse, a
* particular platform might choose to cast integers into
* this pointer type...
*/
char const *filter;
/*
* Some systems like to know whether a file selector is
* choosing a file to read or one to write (and possibly
* create).
*/
int for_writing;
/*
* On at least some platforms, the file selector is a
* separate dialog box, and contains a user-settable title.
*
* This value _is_ expected to require freeing.
*/
char *title;
} fileselect;
struct {
/* In this variant, `label' MUST be NULL. */
STANDARD_PREFIX;
int ncols; /* number of columns */
int *percentages; /* % width of each column */
/*
* Every time this control type appears, exactly one of
* `ncols' and the previous number of columns MUST be one.
* Attempting to allow a seamless transition from a four-
* to a five-column layout, for example, would be way more
* trouble than it was worth. If you must lay things out
* like that, define eight unevenly sized columns and use
* column-spanning a lot. But better still, just don't.
*
* `percentages' may be NULL if ncols==1, to save space.
*/
} columns;
struct {
STANDARD_PREFIX;
char shortcut;
} fontselect;
};
#undef STANDARD_PREFIX
/*
* `controlset' is a container holding an array of `union control'
* structures, together with a panel name and a title for the whole
* set. In Windows and any similar-looking GUI, each `controlset'
* in the config will be a container box within a panel.
*
* Special case: if `boxname' is NULL, the control set gives an
* overall title for an entire panel of controls.
*/
struct controlset {
char *pathname; /* panel path, e.g. "SSH/Tunnels" */
char *boxname; /* internal short name of controlset */
char *boxtitle; /* title of container box */
int ncolumns; /* current no. of columns at bottom */
int ncontrols; /* number of `union control' in array */
int ctrlsize; /* allocated size of array */
union control **ctrls; /* actual array */
};
/*
* This is the container structure which holds a complete set of
* controls.
*/
struct controlbox {
int nctrlsets; /* number of ctrlsets */
int ctrlsetsize; /* ctrlset size */
struct controlset **ctrlsets; /* actual array of ctrlsets */
int nfrees;
int freesize;
void **frees; /* array of aux data areas to free */
};
struct controlbox *ctrl_new_box(void);
void ctrl_free_box(struct controlbox *);
/*
* Standard functions used for populating a controlbox structure.
*/
/* Set up a panel title. */
struct controlset *ctrl_settitle(struct controlbox *,
char *path, char *title);
/* Retrieve a pointer to a controlset, creating it if absent. */
struct controlset *ctrl_getset(struct controlbox *,
char *path, char *name, char *boxtitle);
void ctrl_free_set(struct controlset *);
void ctrl_free(union control *);
/*
* This function works like `malloc', but the memory it returns
* will be automatically freed when the controlbox is freed. Note
* that a controlbox is a dialog-box _template_, not an instance,
* and so data allocated through this function is better not used
* to hold modifiable per-instance things. It's mostly here for
* allocating structures to be passed as control handler params.
*/
void *ctrl_alloc(struct controlbox *b, size_t size);
/*
* Individual routines to create `union control' structures in a controlset.
*
* Most of these routines allow the most common fields to be set
* directly, and put default values in the rest. Each one returns a
* pointer to the `union control' it created, so that final tweaks
* can be made.
*/
/* `ncolumns' is followed by that many percentages, as integers. */
union control *ctrl_columns(struct controlset *, int ncolumns, ...);
union control *ctrl_editbox(struct controlset *, char *label, char shortcut,
int percentage, intorptr helpctx,
handler_fn handler,
intorptr context, intorptr context2);
union control *ctrl_combobox(struct controlset *, char *label, char shortcut,
int percentage, intorptr helpctx,
handler_fn handler,
intorptr context, intorptr context2);
/*
* `ncolumns' is followed by (alternately) radio button titles and
* intorptrs, until a NULL in place of a title string is seen. Each
* title is expected to be followed by a shortcut _iff_ `shortcut'
* is NO_SHORTCUT.
*/
union control *ctrl_radiobuttons(struct controlset *, char *label,
char shortcut, int ncolumns,
intorptr helpctx,
handler_fn handler, intorptr context, ...);
union control *ctrl_pushbutton(struct controlset *,char *label,char shortcut,
intorptr helpctx,
handler_fn handler, intorptr context);
union control *ctrl_listbox(struct controlset *,char *label,char shortcut,
intorptr helpctx,
handler_fn handler, intorptr context);
union control *ctrl_droplist(struct controlset *, char *label, char shortcut,
int percentage, intorptr helpctx,
handler_fn handler, intorptr context);
union control *ctrl_draglist(struct controlset *,char *label,char shortcut,
intorptr helpctx,
handler_fn handler, intorptr context);
union control *ctrl_filesel(struct controlset *,char *label,char shortcut,
char const *filter, int write, char *title,
intorptr helpctx,
handler_fn handler, intorptr context);
union control *ctrl_fontsel(struct controlset *,char *label,char shortcut,
intorptr helpctx,
handler_fn handler, intorptr context);
union control *ctrl_text(struct controlset *, char *text, intorptr helpctx);
union control *ctrl_checkbox(struct controlset *, char *label, char shortcut,
intorptr helpctx,
handler_fn handler, intorptr context);
union control *ctrl_tabdelay(struct controlset *, union control *);
/*
* Standard handler routines to cover most of the common cases in
* the config box.
*/
/*
* The standard radio-button handler expects the main `context'
* field to contain the `offsetof' of an int field in the structure
* pointed to by `data', and expects each of the individual button
* data to give a value for that int field.
*/
void dlg_stdradiobutton_handler(union control *ctrl, void *dlg,
void *data, int event);
/*
* The standard checkbox handler expects the main `context' field
* to contain the `offsetof' an int field in the structure pointed
* to by `data', optionally ORed with CHECKBOX_INVERT to indicate
* that the sense of the datum is opposite to the sense of the
* checkbox.
*/
#define CHECKBOX_INVERT (1<<30)
void dlg_stdcheckbox_handler(union control *ctrl, void *dlg,
void *data, int event);
/*
* The standard edit-box handler expects the main `context' field
* to contain the `offsetof' a field in the structure pointed to by
* `data'. The secondary `context2' field indicates the type of
* this field:
*
* - if context2 > 0, the field is a char array and context2 gives
* its size.
* - if context2 == -1, the field is an int and the edit box is
* numeric.
* - if context2 < -1, the field is an int and the edit box is
* _floating_, and (-context2) gives the scale. (E.g. if
* context2 == -1000, then typing 1.2 into the box will set the
* field to 1200.)
*/
void dlg_stdeditbox_handler(union control *ctrl, void *dlg,
void *data, int event);
/*
* The standard file-selector handler expects the main `context'
* field to contain the `offsetof' a Filename field in the
* structure pointed to by `data'.
*/
void dlg_stdfilesel_handler(union control *ctrl, void *dlg,
void *data, int event);
/*
* The standard font-selector handler expects the main `context'
* field to contain the `offsetof' a Font field in the structure
* pointed to by `data'.
*/
void dlg_stdfontsel_handler(union control *ctrl, void *dlg,
void *data, int event);
/*
* Routines the platform-independent dialog code can call to read
* and write the values of controls.
*/
void dlg_radiobutton_set(union control *ctrl, void *dlg, int whichbutton);
int dlg_radiobutton_get(union control *ctrl, void *dlg);
void dlg_checkbox_set(union control *ctrl, void *dlg, int checked);
int dlg_checkbox_get(union control *ctrl, void *dlg);
void dlg_editbox_set(union control *ctrl, void *dlg, char const *text);
void dlg_editbox_get(union control *ctrl, void *dlg, char *buffer, int length);
/* The `listbox' functions can also apply to combo boxes. */
void dlg_listbox_clear(union control *ctrl, void *dlg);
void dlg_listbox_del(union control *ctrl, void *dlg, int index);
void dlg_listbox_add(union control *ctrl, void *dlg, char const *text);
/*
* Each listbox entry may have a numeric id associated with it.
* Note that some front ends only permit a string to be stored at
* each position, which means that _if_ you put two identical
* strings in any listbox then you MUST not assign them different
* IDs and expect to get meaningful results back.
*/
void dlg_listbox_addwithid(union control *ctrl, void *dlg,
char const *text, int id);
int dlg_listbox_getid(union control *ctrl, void *dlg, int index);
/* dlg_listbox_index returns <0 if no single element is selected. */
int dlg_listbox_index(union control *ctrl, void *dlg);
int dlg_listbox_issel(union control *ctrl, void *dlg, int index);
void dlg_listbox_select(union control *ctrl, void *dlg, int index);
void dlg_text_set(union control *ctrl, void *dlg, char const *text);
void dlg_filesel_set(union control *ctrl, void *dlg, Filename fn);
void dlg_filesel_get(union control *ctrl, void *dlg, Filename *fn);
void dlg_fontsel_set(union control *ctrl, void *dlg, FontSpec fn);
void dlg_fontsel_get(union control *ctrl, void *dlg, FontSpec *fn);
/*
* Bracketing a large set of updates in these two functions will
* cause the front end (if possible) to delay updating the screen
* until it's all complete, thus avoiding flicker.
*/
void dlg_update_start(union control *ctrl, void *dlg);
void dlg_update_done(union control *ctrl, void *dlg);
/*
* Set input focus into a particular control.
*/
void dlg_set_focus(union control *ctrl, void *dlg);
/*
* Change the label text on a control.
*/
void dlg_label_change(union control *ctrl, void *dlg, char const *text);
/*
* Return the `ctrl' structure for the most recent control that had
* the input focus apart from the one mentioned. This is NOT
* GUARANTEED to work on all platforms, so don't base any critical
* functionality on it!
*/
union control *dlg_last_focused(union control *ctrl, void *dlg);
/*
* During event processing, you might well want to give an error
* indication to the user. dlg_beep() is a quick and easy generic
* error; dlg_error() puts up a message-box or equivalent.
*/
void dlg_beep(void *dlg);
void dlg_error_msg(void *dlg, char *msg);
/*
* This function signals to the front end that the dialog's
* processing is completed, and passes an integer value (typically
* a success status).
*/
void dlg_end(void *dlg, int value);
/*
* Routines to manage a (per-platform) colour selector.
* dlg_coloursel_start() is called in an event handler, and
* schedules the running of a colour selector after the event
* handler returns. The colour selector will send EVENT_CALLBACK to
* the control that spawned it, when it's finished;
* dlg_coloursel_results() fetches the results, as integers from 0
* to 255; it returns nonzero on success, or zero if the colour
* selector was dismissed by hitting Cancel or similar.
*
* dlg_coloursel_start() accepts an RGB triple which is used to
* initialise the colour selector to its starting value.
*/
void dlg_coloursel_start(union control *ctrl, void *dlg,
int r, int g, int b);
int dlg_coloursel_results(union control *ctrl, void *dlg,
int *r, int *g, int *b);
/*
* This routine is used by the platform-independent code to
* indicate that the value of a particular control is likely to
* have changed. It triggers a call of the handler for that control
* with `event' set to EVENT_REFRESH.
*
* If `ctrl' is NULL, _all_ controls in the dialog get refreshed
* (for loading or saving entire sets of settings).
*/
void dlg_refresh(union control *ctrl, void *dlg);
/*
* It's perfectly possible that individual controls might need to
* allocate or store per-dialog-instance data, so here's a
* mechanism.
*
* `dlg_get_privdata' and `dlg_set_privdata' allow the user to get
* and set a void * pointer associated with the control in
* question. `dlg_alloc_privdata' will allocate memory, store a
* pointer to that memory in the private data field, and arrange
* for it to be automatically deallocated on dialog cleanup.
*/
void *dlg_get_privdata(union control *ctrl, void *dlg);
void dlg_set_privdata(union control *ctrl, void *dlg, void *ptr);
void *dlg_alloc_privdata(union control *ctrl, void *dlg, size_t size);
/*
* Standard helper functions for reading a controlbox structure.
*/
/*
* Find the index of next controlset in a controlbox for a given
* path, or -1 if no such controlset exists. If -1 is passed as
* input, finds the first. Intended usage is something like
*
* for (index=-1; (index=ctrl_find_path(ctrlbox, index, path)) >= 0 ;) {
* ... process this controlset ...
* }
*/
int ctrl_find_path(struct controlbox *b, char *path, int index);
int ctrl_path_elements(char *path);
/* Return the number of matching path elements at the starts of p1 and p2,
* or INT_MAX if the paths are identical. */
int ctrl_path_compare(char *p1, char *p2);

36
puttysrc/DOC/BLURB.BUT Normal file
View File

@@ -0,0 +1,36 @@
\define{versionidblurb} \versionid $Id: blurb.but 7048 2007-01-01 21:19:14Z jacob $
\title PuTTY User Manual
\cfg{xhtml-leaf-level}{1}
\cfg{xhtml-leaf-smallest-contents}{2}
\cfg{xhtml-leaf-contains-contents}{true}
\cfg{xhtml-body-end}{<p>If you want to provide feedback on this manual
or on the PuTTY tools themselves, see the
<a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/feedback.html">Feedback
page</a>.</p>}
\cfg{html-template-fragment}{%k}{%b}
\cfg{info-max-file-size}{0}
\cfg{xhtml-contents-filename}{index.html}
\cfg{text-filename}{puttydoc.txt}
\cfg{winhelp-filename}{putty.hlp}
\cfg{info-filename}{putty.info}
PuTTY is a free (MIT-licensed) Win32 Telnet and SSH client. This
manual documents PuTTY, and its companion utilities PSCP, PSFTP,
Plink, Pageant and PuTTYgen.
\e{Note to Unix users:} this manual currently primarily documents the
Windows versions of the PuTTY utilities. Some options are therefore
mentioned that are absent from the \i{Unix version}; the Unix version has
features not described here; and the \i\cw{pterm} and command-line
\cw{puttygen} utilities are not described at all. The only
Unix-specific documentation that currently exists is the
\I{man pages for PuTTY tools}man pages.
\copyright This manual is copyright 2001-2007 Simon Tatham. All
rights reserved. You may distribute this documentation under the MIT
licence. See \k{licence} for the licence text in full.

23
puttysrc/DOC/CHM.BUT Normal file
View File

@@ -0,0 +1,23 @@
\# File containing the magic HTML configuration directives to create
\# an MS HTML Help project. We put this on the end of the PuTTY
\# docs build command line to build the HHP and friends.
\cfg{html-leaf-level}{infinite}
\cfg{html-leaf-contains-contents}{false}
\cfg{html-suppress-navlinks}{true}
\cfg{html-suppress-address}{true}
\cfg{html-contents-filename}{index.html}
\cfg{html-template-filename}{%k.html}
\cfg{html-template-fragment}{%k}
\cfg{html-mshtmlhelp-chm}{putty.chm}
\cfg{html-mshtmlhelp-project}{putty.hhp}
\cfg{html-mshtmlhelp-contents}{putty.hhc}
\cfg{html-mshtmlhelp-index}{putty.hhk}
\cfg{html-body-end}{}
\cfg{html-head-end}{<link rel="stylesheet" type="text/css" href="chm.css">}
\versionid $Id: chm.but 7272 2007-02-11 18:13:56Z jacob $

7
puttysrc/DOC/CHM.CSS Normal file
View File

@@ -0,0 +1,7 @@
/* Stylesheet for a Windows .CHM help file */
body { font-size: 75%; font-family: Verdana, Arial, Helvetica, Sans-Serif; }
h1 { font-weight: bold; font-size: 150%; }
h2 { font-weight: bold; font-size: 130%; }
h3 { font-weight: bold; font-size: 120%; }

3097
puttysrc/DOC/CONFIG.BUT Normal file

File diff suppressed because it is too large Load Diff

334
puttysrc/DOC/ERRORS.BUT Normal file
View File

@@ -0,0 +1,334 @@
\define{versioniderrors} \versionid $Id: errors.but 6461 2005-11-14 09:41:42Z jacob $
\C{errors} Common \i{error messages}
This chapter lists a number of common error messages which PuTTY and
its associated tools can produce, and explains what they mean in
more detail.
We do not attempt to list \e{all} error messages here: there are
many which should never occur, and some which should be
self-explanatory. If you get an error message which is not listed in
this chapter and which you don't understand, report it to us as a
bug (see \k{feedback}) and we will add documentation for it.
\H{errors-hostkey-absent} \q{The server's host key is not cached in
the registry}
\cfg{winhelp-topic}{errors.hostkey.absent}
This error message occurs when PuTTY connects to a new SSH server.
Every server identifies itself by means of a host key; once PuTTY
knows the host key for a server, it will be able to detect if a
malicious attacker redirects your connection to another machine.
If you see this message, it means that PuTTY has not seen this host
key before, and has no way of knowing whether it is correct or not.
You should attempt to verify the host key by other means, such as
asking the machine's administrator.
If you see this message and you know that your installation of PuTTY
\e{has} connected to the same server before, it may have been
recently upgraded to SSH protocol version 2. SSH protocols 1 and 2
use separate host keys, so when you first use \i{SSH-2} with a server
you have only used SSH-1 with before, you will see this message
again. You should verify the correctness of the key as before.
See \k{gs-hostkey} for more information on host keys.
\H{errors-hostkey-wrong} \q{WARNING - POTENTIAL SECURITY BREACH!}
\cfg{winhelp-topic}{errors.hostkey.changed}
This message, followed by \q{The server's host key does not match
the one PuTTY has cached in the registry}, means that PuTTY has
connected to the SSH server before, knows what its host key
\e{should} be, but has found a different one.
This may mean that a malicious attacker has replaced your server
with a different one, or has redirected your network connection to
their own machine. On the other hand, it may simply mean that the
administrator of your server has accidentally changed the key while
upgrading the SSH software; this \e{shouldn't} happen but it is
unfortunately possible.
You should contact your server's administrator and see whether they
expect the host key to have changed. If so, verify the new host key
in the same way as you would if it was new.
See \k{gs-hostkey} for more information on host keys.
\H{errors-portfwd-space} \q{Out of space for port forwardings}
PuTTY has a fixed-size buffer which it uses to store the details of
all \i{port forwardings} you have set up in an SSH session. If you
specify too many port forwardings on the PuTTY or Plink command line
and this buffer becomes full, you will see this error message.
We need to fix this (fixed-size buffers are almost always a mistake)
but we haven't got round to it. If you actually have trouble with
this, let us know and we'll move it up our priority list.
\H{errors-cipher-warning} \q{The first cipher supported by the server is
... below the configured warning threshold}
This occurs when the SSH server does not offer any ciphers which you
have configured PuTTY to consider strong enough. By default, PuTTY
puts up this warning only for \ii{single-DES} and \i{Arcfour} encryption.
See \k{config-ssh-encryption} for more information on this message.
\H{errors-toomanyauth} \q{Server sent disconnect message type 2
(protocol error): "Too many authentication failures for root"}
This message is produced by an \i{OpenSSH} (or \i{Sun SSH}) server if it
receives more failed authentication attempts than it is willing to
tolerate.
This can easily happen if you are using Pageant and have a
large number of keys loaded into it, since these servers count each
offer of a public key as an authentication attempt. This can be worked
around by specifying the key that's required for the authentication in
the PuTTY configuration (see \k{config-ssh-privkey}); PuTTY will ignore
any other keys Pageant may have, but will ask Pageant to do the
authentication, so that you don't have to type your passphrase.
On the server, this can be worked around by disabling public-key
authentication or (for Sun SSH only) by increasing \c{MaxAuthTries} in
\c{sshd_config}.
\H{errors-memory} \q{\ii{Out of memory}}
This occurs when PuTTY tries to allocate more memory than the system
can give it. This \e{may} happen for genuine reasons: if the
computer really has run out of memory, or if you have configured an
extremely large number of lines of scrollback in your terminal.
PuTTY is not able to recover from running out of memory; it will
terminate immediately after giving this error.
However, this error can also occur when memory is not running out at
all, because PuTTY receives data in the wrong format. In SSH-2 and
also in SFTP, the server sends the length of each message before the
message itself; so PuTTY will receive the length, try to allocate
space for the message, and then receive the rest of the message. If
the length PuTTY receives is garbage, it will try to allocate a
ridiculous amount of memory, and will terminate with an \q{Out of
memory} error.
This can happen in SSH-2, if PuTTY and the server have not enabled
encryption in the same way (see \k{faq-outofmem} in the FAQ). Some
versions of \i{OpenSSH} have a known problem with this: see
\k{faq-openssh-bad-openssl}.
This can also happen in PSCP or PSFTP, if your \i{login scripts} on the
server generate output: the client program will be expecting an SFTP
message starting with a length, and if it receives some text from
your login scripts instead it will try to interpret them as a
message length. See \k{faq-outofmem2} for details of this.
\H{errors-internal} \q{\ii{Internal error}}, \q{\ii{Internal fault}},
\q{\ii{Assertion failed}}
Any error beginning with the word \q{Internal} should \e{never}
occur. If it does, there is a bug in PuTTY by definition; please see
\k{feedback} and report it to us.
Similarly, any error message starting with \q{Assertion failed} is a
bug in PuTTY. Please report it to us, and include the exact text
from the error message box.
\H{errors-cant-load-key} \q{Unable to use this private key file},
\q{Couldn't load private key}, \q{Key is of wrong type}
\cfg{winhelp-topic}{errors.cantloadkey}
Various forms of this error are printed in the PuTTY window, or
written to the PuTTY Event Log (see \k{using-eventlog}) when trying
public-key authentication, or given by Pageant when trying to load a
private key.
If you see one of these messages, it often indicates that you've tried
to load a key of an inappropriate type into PuTTY, Plink, PSCP, PSFTP,
or Pageant.
You may have specified a key that's inappropriate for the connection
you're making. The SSH-1 and SSH-2 protocols require different private
key formats, and a SSH-1 key can't be used for a SSH-2 connection (or
vice versa).
Alternatively, you may have tried to load an SSH-2 key in a \q{foreign}
format (OpenSSH or \cw{ssh.com}) directly into one of the PuTTY tools,
in which case you need to import it into PuTTY's native format
(\c{*.PPK}) using PuTTYgen - see \k{puttygen-conversions}.
\H{errors-refused} \q{Server refused our public key} or \q{Key
refused}
Various forms of this error are printed in the PuTTY window, or
written to the PuTTY Event Log (see \k{using-eventlog}) when trying
public-key authentication.
If you see one of these messages, it means that PuTTY has sent a
public key to the server and offered to authenticate with it, and
the server has refused to accept authentication. This usually means
that the server is not configured to accept this key to authenticate
this user.
This is almost certainly not a problem with PuTTY. If you see this
type of message, the first thing you should do is check your
\e{server} configuration carefully. Common errors include having
the wrong permissions or ownership set on the public key or the
user's home directory on the server. Also, read the PuTTY Event Log;
the server may have sent diagnostic messages explaining exactly what
problem it had with your setup.
\H{errors-access-denied} \q{Access denied}, \q{Authentication refused}
Various forms of this error are printed in the PuTTY window, or
written to the PuTTY Event Log (see \k{using-eventlog}) during
authentication.
If you see one of these messages, it means that the server has refused
all the forms of authentication PuTTY has tried and it has no further
ideas.
It may be worth checking the Event Log for diagnostic messages from
the server giving more detail.
This error can be caused by buggy SSH-1 servers that fail to cope with
the various strategies we use for camouflaging passwords in transit.
Upgrade your server, or use the workarounds described in
\k{config-ssh-bug-ignore1} and possibly \k{config-ssh-bug-plainpw1}.
\H{errors-crc} \q{Incorrect \i{CRC} received on packet} or \q{Incorrect
MAC received on packet}
This error occurs when PuTTY decrypts an SSH packet and its checksum
is not correct. This probably means something has gone wrong in the
encryption or decryption process. It's difficult to tell from this
error message whether the problem is in the client, in the server,
or in between.
A known server problem which can cause this error is described in
\k{faq-openssh-bad-openssl} in the FAQ.
\H{errors-garbled} \q{Incoming packet was garbled on decryption}
This error occurs when PuTTY decrypts an SSH packet and the
decrypted data makes no sense. This probably means something has
gone wrong in the encryption or decryption process. It's difficult
to tell from this error message whether the problem is in the client,
in the server, or in between.
If you get this error, one thing you could try would be to fiddle
with the setting of \q{Miscomputes SSH-2 encryption keys} on the Bugs
panel (see \k{config-ssh-bug-derivekey2}).
Another known server problem which can cause this error is described
in \k{faq-openssh-bad-openssl} in the FAQ.
\H{errors-x11-proxy} \q{PuTTY X11 proxy: \e{various errors}}
This family of errors are reported when PuTTY is doing X forwarding.
They are sent back to the X application running on the SSH server,
which will usually report the error to the user.
When PuTTY enables X forwarding (see \k{using-x-forwarding}) it
creates a virtual X display running on the SSH server. This display
requires authentication to connect to it (this is how PuTTY prevents
other users on your server machine from connecting through the PuTTY
proxy to your real X display). PuTTY also sends the server the
details it needs to enable clients to connect, and the server should
put this mechanism in place automatically, so your X applications
should just work.
A common reason why people see one of these messages is because they
used SSH to log in as one user (let's say \q{fred}), and then used
the Unix \c{su} command to become another user (typically \q{root}).
The original user, \q{fred}, has access to the X authentication data
provided by the SSH server, and can run X applications which are
forwarded over the SSH connection. However, the second user
(\q{root}) does not automatically have the authentication data
passed on to it, so attempting to run an X application as that user
often fails with this error.
If this happens, \e{it is not a problem with PuTTY}. You need to
arrange for your X authentication data to be passed from the user
you logged in as to the user you used \c{su} to become. How you do
this depends on your particular system; in fact many modern versions
of \c{su} do it automatically.
\H{errors-connaborted} \q{Network error: Software caused connection
abort}
This is a generic error produced by the Windows network code when it
kills an established connection for some reason. For example, it might
happen if you pull the network cable out of the back of an
Ethernet-connected computer, or if Windows has any other similar
reason to believe the entire network has become unreachable.
Windows also generates this error if it has given up on the machine
at the other end of the connection ever responding to it. If the
network between your client and server goes down and your client
then tries to send some data, Windows will make several attempts to
send the data and will then give up and kill the connection. In
particular, this can occur even if you didn't type anything, if you
are using SSH-2 and PuTTY attempts a key re-exchange. (See
\k{config-ssh-kex-rekey} for more about key re-exchange.)
(It can also occur if you are using keepalives in your connection.
Other people have reported that keepalives \e{fix} this error for
them. See \k{config-keepalive} for a discussion of the pros and cons
of keepalives.)
We are not aware of any reason why this error might occur that would
represent a bug in PuTTY. The problem is between you, your Windows
system, your network and the remote system.
\H{errors-connreset} \q{Network error: Connection reset by peer}
This error occurs when the machines at each end of a network
connection lose track of the state of the connection between them.
For example, you might see it if your SSH server crashes, and
manages to reboot fully before you next attempt to send data to it.
However, the most common reason to see this message is if you are
connecting through a \i{firewall} or a \i{NAT router} which has timed the
connection out. See \k{faq-idleout} in the FAQ for more details. You
may be able to improve the situation by using keepalives; see
\k{config-keepalive} for details on this.
Note that Windows can produce this error in some circumstances without
seeing a connection reset from the server, for instance if the
connection to the network is lost.
\H{errors-connrefused} \q{Network error: Connection refused}
This error means that the network connection PuTTY tried to make to
your server was rejected by the server. Usually this happens because
the server does not provide the service which PuTTY is trying to
access.
Check that you are connecting with the correct protocol (SSH, Telnet
or Rlogin), and check that the port number is correct. If that
fails, consult the administrator of your server.
\H{errors-conntimedout} \q{Network error: Connection timed out}
This error means that the network connection PuTTY tried to make to
your server received no response at all from the server. Usually
this happens because the server machine is completely isolated from
the network, or because it is turned off.
Check that you have correctly entered the host name or IP address of
your server machine. If that fails, consult the administrator of
your server.
\i{Unix} also generates this error when it tries to send data down a
connection and contact with the server has been completely lost
during a connection. (There is a delay of minutes before Unix gives
up on receiving a reply from the server.) This can occur if you type
things into PuTTY while the network is down, but it can also occur
if PuTTY decides of its own accord to send data: due to a repeat key
exchange in SSH-2 (see \k{config-ssh-kex-rekey}) or due to
keepalives (\k{config-keepalive}).

1430
puttysrc/DOC/FAQ.BUT Normal file

File diff suppressed because it is too large Load Diff

414
puttysrc/DOC/FEEDBACK.BUT Normal file
View File

@@ -0,0 +1,414 @@
\define{versionidfeedback} \versionid $Id: feedback.but 6895 2006-11-08 21:15:30Z jacob $
\A{feedback} \ii{Feedback} and \i{bug reporting}
This is a guide to providing feedback to the PuTTY development team.
It is provided as both a web page on the PuTTY site, and an appendix
in the PuTTY manual.
\K{feedback-general} gives some general guidelines for sending any
kind of e-mail to the development team. Following sections give more
specific guidelines for particular types of e-mail, such as bug
reports and feature requests.
\H{feedback-general} General guidelines
The PuTTY development team gets a \e{lot} of mail. If you can
possibly solve your own problem by reading the manual, reading the
FAQ, reading the web site, asking a fellow user, perhaps posting to a
newsgroup (see \k{feedback-other-fora}), or some other means, then it
would make our lives much easier.
We get so much e-mail that we literally do not have time to answer
it all. We regret this, but there's nothing we can do about it. So
if you can \e{possibly} avoid sending mail to the PuTTY team, we
recommend you do so. In particular, support requests
(\k{feedback-support}) are probably better sent to newsgroups, or
passed to a local expert if possible.
The PuTTY contact email address is a private \i{mailing list} containing
four or five core developers. Don't be put off by it being a mailing
list: if you need to send confidential data as part of a bug report,
you can trust the people on the list to respect that confidence.
Also, the archives aren't publicly available, so you shouldn't be
letting yourself in for any spam by sending us mail.
Please use a meaningful subject line on your message. We get a lot of
mail, and it's hard to find the message we're looking for if they all
have subject lines like \q{PuTTY bug}.
\S{feedback-largefiles} Sending large attachments
Since the PuTTY contact address is a mailing list, e-mails larger
than 40Kb will be held for inspection by the list administrator, and
will not be allowed through unless they really appear to be worth
their large size.
If you are considering sending any kind of large data file to the
PuTTY team, it's almost always a bad idea, or at the very least it
would be better to ask us first whether we actually need the file.
Alternatively, you could put the file on a web site and just send us
the URL; that way, we don't have to download it unless we decide we
actually need it, and only one of us needs to download it instead of
it being automatically copied to all the developers.
Some people like to send mail in MS Word format. Please \e{don't}
send us bug reports, or any other mail, as a Word document. Word
documents are roughly fifty times larger than writing the same
report in plain text. In addition, most of the PuTTY team read their
e-mail on Unix machines, so copying the file to a Windows box to run
Word is very inconvenient. Not only that, but several of us don't
even \e{have} a copy of Word!
Some people like to send us screen shots when demonstrating a
problem. Please don't do this without checking with us first - we
almost never actually need the information in the screen shot.
Sending a screen shot of an error box is almost certainly
unnecessary when you could just tell us in plain text what the error
was. (On some versions of Windows, pressing Ctrl-C when the error
box is displayed will copy the text of the message to the clipboard.)
Sending a full-screen shot is \e{occasionally} useful, but it's
probably still wise to check whether we need it before sending it.
If you \e{must} mail a screen shot, don't send it as a \cw{.BMP}
file. \cw{BMP}s have no compression and they are \e{much} larger
than other image formats such as PNG, TIFF and GIF. Convert the file
to a properly compressed image format before sending it.
Please don't mail us executables, at all. Our mail server blocks all
incoming e-mail containing executables, as a defence against the
vast numbers of e-mail viruses we receive every day. If you mail us
an executable, it will just bounce.
If you have made a tiny modification to the PuTTY code, please send
us a \e{patch} to the source code if possible, rather than sending
us a huge \cw{.ZIP} file containing the complete sources plus your
modification. If you've only changed 10 lines, we'd prefer to
receive a mail that's 30 lines long than one containing multiple
megabytes of data we already have.
\S{feedback-other-fora} Other places to ask for help
There are two Usenet newsgroups that are particularly relevant to the
PuTTY tools:
\b \W{news:comp.security.ssh}\c{comp.security.ssh}, for questions
specific to using the SSH protocol;
\b \W{news:comp.terminals}\c{comp.terminals}, for issues relating to
terminal emulation (for instance, keyboard problems).
Please use the newsgroup most appropriate to your query, and remember
that these are general newsgroups, not specifically about PuTTY.
If you don't have direct access to Usenet, you can access these
newsgroups through Google Groups
(\W{http://groups.google.com/}\cw{groups.google.com}).
\H{feedback-bugs} Reporting bugs
If you think you have found a bug in PuTTY, your first steps should
be:
\b Check the
\W{http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/}{Wishlist
page} on the PuTTY website, and see if we already know about the
problem. If we do, it is almost certainly not necessary to mail us
about it, unless you think you have extra information that might be
helpful to us in fixing it. (Of course, if we actually \e{need}
specific extra information about a particular bug, the Wishlist page
will say so.)
\b Check the
\W{http://www.chiark.greenend.org.uk/~sgtatham/putty/changes.html}{Change
Log} on the PuTTY website, and see if we have already fixed the bug
in the \i{development snapshots}.
\b Check the
\W{http://www.chiark.greenend.org.uk/~sgtatham/putty/faq.html}{FAQ}
on the PuTTY website (also provided as \k{faq} in the manual), and
see if it answers your question. The FAQ lists the most common
things which people think are bugs, but which aren't bugs.
\b Download the latest development snapshot and see if the problem
still happens with that. This really is worth doing. As a general
rule we aren't very interested in bugs that appear in the release
version but not in the development version, because that usually
means they are bugs we have \e{already fixed}. On the other hand, if
you can find a bug in the development version that doesn't appear in
the release, that's likely to be a new bug we've introduced since
the release and we're definitely interested in it.
If none of those options solved your problem, and you still need to
report a bug to us, it is useful if you include some general
information:
\b Tell us what \i{version of PuTTY} you are running. To find this out,
use the \q{About PuTTY} option from the System menu. Please \e{do
not} just tell us \q{I'm running the latest version}; e-mail can be
delayed and it may not be obvious which version was the latest at
the time you sent the message.
\b PuTTY is a multi-platform application; tell us what version of what
OS you are running PuTTY on. (If you're running on Unix, or Windows
for Alpha, tell us, or we'll assume you're running on Windows for
Intel as this is overwhelmingly the case.)
\b Tell us what protocol you are connecting with: SSH, Telnet,
Rlogin or Raw mode.
\b Tell us what kind of server you are connecting to; what OS, and
if possible what SSH server (if you're using SSH). You can get some
of this information from the PuTTY Event Log (see \k{using-eventlog}
in the manual).
\b Send us the contents of the PuTTY Event Log, unless you
have a specific reason not to (for example, if it contains
confidential information that you think we should be able to solve
your problem without needing to know).
\b Try to give us as much information as you can to help us
see the problem for ourselves. If possible, give us a step-by-step
sequence of \e{precise} instructions for reproducing the fault.
\b Don't just tell us that PuTTY \q{does the wrong thing}; tell us
exactly and precisely what it did, and also tell us exactly and
precisely what you think it should have done instead. Some people
tell us PuTTY does the wrong thing, and it turns out that it was
doing the right thing and their expectations were wrong. Help to
avoid this problem by telling us exactly what you think it should
have done, and exactly what it did do.
\b If you think you can, you're welcome to try to fix the problem
yourself. A \i{patch} to the code which fixes a bug is an excellent
addition to a bug report. However, a patch is never a \e{substitute}
for a good bug report; if your patch is wrong or inappropriate, and
you haven't supplied us with full information about the actual bug,
then we won't be able to find a better solution.
\b
\W{http://www.chiark.greenend.org.uk/~sgtatham/bugs.html}\cw{http://www.chiark.greenend.org.uk/~sgtatham/bugs.html}
is an article on how to report bugs effectively in general. If your
bug report is \e{particularly} unclear, we may ask you to go away,
read this article, and then report the bug again.
It is reasonable to report bugs in PuTTY's documentation, if you
think the documentation is unclear or unhelpful. But we do need to
be given exact details of \e{what} you think the documentation has
failed to tell you, or \e{how} you think it could be made clearer.
If your problem is simply that you don't \e{understand} the
documentation, we suggest posting to a newsgroup (see
\k{feedback-other-fora}) and seeing if someone
will explain what you need to know. \e{Then}, if you think the
documentation could usefully have told you that, send us a bug
report and explain how you think we should change it.
\H{feedback-features} Requesting extra features
If you want to request a new feature in PuTTY, the very first things
you should do are:
\b Check the
\W{http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/}{Wishlist
page} on the PuTTY website, and see if your feature is already on
the list. If it is, it probably won't achieve very much to repeat
the request. (But see \k{feedback-feature-priority} if you want to
persuade us to give your particular feature higher priority.)
\b Check the Wishlist and
\W{http://www.chiark.greenend.org.uk/~sgtatham/putty/changes.html}{Change
Log} on the PuTTY website, and see if we have already added your
feature in the development snapshots. If it isn't clear, download
the latest development snapshot and see if the feature is present.
If it is, then it will also be in the next release and there is no
need to mail us at all.
If you can't find your feature in either the development snapshots
\e{or} the Wishlist, then you probably do need to submit a feature
request. Since the PuTTY authors are very busy, it helps if you try
to do some of the work for us:
\b Do as much of the design as you can. Think about \q{corner
cases}; think about how your feature interacts with other existing
features. Think about the user interface; if you can't come up with
a simple and intuitive interface to your feature, you shouldn't be
surprised if we can't either. Always imagine whether it's possible
for there to be more than one, or less than one, of something you'd
assumed there would be one of. (For example, if you were to want
PuTTY to put an icon in the System tray rather than the Taskbar, you
should think about what happens if there's more than one PuTTY
active; how would the user tell which was which?)
\b If you can program, it may be worth offering to write the feature
yourself and send us a patch. However, it is likely to be helpful
if you confer with us first; there may be design issues you haven't
thought of, or we may be about to make big changes to the code which
your patch would clash with, or something. If you check with the
maintainers first, there is a better chance of your code actually
being usable. Also, read the design principles listed in \k{udp}: if
you do not conform to them, we will probably not be able to accept
your patch.
\H{feedback-feature-priority} Requesting features that have already
been requested
If a feature is already listed on the Wishlist, then it usually
means we would like to add it to PuTTY at some point. However, this
may not be in the near future. If there's a feature on the Wishlist
which you would like to see in the \e{near} future, there are
several things you can do to try to increase its priority level:
\b Mail us and vote for it. (Be sure to mention that you've seen it
on the Wishlist, or we might think you haven't even \e{read} the
Wishlist). This probably won't have very \e{much} effect; if a huge
number of people vote for something then it may make a difference,
but one or two extra votes for a particular feature are unlikely to
change our priority list immediately. Offering a new and compelling
justification might help. Also, don't expect a reply.
\b Offer us money if we do the work sooner rather than later. This
sometimes works, but not always. The PuTTY team all have full-time
jobs and we're doing all of this work in our free time; we may
sometimes be willing to give up some more of our free time in
exchange for some money, but if you try to bribe us for a \e{big}
feature it's entirely possible that we simply won't have the time to
spare - whether you pay us or not. (Also, we don't accept bribes to
add \e{bad} features to the Wishlist, because our desire to provide
high-quality software to the users comes first.)
\b Offer to help us write the code. This is probably the \e{only}
way to get a feature implemented quickly, if it's a big one that we
don't have time to do ourselves.
\H{feedback-support} \ii{Support requests}
If you're trying to make PuTTY do something for you and it isn't
working, but you're not sure whether it's a bug or not, then
\e{please} consider looking for help somewhere else. This is one of
the most common types of mail the PuTTY team receives, and we simply
don't have time to answer all the questions. Questions of this type
include:
\b If you want to do something with PuTTY but have no idea where to
start, and reading the manual hasn't helped, try posting to a
newsgroup (see \k{feedback-other-fora}) and see if someone can explain
it to you.
\b If you have tried to do something with PuTTY but it hasn't
worked, and you aren't sure whether it's a bug in PuTTY or a bug in
your SSH server or simply that you're not doing it right, then try
posting to a newsgroup (see \k{feedback-other-fora}) and see
if someone can solve your problem. Or try doing the same thing with
a different SSH client and see if it works with that. Please do not
report it as a PuTTY bug unless you are really sure it \e{is} a bug
in PuTTY.
\b If someone else installed PuTTY for you, or you're using PuTTY on
someone else's computer, try asking them for help first. They're more
likely to understand how they installed it and what they expected you
to use it for than we are.
\b If you have successfully made a connection to your server and now
need to know what to type at the server's command prompt, or other
details of how to use the server-end software, talk to your server's
system administrator. This is not the PuTTY team's problem. PuTTY is
only a communications tool, like a telephone; if you can't speak the
same language as the person at the other end of the phone, it isn't
the telephone company's job to teach it to you.
If you absolutely cannot get a support question answered any other
way, you can try mailing it to us, but we can't guarantee to have
time to answer it.
\H{feedback-webadmin} Web server administration
If the PuTTY \i{web site} is down (Connection Timed Out), please don't
bother mailing us to tell us about it. Most of us read our e-mail on
the same machines that host the web site, so if those machines are
down then we will notice \e{before} we read our e-mail. So there's
no point telling us our servers are down.
Of course, if the web site has some other error (Connection Refused,
404 Not Found, 403 Forbidden, or something else) then we might
\e{not} have noticed and it might still be worth telling us about it.
If you want to report a problem with our web site, check that you're
looking at our \e{real} web site and not a mirror. The real web site
is at
\W{http://www.chiark.greenend.org.uk/~sgtatham/putty/}\c{http://www.chiark.greenend.org.uk/~sgtatham/putty/};
if that's not where you're reading this, then don't report the
problem to us until you've checked that it's really a problem with
the main site. If it's only a problem with the mirror, you should
try to contact the administrator of that mirror site first, and only
contact us if that doesn't solve the problem (in case we need to
remove the mirror from our list).
\H{feedback-permission} Asking permission for things
PuTTY is distributed under the MIT Licence (see \k{licence} for
details). This means you can do almost \e{anything} you like with
our software, our source code, and our documentation. The only
things you aren't allowed to do are to remove our copyright notices
or the licence text itself, or to hold us legally responsible if
something goes wrong.
So if you want permission to include PuTTY on a magazine cover disk,
or as part of a collection of useful software on a CD or a web site,
then \e{permission is already granted}. You don't have to mail us
and ask. Just go ahead and do it. We don't mind.
(If you want to distribute PuTTY alongside your own application for
use with that application, or if you want to distribute PuTTY within
your own organisation, then we recommend, but do not insist, that
you offer your own first-line technical support, to answer questions
about the interaction of PuTTY with your environment. If your users
mail us directly, we won't be able to tell them anything useful about
your specific setup.)
If you want to use parts of the PuTTY source code in another
program, then it might be worth mailing us to talk about technical
details, but if all you want is to ask permission then you don't
need to bother. You already have permission.
If you just want to link to our web site, just go ahead. (It's not
clear that we \e{could} stop you doing this, even if we wanted to!)
\H{feedback-mirrors} Mirroring the PuTTY web site
\#{This paragraph also in putty-website/mirrors.html}
Mirrors of the PuTTY web site are welcome, especially in regions not
well covered by existing mirrors. (However, if you're in a region that is
already well served by mirrors, you should consider whether yet another one
will be worth the effort.) Please don't bother asking us for permission before
setting up a mirror. You already have permission.
If you mail us \e{after} you have set up the mirror and checked that
it works, and remember to let us know which country your mirror is in,
then we'll add it to the
\W{http://www.chiark.greenend.org.uk/~sgtatham/putty/mirrors.html}{Mirrors
page} on the PuTTY website.
If you have technical questions about the process of mirroring, then
you might want to mail us before setting up the mirror (see also the
\W{http://www.chiark.greenend.org.uk/~sgtatham/putty/mirrors.html#guidelines}{guidelines on the Mirrors page});
but if you just want to ask for permission, you don't need to. You
already have permission.
\H{feedback-compliments} Praise and compliments
One of the most rewarding things about maintaining free software is
getting e-mails that just say \q{thanks}. We are always happy to
receive e-mails of this type.
Regrettably we don't have time to answer them all in person. If you
mail us a compliment and don't receive a reply, \e{please} don't
think we've ignored you. We did receive it and we were happy about
it; we just didn't have time to tell you so personally.
To everyone who's ever sent us praise and compliments, in the past
and the future: \e{you're welcome}!
\H{feedback-address} E-mail address
The actual address to mail is
\cw{<\W{mailto:putty@projects.tartarus.org}{putty@projects.tartarus.org}>}.

155
puttysrc/DOC/GS.BUT Normal file
View File

@@ -0,0 +1,155 @@
\define{versionidgs} \versionid $Id: gs.but 6815 2006-08-28 10:35:12Z simon $
\C{gs} Getting started with PuTTY
This chapter gives a quick guide to the simplest types of
interactive login session using PuTTY.
\H{gs-insecure} \ii{Starting a session}
When you start PuTTY, you will see a \i{dialog box}. This dialog box
allows you to control everything PuTTY can do. See \k{config} for
details of all the things you can control.
You don't usually need to change most of the configuration options.
To start the simplest kind of session, all you need to do is to
enter a few basic parameters.
In the \q{Host Name} box, enter the Internet \i{host name} of the server
you want to connect to. You should have been told this by the
provider of your login account.
Now select a login \i{protocol} to use, from the \q{Connection type}
buttons. For a login session, you should select \i{Telnet},
\i{Rlogin} or \i{SSH}. See \k{which-one} for a description of the
differences between the three protocols, and advice on which one to
use. The fourth protocol, \I{raw protocol}\e{Raw}, is not used for
interactive login sessions; you would usually use this for debugging
other Internet services (see \k{using-rawprot}). The fifth option,
\e{Serial}, is used for connecting to a local serial line, and works
somewhat differently: see \k{using-serial} for more information on
this.
When you change the selected protocol, the number in the \q{Port}
box will change. This is normal: it happens because the various
login services are usually provided on different network ports by
the server machine. Most servers will use the standard port numbers,
so you will not need to change the port setting. If your server
provides login services on a non-standard port, your system
administrator should have told you which one. (For example, many
\i{MUDs} run Telnet service on a port other than 23.)
Once you have filled in the \q{Host Name}, \q{Protocol}, and
possibly \q{Port} settings, you are ready to connect. Press the
\q{Open} button at the bottom of the dialog box, and PuTTY will
begin trying to connect you to the server.
\H{gs-hostkey} \ii{Verifying the host key} (SSH only)
If you are not using the \i{SSH} protocol, you can skip this
section.
If you are using SSH to connect to a server for the first time, you
will probably see a message looking something like this:
\c The server's host key is not cached in the registry. You
\c have no guarantee that the server is the computer you
\c think it is.
\c The server's rsa2 key fingerprint is:
\c ssh-rsa 1024 7b:e5:6f:a7:f4:f9:81:62:5c:e3:1f:bf:8b:57:6c:5a
\c If you trust this host, hit Yes to add the key to
\c PuTTY's cache and carry on connecting.
\c If you want to carry on connecting just once, without
\c adding the key to the cache, hit No.
\c If you do not trust this host, hit Cancel to abandon the
\c connection.
This is a feature of the SSH protocol. It is designed to protect you
against a network attack known as \i\e{spoofing}: secretly
redirecting your connection to a different computer, so that you
send your password to the wrong machine. Using this technique, an
attacker would be able to learn the password that guards your login
account, and could then log in as if they were you and use the
account for their own purposes.
To prevent this attack, each server has a unique identifying code,
called a \e{host key}. These keys are created in a way that prevents
one server from forging another server's key. So if you connect to a
server and it sends you a different host key from the one you were
expecting, PuTTY can warn you that the server may have been switched
and that a spoofing attack might be in progress.
PuTTY records the host key for each server you connect to, in the
Windows \i{Registry}. Every time you connect to a server, it checks
that the host key presented by the server is the same host key as it
was the last time you connected. If it is not, you will see a
warning, and you will have the chance to abandon your connection
before you type any private information (such as a password) into
it.
However, when you connect to a server you have not connected to
before, PuTTY has no way of telling whether the host key is the
right one or not. So it gives the warning shown above, and asks you
whether you want to \I{trusting host keys}trust this host key or
not.
Whether or not to trust the host key is your choice. If you are
connecting within a company network, you might feel that all the
network users are on the same side and spoofing attacks are
unlikely, so you might choose to trust the key without checking it.
If you are connecting across a hostile network (such as the
Internet), you should check with your system administrator, perhaps
by telephone or in person. (Some modern servers have more than one
host key. If the system administrator sends you more than one
\I{host key fingerprint}fingerprint, you should make sure the one
PuTTY shows you is on the list, but it doesn't matter which one it is.)
\# FIXME: this is all very fine but of course in practice the world
doesn't work that way. Ask the team if they have any good ideas for
changes to this section!
\H{gs-login} \ii{Logging in}
After you have connected, and perhaps verified the server's host
key, you will be asked to log in, probably using a \i{username} and
a \i{password}. Your system administrator should have provided you
with these. Enter the username and the password, and the server
should grant you access and begin your session. If you have
\I{mistyping a password}mistyped your password, most servers will
give you several chances to get it right.
If you are using SSH, be careful not to type your username wrongly,
because you will not have a chance to correct it after you press
Return; many SSH servers do not permit you to make two login attempts
using \i{different usernames}. If you type your username wrongly, you
must close PuTTY and start again.
If your password is refused but you are sure you have typed it
correctly, check that Caps Lock is not enabled. Many login servers,
particularly Unix computers, treat upper case and lower case as
different when checking your password; so if Caps Lock is on, your
password will probably be refused.
\H{gs-session} After logging in
After you log in to the server, what happens next is up to the
server! Most servers will print some sort of login message and then
present a \i{prompt}, at which you can type
\I{commands on the server}commands which the
server will carry out. Some servers will offer you on-line help;
others might not. If you are in doubt about what to do next, consult
your system administrator.
\H{gs-logout} \ii{Logging out}
When you have finished your session, you should log out by typing
the server's own logout command. This might vary between servers; if
in doubt, try \c{logout} or \c{exit}, or consult a manual or your
system administrator. When the server processes your logout command,
the PuTTY window should close itself automatically.
You \e{can} close a PuTTY session using the \i{Close button} in the
window border, but this might confuse the server - a bit like
hanging up a telephone unexpectedly in the middle of a conversation.
We recommend you do not do this unless the server has stopped
responding to you and you cannot close the window any other way.

839
puttysrc/DOC/INDEX.BUT Normal file
View File

@@ -0,0 +1,839 @@
\define{versionidindex} \versionid $Id: index.but 6836 2006-08-29 21:46:56Z jacob $
\IM{Unix version} Unix version of PuTTY tools
\IM{Unix version} Linux version of PuTTY tools
\IM{Unix} Unix
\IM{Unix} Linux
\IM{Command Prompt}{command prompt window}{MS-DOS Prompt}{console window} Command Prompt
\IM{Command Prompt}{command prompt window}{MS-DOS Prompt}{console window} MS-DOS Prompt
\IM{Command Prompt}{command prompt window}{MS-DOS Prompt}{console window} console window
\IM{spoof}{spoofed}{spoofing} spoofing
\IM{verifying the host key} verifying the host key
\IM{verifying the host key} host key, verifying
\IM{trusting host keys} trusting host keys
\IM{trusting host keys} host keys, trusting
\IM{host key fingerprint} fingerprint, of SSH host key
\IM{host key fingerprint} host key fingerprint (SSH)
\IM{host key fingerprint} SSH host key fingerprint
\IM{starting a session} starting a session
\IM{starting a session} session, starting
\IM{commands on the server}{remote command} commands on the server
\IM{commands on the server}{remote command} remote commands
\IM{commands on the server}{remote command} server, commands on
\IM{mistyping a password} mistyping a password
\IM{mistyping a password} password, mistyping
\IM{different usernames}{changes of username} different user names
\IM{different usernames}{changes of username} changing user names
\IM{different usernames}{changes of username} user names, different
\IM{different usernames}{changes of username} login names, different
\IM{different usernames}{changes of username} account names, different
\IM{differences between SSH, Telnet and Rlogin} differences between
SSH, Telnet and Rlogin
\IM{differences between SSH, Telnet and Rlogin} protocols,
differences between
\IM{differences between SSH, Telnet and Rlogin} SSH, differences
from Telnet and Rlogin
\IM{differences between SSH, Telnet and Rlogin} Telnet, differences
from SSH and Rlogin
\IM{differences between SSH, Telnet and Rlogin} Rlogin, differences
from SSH and Telnet
\IM{differences between SSH, Telnet and Rlogin} selecting a protocol
\IM{differences between SSH, Telnet and Rlogin} choosing a protocol
\IM{MUD}{MUDs} MUDs
\IM{talker}{talker systems} talker systems
\IM{security hazard}{security risk} security hazard
\IM{SSH-1}{SSH protocol version 1} SSH-1
\IM{SSH-2}{SSH protocol version 2} SSH-2
\IM{terminal window}{PuTTY window} terminal window
\IM{terminal window}{PuTTY window} PuTTY terminal window
\IM{terminal window}{PuTTY window} window, terminal
\IM{copy and paste} copy and paste
\IM{copy and paste} cut and paste
\IM{copy and paste} paste, copy and
\IM{three-button mouse} three-button mouse
\IM{three-button mouse} mouse, three-button
\IM{left mouse button}{left button} left mouse button
\IM{middle mouse button}{middle button} middle mouse button
\IM{right mouse button}{right button} right mouse button
\IM{selecting words}{word-by-word selection} selecting whole words
\IM{selecting words}{word-by-word selection} words, selecting
\IM{selecting lines} selecting whole lines
\IM{selecting lines} lines, selecting
\IM{rectangular selection} rectangular selection
\IM{rectangular selection} selection, rectangular
\IM{adjusting a selection} adjusting a selection
\IM{adjusting a selection} extending a selection
\IM{adjusting a selection} selection, adjusting
\IM{right mouse button, with Ctrl} right mouse button, with Ctrl
\IM{right mouse button, with Ctrl} Ctrl, with right mouse button
\IM{system menu} system menu
\IM{system menu} menu, system
\IM{system menu} window menu
\IM{context menu} context menu
\IM{context menu} menu, context
\IM{context menu} right mouse button menu
\IM{Event Log} Event Log
\IM{Event Log} PuTTY Event Log
\IM{Event Log} Log, Event
\IM{Telnet special commands} Telnet special commands
\IM{Telnet special commands} special commands, in Telnet
\IM{SSH special commands} SSH special commands
\IM{SSH special commands} special commands, in SSH
\IM{Repeat key exchange, SSH special command} Repeat key exchange, SSH special command
\IM{Repeat key exchange, SSH special command} key exchange, forcing repeat
\IM{Repeat key exchange, SSH special command} SSH key exchange, forcing repeat
\IM{accented characters} accented characters
\IM{accented characters} characters, accented
\IM{line-drawing characters} line-drawing characters
\IM{line-drawing characters} box-drawing characters
\IM{line-drawing characters} characters, line-drawing
\IM{line-drawing characters} ANSI graphics
\IM{port forwarding}{port forwardings} port forwarding in SSH
\IM{port forwarding}{port forwardings} SSH port forwarding
\IM{port forwarding}{port forwardings} forwarding ports in SSH
\IM{port forwarding}{port forwardings} tunnelling using SSH
\IM{port forwarding}{port forwardings} SSH tunnelling
\IM{port forwarding, changing mid-session} port forwarding in SSH, changing mid-session
\IM{port forwarding, changing mid-session} SSH port forwarding, changing mid-session
\IM{port forwarding, changing mid-session} forwarding ports in SSH, changing mid-session
\IM{port forwarding, changing mid-session} tunnelling using SSH, changing mid-session
\IM{port forwarding, changing mid-session} SSH tunnelling, changing mid-session
\IM{local port forwarding} local-to-remote port forwarding
\IM{remote port forwarding} remote-to-local port forwarding
\IM{dynamic port forwarding} dynamic port forwarding
\IM{dynamic port forwarding} SOCKS port forwarding
\IM{debugging Internet protocols} debugging Internet protocols
\IM{debugging Internet protocols} Internet protocols, debugging
\IM{debugging Internet protocols} protocols, debugging
\IM{Internet protocol version} Internet Protocol version
\IM{Internet protocol version} version, of Internet Protocol
\IM{raw TCP connections} raw TCP connections
\IM{raw TCP connections} TCP connections, raw
\IM{command-line arguments} command-line arguments
\IM{command-line arguments} arguments, command-line
\IM{command-line arguments} options, command-line
\IM{command-line arguments} switches, command-line
\IM{Windows shortcut} Windows shortcut
\IM{Windows shortcut} shortcut, Windows
\IM{telnet URLs} Telnet URLs
\IM{telnet URLs} URLs, Telnet
\IM{saved sessions, loading from command line} saved sessions,
loading from command line
\IM{saved sessions, loading from command line} loading saved
sessions from command line
\IM{saved sessions, loading from command line} command line, loading
saved sessions from
\IM{putty @sessionname} \c{putty @sessionname}
\IM{putty @sessionname} \c{@sessionname} command-line argument
\IM{protocol selection} protocol selection
\IM{protocol selection} selecting a protocol
\IM{protocol selection} choosing a protocol
\IM{login name}{username} login name
\IM{login name}{username} user name
\IM{login name}{username} account name
\IM{reading commands from a file} reading commands from a file
\IM{reading commands from a file} commands, reading from a file
\IM{agent forwarding} agent forwarding
\IM{agent forwarding} authentication agent forwarding
\IM{agent forwarding} SSH agent forwarding
\IM{agent forwarding} forwarding, SSH agent
\IM{X11 forwarding}{forwarding of X11} X11 forwarding
\IM{X11 forwarding}{forwarding of X11} SSH X11 forwarding
\IM{X11 forwarding}{forwarding of X11} forwarding, of X11
\IM{X11 authentication} X11 authentication
\IM{X11 authentication} authentication, X11
\IM{pseudo-terminal allocation} pseudo-terminal allocation
\IM{pseudo-terminal allocation} pty allocation
\IM{pseudo-terminal allocation} allocation, of pseudo-terminal
\IM{ERASE special character} \cw{ERASE}, special character
\IM{ERASE special character} \cw{VERASE}, special character
\IM{QUIT special character} \cw{QUIT}, special character
\IM{QUIT special character} \cw{VQUIT}, special character
\IM{-telnet} \c{-telnet} command-line option
\IM{-raw} \c{-raw} command-line option
\IM{-rlogin} \c{-rlogin} command-line option
\IM{-ssh} \c{-ssh} command-line option
\IM{-cleanup} \c{-cleanup} command-line option
\IM{-load} \c{-load} command-line option
\IM{-v} \c{-v} command-line option
\IM{-l} \c{-l} command-line option
\IM{-L-upper} \c{-L} command-line option
\IM{-R-upper} \c{-R} command-line option
\IM{-D-upper} \c{-D} command-line option
\IM{-m} \c{-m} command-line option
\IM{-P-upper} \c{-P} command-line option
\IM{-pw} \c{-pw} command-line option
\IM{-A-upper} \c{-A} command-line option
\IM{-a} \c{-a} command-line option
\IM{-X-upper} \c{-X} command-line option
\IM{-x} \c{-x} command-line option
\IM{-T-upper} \c{-T} command-line option
\IM{-t} \c{-t} command-line option
\IM{-C-upper} \c{-C} command-line option
\IM{-N-upper} \c{-N} command-line option
\IM{-1} \c{-1} command-line option
\IM{-2} \c{-2} command-line option
\IM{-i} \c{-i} command-line option
\IM{-pgpfp} \c{-pgpfp} command-line option
\IM{removing registry entries} removing registry entries
\IM{removing registry entries} registry entries, removing
\IM{random seed file} random seed file
\IM{random seed file} \c{putty.rnd} (random seed file)
\IM{putty.rnd} \c{putty.rnd} (random seed file)
\IM{suppressing remote shell} remote shell, suppressing
\IM{suppressing remote shell} shell, remote, suppressing
\IM{SSH protocol version} SSH protocol version
\IM{SSH protocol version} protocol version, SSH
\IM{SSH protocol version} version, of SSH protocol
\IM{PPK} \cw{PPK} file
\IM{PPK} private key file, PuTTY
\IM{PGP key fingerprint} PGP key fingerprint
\IM{PGP key fingerprint} fingerprint, of PGP key
\IM{verifying new versions} verifying new versions of PuTTY
\IM{verifying new versions} new version, verifying
\IM{verifying new versions} upgraded version, verifying
\IM{connection}{network connection} network connection
\IM{connection}{network connection} connection, network
\IM{host name}{hostname} host name
\IM{host name}{hostname} DNS name
\IM{host name}{hostname} server name
\IM{IP address}{Internet address} IP address
\IM{IP address}{Internet address} address, IP
\IM{localhost} \c{localhost}
\IM{loopback IP address}{loopback address} loopback IP address
\IM{loopback IP address}{loopback address} IP address, loopback
\IM{listen address} listen address
\IM{listen address} bind address
\IM{DNS} DNS
\IM{DNS} Domain Name System
\IM{name resolution} name resolution
\IM{name resolution} DNS resolution
\IM{name resolution} host name resolution
\IM{name resolution} server name resolution
\IM{loading and storing saved sessions} sessions, loading and storing
\IM{loading and storing saved sessions} settings, loading and storing
\IM{loading and storing saved sessions} saving settings
\IM{loading and storing saved sessions} storing settings
\IM{loading and storing saved sessions} loading settings
\IM{Default Settings} Default Settings
\IM{Default Settings} settings, default
\IM{Registry} Registry (Windows)
\IM{Registry} Windows Registry
\IM{inactive window} inactive window
\IM{inactive window} window, inactive
\IM{inactive window} terminal window, inactive
\IM{SSH packet log} SSH packet log
\IM{SSH packet log} packet log, SSH
\IM{auto wrap mode}{auto wrap} auto wrap mode
\IM{auto wrap mode}{auto wrap} wrapping, automatic
\IM{auto wrap mode}{auto wrap} line wrapping, automatic
\IM{control sequence}{control codes} control sequences
\IM{control sequence}{control codes} terminal control sequences
\IM{control sequence}{control codes} escape sequences
\IM{cursor coordinates} cursor coordinates
\IM{cursor coordinates} coordinates, cursor
\IM{CR} CR (Carriage Return)
\IM{CR} Carriage Return
\IM{LF} LF (Line Feed)
\IM{LF} Line Feed
\IM{clear screen} clear screen
\IM{clear screen} erase screen
\IM{clear screen} screen, clearing
\IM{blinking text} blinking text
\IM{blinking text} flashing text
\IM{answerback} answerback string
\IM{local echo} local echo
\IM{local echo} echo, local
\IM{remote echo} remote echo
\IM{remote echo} echo, remote
\IM{local line editing} local line editing
\IM{local line editing} line editing, local
\IM{remote-controlled printing} ANSI printing
\IM{remote-controlled printing} remote-controlled printing
\IM{remote-controlled printing} printing, remote-controlled
\IM{Home and End keys} Home key
\IM{Home and End keys} End key
\IM{keypad} keypad, numeric
\IM{keypad} numeric keypad
\IM{Application Cursor Keys} Application Cursor Keys
\IM{Application Cursor Keys} cursor keys, \q{Application} mode
\IM{Application Keypad} Application Keypad
\IM{Application Keypad} keypad, \q{Application} mode
\IM{Application Keypad} numeric keypad, \q{Application} mode
\IM{Num Lock}{NumLock} Num Lock
\IM{NetHack keypad mode} NetHack keypad mode
\IM{NetHack keypad mode} keypad, NetHack mode
\IM{compose key} Compose key
\IM{compose key} DEC Compose key
\IM{terminal bell} terminal bell
\IM{terminal bell} bell, terminal
\IM{terminal bell} beep, terminal
\IM{terminal bell} feep
\IM{Windows Default Beep} Windows Default Beep sound
\IM{Windows Default Beep} Default Beep sound, Windows
\IM{terminal bell, disabling} terminal bell, disabling
\IM{terminal bell, disabling} bell, disabling
\IM{visual bell} visual bell
\IM{visual bell} bell, visual
\IM{PC speaker} PC speaker
\IM{PC speaker} beep, with PC speaker
\IM{sound file} sound file
\IM{sound file} \cw{WAV} file
\IM{bell overload} bell overload mode
\IM{bell overload} terminal bell overload mode
\IM{mouse reporting} mouse reporting
\IM{mouse reporting} \c{xterm} mouse reporting
\IM{links} \c{links} (web browser)
\IM{mc} \c{mc}
\IM{mc} Midnight Commander
\IM{terminal resizing}{window resizing} terminal resizing
\IM{terminal resizing}{window resizing} window resizing
\IM{terminal resizing}{window resizing} resizing, terminal
\IM{destructive backspace} destructive backspace
\IM{destructive backspace} non-destructive backspace
\IM{destructive backspace} backspace, destructive
\IM{Arabic text shaping} Arabic text shaping
\IM{Arabic text shaping} shaping, of Arabic text
\IM{Unicode} Unicode
\IM{Unicode} ISO-10646 (Unicode)
\IM{ASCII} ASCII
\IM{ASCII} US-ASCII
\IM{bidirectional text} bidirectional text
\IM{bidirectional text} right-to-left text
\IM{display becomes corrupted} display corruption
\IM{display becomes corrupted} corruption, of display
\IM{rows} rows, in terminal window
\IM{columns} columns, in terminal window
\IM{window size} window size
\IM{window size} size, of window
\IM{font size} font size
\IM{font size} size, of font
\IM{full screen}{full-screen} full-screen mode
\IM{cursor blinks} blinking cursor
\IM{cursor blinks} flashing cursor
\IM{cursor blinks} cursor, blinking
\IM{font} font
\IM{font} typeface
\IM{minimise} minimise window
\IM{minimise} window, minimising
\IM{maximise} maximise window
\IM{maximise} window, maximising
\IM{closing window}{close window} closing window
\IM{closing window}{close window} window, closing
\IM{Dragon NaturallySpeaking} Dragon NaturallySpeaking
\IM{Dragon NaturallySpeaking} NaturallySpeaking
\IM{AltGr} \q{AltGr} key
\IM{Alt} \q{Alt} key
\IM{CJK} CJK
\IM{CJK} Chinese
\IM{CJK} Japanese
\IM{CJK} Korean
\IM{East Asian Ambiguous characters} East Asian Ambiguous characters
\IM{East Asian Ambiguous characters} CJK ambiguous characters
\IM{character width} character width
\IM{character width} single-width character
\IM{character width} double-width character
\IM{Rich Text Format} Rich Text Format
\IM{Rich Text Format} RTF
\IM{bold}{bold text} bold text
\IM{colour}{colours} colour
\IM{8-bit colour} 8-bit colour
\IM{8-bit colour} colour, 8-bit
\IM{system colours} system colours
\IM{system colours} colours, system
\IM{ANSI colours} ANSI colours
\IM{ANSI colours} colours, ANSI
\IM{cursor colour} cursor colour
\IM{cursor colour} colour, of cursor
\IM{default background} background colour, default
\IM{default background} colour, background, default
\IM{default foreground} foreground colour, default
\IM{default foreground} colour, foreground, default
\IM{TERM} \cw{TERM} environment variable
\IM{logical palettes} logical palettes
\IM{logical palettes} palettes, logical
\IM{breaks in connectivity} connectivity, breaks in
\IM{breaks in connectivity} intermittent connectivity
\IM{idle connections} idle connections
\IM{idle connections} timeout, of connections
\IM{idle connections} connections, idle
\IM{interactive connections}{interactive session} interactive connections
\IM{interactive connections}{interactive session} connections, interactive
\IM{keepalives} keepalives, application
\IM{Nagle's algorithm} Nagle's algorithm
\IM{Nagle's algorithm} \cw{TCP_NODELAY}
\IM{TCP keepalives} TCP keepalives
\IM{TCP keepalives} keepalives, TCP
\IM{TCP keepalives} \cw{SO_KEEPALIVE}
\IM{half-open connections} half-open connections
\IM{half-open connections} connections, half-open
\IM{auto-login username} user name, for auto-login
\IM{auto-login username} login name, for auto-login
\IM{auto-login username} account name, for auto-login
\IM{terminal emulation}{terminal-type} terminal emulation
\IM{terminal emulation}{terminal-type} emulation, terminal
\IM{terminal speed} terminal speed
\IM{terminal speed} speed, terminal
\IM{terminal speed} baud rate, of terminal
\IM{environment variables} environment variables
\IM{environment variables} variables, environment
\IM{proxy} proxy server
\IM{proxy} server, proxy
\IM{HTTP proxy} HTTP proxy
\IM{HTTP proxy} proxy, HTTP
\IM{HTTP proxy} server, HTTP
\IM{HTTP proxy} \cw{CONNECT} proxy (HTTP)
\IM{SOCKS server} SOCKS proxy
\IM{SOCKS server} server, SOCKS
\IM{SOCKS server} proxy, SOCKS
\IM{Telnet proxy} Telnet proxy
\IM{Telnet proxy} TCP proxy
\IM{Telnet proxy} ad-hoc proxy
\IM{Telnet proxy} proxy, Telnet
\IM{Local proxy} local proxy
\IM{Local proxy} proxy command
\IM{Local proxy} command, proxy
\IM{proxy DNS} proxy DNS
\IM{proxy DNS} DNS, with proxy
\IM{proxy DNS} name resolution, with proxy
\IM{proxy DNS} host name resolution, with proxy
\IM{proxy DNS} server name resolution, with proxy
\IM{proxy username} proxy user name
\IM{proxy username} user name, for proxy
\IM{proxy username} login name, for proxy
\IM{proxy username} account name, for proxy
\IM{proxy password} proxy password
\IM{proxy password} password, for proxy
\IM{proxy authentication} proxy authentication
\IM{proxy authentication} authentication, to proxy
\IM{HTTP basic} HTTP \q{basic} authentication
\IM{HTTP basic} \q{basic} authentication (HTTP)
\IM{plaintext password} plain text password
\IM{plaintext password} password, plain text
\IM{Telnet negotiation} Telnet option negotiation
\IM{Telnet negotiation} option negotiation, Telnet
\IM{Telnet negotiation} negotiation, of Telnet options
\IM{firewall}{firewalls} firewalls
\IM{NAT router}{NAT} NAT routers
\IM{NAT router}{NAT} routers, NAT
\IM{NAT router}{NAT} Network Address Translation
\IM{NAT router}{NAT} IP masquerading
\IM{Telnet New Line} Telnet New Line
\IM{Telnet New Line} new line, in Telnet
\IM{.rhosts} \c{.rhosts} file
\IM{.rhosts} \q{rhosts} file
\IM{passwordless login} passwordless login
\IM{passwordless login} login, passwordless
\IM{Windows user name} local user name, in Windows
\IM{Windows user name} user name, local, in Windows
\IM{Windows user name} login name, local, in Windows
\IM{Windows user name} account name, local, in Windows
\IM{local username in Rlogin} local user name, in Rlogin
\IM{local username in Rlogin} user name, local, in Rlogin
\IM{local username in Rlogin} login name, local, in Rlogin
\IM{local username in Rlogin} account name, local, in Rlogin
\IM{privileged port} privileged port
\IM{privileged port} low-numbered port
\IM{privileged port} port, privileged
\IM{remote shell} shell, remote
\IM{remote shell} remote shell
\IM{encryption}{encrypted}{encrypt} encryption
\IM{encryption algorithm} encryption algorithm
\IM{encryption algorithm} cipher algorithm
\IM{encryption algorithm} symmetric-key algorithm
\IM{encryption algorithm} algorithm, encryption
\IM{AES} AES
\IM{AES} Advanced Encryption Standard
\IM{AES} Rijndael
\IM{Arcfour} Arcfour
\IM{Arcfour} RC4
\IM{triple-DES} triple-DES
\IM{single-DES} single-DES
\IM{single-DES} DES
\IM{key exchange} key exchange
\IM{key exchange} kex
\IM{shared secret} shared secret
\IM{shared secret} secret, shared
\IM{key exchange algorithm} key exchange algorithm
\IM{key exchange algorithm} algorithm, key exchange
\IM{Diffie-Hellman key exchange} Diffie-Hellman key exchange
\IM{Diffie-Hellman key exchange} key exchange, Diffie-Hellman
\IM{group exchange} Diffie-Hellman group exchange
\IM{group exchange} group exchange, Diffie-Hellman
\IM{repeat key exchange} repeat key exchange
\IM{repeat key exchange} key exchange, repeat
\IM{challenge/response authentication} challenge/response authentication
\IM{challenge/response authentication} authentication, challenge/response
\IM{security token} security token
\IM{security token} token, security
\IM{one-time passwords} one-time passwords
\IM{one-time passwords} password, one-time
\IM{keyboard-interactive authentication} keyboard-interactive authentication
\IM{keyboard-interactive authentication} authentication, keyboard-interactive
\IM{password expiry} password expiry
\IM{password expiry} expiry, of passwords
\IM{public key authentication}{public-key authentication} public key authentication
\IM{public key authentication}{public-key authentication} RSA authentication
\IM{public key authentication}{public-key authentication} DSA authentication
\IM{public key authentication}{public-key authentication} authentication, public key
\IM{MIT-MAGIC-COOKIE-1} \cw{MIT-MAGIC-COOKIE-1}
\IM{MIT-MAGIC-COOKIE-1} magic cookie
\IM{MIT-MAGIC-COOKIE-1} cookie, magic
\IM{SSH server bugs} SSH server bugs
\IM{SSH server bugs} bugs, in SSH servers
\IM{ignore message} SSH \q{ignore} messages
\IM{ignore message} \q{ignore} messages, in SSH
\IM{message authentication code} message authentication code
\IM{message authentication code} MAC (message authentication code)
\IM{signatures} signature
\IM{signatures} digital signature
\IM{storing configuration in a file} storing settings in a file
\IM{storing configuration in a file} saving settings in a file
\IM{storing configuration in a file} loading settings from a file
\IM{transferring files} transferring files
\IM{transferring files} files, transferring
\IM{receiving files}{download a file} receiving files
\IM{receiving files}{download a file} files, receiving
\IM{receiving files}{download a file} downloading files
\IM{sending files}{upload a file} sending files
\IM{sending files}{upload a file} files, sending
\IM{sending files}{upload a file} uploading files
\IM{listing files} listing files
\IM{listing files} files, listing
\IM{wildcard}{wildcards} wildcards
\IM{wildcard}{wildcards} glob (wildcard)
\IM{PATH} \c{PATH} environment variable
\IM{SFTP} SFTP
\IM{SFTP} SSH file transfer protocol
\IM{-unsafe} \c{-unsafe} PSCP command-line option
\IM{-ls-PSCP} \c{-ls} PSCP command-line option
\IM{-p-PSCP} \c{-p} PSCP command-line option
\IM{-q-PSCP} \c{-q} PSCP command-line option
\IM{-r-PSCP} \c{-r} PSCP command-line option
\IM{-batch-PSCP} \c{-batch} PSCP command-line option
\IM{-sftp} \c{-sftp} PSCP command-line option
\IM{-scp} \c{-scp} PSCP command-line option
\IM{return value} return value
\IM{return value} exit value
\IM{-b-PSFTP} \c{-b} PSFTP command-line option
\IM{-bc-PSFTP} \c{-bc} PSFTP command-line option
\IM{-be-PSFTP} \c{-be} PSFTP command-line option
\IM{-batch-PSFTP} \c{-batch} PSFTP command-line option
\IM{spaces in filenames} spaces in filenames
\IM{spaces in filenames} filenames containing spaces
\IM{working directory} working directory
\IM{working directory} current working directory
\IM{resuming file transfers} resuming file transfers
\IM{resuming file transfers} files, resuming transfer of
\IM{changing permissions on files} changing permissions on files
\IM{changing permissions on files} permissions on files, changing
\IM{changing permissions on files} files, changing permissions on
\IM{changing permissions on files} modes of files, changing
\IM{changing permissions on files} access to files, changing
\IM{deleting files} deleting files
\IM{deleting files} files, deleting
\IM{deleting files} removing files
\IM{create a directory} creating directories
\IM{create a directory} directories, creating
\IM{remove a directory} removing directories
\IM{remove a directory} directories, removing
\IM{remove a directory} deleting directories
\IM{rename remote files} renaming files
\IM{rename remote files} files, renaming and moving
\IM{rename remote files} moving files
\IM{local Windows command} local Windows command
\IM{local Windows command} Windows command
\IM{PLINK_PROTOCOL} \c{PLINK_PROTOCOL} environment variable
\IM{-batch-plink} \c{-batch} Plink command-line option
\IM{-s-plink} \c{-s} Plink command-line option
\IM{subsystem} subsystem, SSH
\IM{subsystem} SSH subsystem
\IM{batch file}{batch files} batch files
\IM{CVS_RSH} \c{CVS_RSH} environment variable
\IM{DSA} DSA
\IM{DSA} Digital Signature Standard
\IM{public-key algorithm} public-key algorithm
\IM{public-key algorithm} asymmetric key algorithm
\IM{public-key algorithm} algorithm, public-key
\IM{generating keys} generating key pairs
\IM{generating keys} creating key pairs
\IM{generating keys} key pairs, generating
\IM{generating keys} public keys, generating
\IM{generating keys} private keys, generating
\IM{authorized_keys file}{authorized_keys} \cw{authorized_keys} file
\IM{key fingerprint} fingerprint, of SSH authentication key
\IM{key fingerprint} public key fingerprint (SSH)
\IM{key fingerprint} SSH public key fingerprint
\IM{SSH-2 public key format} SSH-2 public key file format
\IM{SSH-2 public key format} public key file, SSH-2
\IM{OpenSSH private key format} OpenSSH private key file format
\IM{OpenSSH private key format} private key file, OpenSSH
\IM{ssh.com private key format} \cw{ssh.com} private key file format
\IM{ssh.com private key format} private key file, \cw{ssh.com}
\IM{importing keys} importing private keys
\IM{importing keys} loading private keys
\IM{export private keys} exporting private keys
\IM{export private keys} saving private keys
\IM{.ssh} \c{.ssh} directory
\IM{.ssh2} \c{.ssh2} directory
\IM{authentication agent} authentication agent
\IM{authentication agent} agent, authentication
\IM{-c-pageant} \c{-c} Pageant command-line option
\IM{FAQ} FAQ
\IM{FAQ} Frequently Asked Questions
\IM{supported features} supported features
\IM{supported features} features, supported
\IM{remember my password} storing passwords
\IM{remember my password} password, storing
\IM{login scripts}{startup scripts} login scripts
\IM{login scripts}{startup scripts} startup scripts
\IM{WS2_32.DLL} \cw{WS2_32.DLL}
\IM{WS2_32.DLL} WinSock version 2
\IM{Red Hat Linux} Red Hat Linux
\IM{Red Hat Linux} Linux, Red Hat
\IM{SMB} SMB
\IM{SMB} Windows file sharing
\IM{clean up} clean up after PuTTY
\IM{clean up} uninstalling
\IM{version of PuTTY} version, of PuTTY
\IM{PGP signatures} PGP signatures, of PuTTY binaries
\IM{PGP signatures} signatures, of PuTTY binaries

88
puttysrc/DOC/INTRO.BUT Normal file
View File

@@ -0,0 +1,88 @@
\define{versionidintro} \versionid $Id: intro.but 5593 2005-04-05 18:01:32Z jacob $
\C{intro} Introduction to PuTTY
PuTTY is a free SSH, Telnet and Rlogin client for 32-bit Windows
systems.
\H{you-what} What are SSH, Telnet and Rlogin?
If you already know what SSH, Telnet and Rlogin are, you can safely
skip on to the next section.
SSH, Telnet and Rlogin are three ways of doing the same thing:
logging in to a multi-user computer from another computer, over a
network.
Multi-user operating systems, such as Unix and VMS, usually present
a \i{command-line interface} to the user, much like the \q{\i{Command
Prompt}} or \q{\i{MS-DOS Prompt}} in Windows. The system prints a
prompt, and you type commands which the system will obey.
Using this type of interface, there is no need for you to be sitting
at the same machine you are typing commands to. The commands, and
responses, can be sent over a network, so you can sit at one
computer and give commands to another one, or even to more than one.
SSH, Telnet and Rlogin are \i\e{network protocols} that allow you to
do this. On the computer you sit at, you run a \i\e{client}, which
makes a network connection to the other computer (the \i\e{server}).
The network connection carries your keystrokes and commands from the
client to the server, and carries the server's responses back to
you.
These protocols can also be used for other types of keyboard-based
interactive session. In particular, there are a lot of bulletin
boards, \i{talker systems} and \i{MUDs} (Multi-User Dungeons) which support
access using Telnet. There are even a few that support SSH.
You might want to use SSH, Telnet or Rlogin if:
\b you have an account on a Unix or VMS system which you want to be
able to access from somewhere else
\b your Internet Service Provider provides you with a login account
on a \i{web server}. (This might also be known as a \i\e{shell account}.
A \e{shell} is the program that runs on the server and interprets
your commands for you.)
\b you want to use a \i{bulletin board system}, talker or MUD which can
be accessed using Telnet.
You probably do \e{not} want to use SSH, Telnet or Rlogin if:
\b you only use Windows. Windows computers have their own
ways of networking between themselves, and unless you are doing
something fairly unusual, you will not need to use any of these
remote login protocols.
\H{which-one} How do SSH, Telnet and Rlogin differ?
This list summarises some of the \i{differences between SSH, Telnet
and Rlogin}.
\b SSH (which stands for \q{\i{secure shell}}) is a recently designed,
high-security protocol. It uses strong cryptography to protect your
connection against eavesdropping, hijacking and other attacks. Telnet
and Rlogin are both older protocols offering minimal security.
\b SSH and Rlogin both allow you to \I{passwordless login}log in to the
server without having to type a password. (Rlogin's method of doing this is
insecure, and can allow an attacker to access your account on the
server. SSH's method is much more secure, and typically breaking the
security requires the attacker to have gained access to your actual
client machine.)
\b SSH allows you to connect to the server and automatically send a
command, so that the server will run that command and then
disconnect. So you can use it in automated processing.
The Internet is a hostile environment and security is everybody's
responsibility. If you are connecting across the open Internet, then
we recommend you use SSH. If the server you want to connect to
doesn't support SSH, it might be worth trying to persuade the
administrator to install it.
If your client and server are both behind the same (good) firewall,
it is more likely to be safe to use Telnet or Rlogin, but we still
recommend you use SSH.

29
puttysrc/DOC/LICENCE.BUT Normal file
View File

@@ -0,0 +1,29 @@
\define{versionidlicence} \versionid $Id: licence.but 7048 2007-01-01 21:19:14Z jacob $
\A{licence} PuTTY \ii{Licence}
PuTTY is \i{copyright} 1997-2007 Simon Tatham.
Portions copyright Robert de Bath, Joris van Rantwijk, Delian
Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,
Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn,
and CORE SDI S.A.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the \q{Software}), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED \q{AS IS}, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

75
puttysrc/DOC/MAKEFILE Normal file
View File

@@ -0,0 +1,75 @@
all: man index.html
# Decide on the versionid policy.
#
# If the user has passed in $(VERSION) on the command line (`make
# VERSION="Release 0.56"'), we use that as an explicit version
# string. Otherwise, we use `svnversion' to examine the checked-out
# documentation source, and if that returns a single revision
# number then we invent a version string reflecting just that
# number. Failing _that_, we resort to versionids.but which shows a
# $Id for each individual file.
#
# So here, we define VERSION using svnversion if it isn't already
# defined ...
ifndef VERSION
SVNVERSION=$(shell test -d .svn && svnversion .)
BADCHARS=$(findstring :,$(SVNVERSION))$(findstring S,$(SVNVERSION))
ifeq ($(BADCHARS),)
ifneq ($(SVNVERSION),)
ifneq ($(SVNVERSION),exported)
VERSION=Built from revision $(patsubst M,,$(SVNVERSION))
endif
endif
endif
endif
# ... and now, we condition our build behaviour on whether or not
# VERSION _is_ defined.
ifdef VERSION
VERSIONIDS=vstr
vstr.but: FORCE
echo \\versionid $(VERSION) > vstr.but
FORCE:;
else
VERSIONIDS=vids
endif
CHAPTERS := $(SITE) blurb intro gs using config pscp psftp plink pubkey
CHAPTERS += pageant errors faq feedback licence udp pgpkeys
CHAPTERS += index $(VERSIONIDS)
INPUTS = $(patsubst %,%.but,$(CHAPTERS))
# This is temporary. Hack it locally or something.
HALIBUT = halibut
index.html: $(INPUTS)
$(HALIBUT) --text --html --winhelp $(INPUTS)
# During formal builds it's useful to be able to build this one alone.
putty.hlp: $(INPUTS)
$(HALIBUT) --winhelp $(INPUTS)
putty.info: $(INPUTS)
$(HALIBUT) --info $(INPUTS)
chm: putty.hhp
putty.hhp: $(INPUTS) chm.but
$(HALIBUT) --html $(INPUTS) chm.but
MKMAN = $(HALIBUT) --man=$@ mancfg.but $<
MANPAGES = putty.1 puttygen.1 plink.1 pscp.1 psftp.1 puttytel.1 pterm.1
man: $(MANPAGES)
putty.1: man-putt.but mancfg.but; $(MKMAN)
puttygen.1: man-pg.but mancfg.but; $(MKMAN)
plink.1: man-pl.but mancfg.but; $(MKMAN)
pscp.1: man-pscp.but mancfg.but; $(MKMAN)
psftp.1: man-psft.but mancfg.but; $(MKMAN)
puttytel.1: man-ptel.but mancfg.but; $(MKMAN)
pterm.1: man-pter.but mancfg.but; $(MKMAN)
mostlyclean:
rm -f *.html *.txt *.hlp *.cnt *.1 *.info vstr.but *.hh[pck]
clean: mostlyclean
rm -f *.chm

207
puttysrc/DOC/MAN-PG.BUT Normal file
View File

@@ -0,0 +1,207 @@
\cfg{man-identity}{puttygen}{1}{2004-03-24}{PuTTY tool suite}{PuTTY tool suite}
\H{puttygen-manpage} Man page for PuTTYgen
\S{puttygen-manpage-name} NAME
\cw{puttygen} - public-key generator for the PuTTY tools
\S{puttygen-manpage-synopsis} SYNOPSIS
\c puttygen ( keyfile | -t keytype [ -b bits ] )
\e bbbbbbbb iiiiiii bb iiiiiii bb iiii
\c [ -C new-comment ] [ -P ] [ -q ]
\e bb iiiiiiiiiii bb bb
\c [ -O output-type | -l | -L | -p ]
\e bb iiiiiiiiiii bb bb bb
\c [ -o output-file ]
\e bb iiiiiiiiiii
\S{puttygen-manpage-description} DESCRIPTION
\c{puttygen} is a tool to generate and manipulate SSH public and
private key pairs. It is part of the PuTTY suite, although it can
also interoperate with the private key formats used by some other
SSH clients.
When you run \c{puttygen}, it does three things. Firstly, it either
loads an existing key file (if you specified \e{keyfile}), or
generates a new key (if you specified \e{keytype}). Then, it
optionally makes modifications to the key (changing the comment
and/or the passphrase); finally, it outputs the key, or some
information about the key, to a file.
All three of these phases are controlled by the options described in
the following section.
\S{puttygen-manpage-options} OPTIONS
In the first phase, \c{puttygen} either loads or generates a key.
The options to control this are:
\dt \e{keyfile}
\dd Specify a private key file to be loaded. This private key file can
be in the (de facto standard) SSH-1 key format, or in PuTTY's SSH-2
key format, or in either of the SSH-2 private key formats used by
OpenSSH and ssh.com's implementation.
\dt \cw{\-t} \e{keytype}
\dd Specify a type of key to generate. The acceptable values here are
\c{rsa} and \c{dsa} (to generate SSH-2 keys), and \c{rsa1} (to
generate SSH-1 keys).
\dt \cw{\-b} \e{bits}
\dd Specify the size of the key to generate, in bits. Default is 1024.
\dt \cw{\-q}
\dd Suppress the progress display when generating a new key.
In the second phase, \c{puttygen} optionally alters properties of
the key it has loaded or generated. The options to control this are:
\dt \cw{\-C} \e{new\-comment}
\dd Specify a comment string to describe the key. This comment string
will be used by PuTTY to identify the key to you (when asking you to
enter the passphrase, for example, so that you know which passphrase
to type).
\dt \cw{\-P}
\dd Indicate that you want to change the key's passphrase. This is
automatic when you are generating a new key, but not when you are
modifying an existing key.
In the third phase, \c{puttygen} saves the key or information
about it. The options to control this are:
\dt \cw{\-O} \e{output\-type}
\dd Specify the type of output you want \c{puttygen} to produce.
Acceptable options are:
\lcont{
\dt \cw{private}
\dd Save the private key in a format usable by PuTTY. This will either
be the standard SSH-1 key format, or PuTTY's own SSH-2 key format.
\dt \cw{public}
\dd Save the public key only. For SSH-1 keys, the standard public key
format will be used (\q{\cw{1024 37 5698745}...}). For SSH-2 keys, the
public key will be output in the format specified by RFC 4716,
which is a multi-line text file beginning with the line
\q{\cw{---- BEGIN SSH2 PUBLIC KEY ----}}.
\dt \cw{public-openssh}
\dd Save the public key only, in a format usable by OpenSSH. For SSH-1
keys, this output format behaves identically to \c{public}. For
SSH-2 keys, the public key will be output in the OpenSSH format,
which is a single line (\q{\cw{ssh-rsa AAAAB3NzaC1yc2}...}).
\dt \cw{fingerprint}
\dd Print the fingerprint of the public key. All fingerprinting
algorithms are believed compatible with OpenSSH.
\dt \cw{private-openssh}
\dd Save an SSH-2 private key in OpenSSH's format. This option is not
permitted for SSH-1 keys.
\dt \cw{private-sshcom}
\dd Save an SSH-2 private key in ssh.com's format. This option is not
permitted for SSH-1 keys.
If no output type is specified, the default is \c{private}.
}
\dt \cw{\-o} \e{output\-file}
\dd Specify the file where \c{puttygen} should write its output. If
this option is not specified, \c{puttygen} will assume you want to
overwrite the original file if the input and output file types are
the same (changing a comment or passphrase), and will assume you
want to output to stdout if you are asking for a public key or
fingerprint. Otherwise, the \c{\-o} option is required.
\dt \cw{\-l}
\dd Synonym for \q{\cw{-O fingerprint}}.
\dt \cw{\-L}
\dd Synonym for \q{\cw{-O public-openssh}}.
\dt \cw{\-p}
\dd Synonym for \q{\cw{-O public}}.
The following options do not run PuTTYgen as normal, but print
informational messages and then quit:
\dt \cw{\-h}, \cw{\-\-help}
\dd Display a message summarizing the available options.
\dt \cw{\-V}, \cw{\-\-version}
\dd Display the version of PuTTYgen.
\dt \cw{\-\-pgpfp}
\dd Display the fingerprints of the PuTTY PGP Master Keys, to aid
in verifying new files released by the PuTTY team.
\S{puttygen-manpage-examples} EXAMPLES
To generate an SSH-2 RSA key pair and save it in PuTTY's own format
(you will be prompted for the passphrase):
\c puttygen -t rsa -C "my home key" -o mykey.ppk
To generate a larger (2048-bit) key:
\c puttygen -t rsa -b 2048 -C "my home key" -o mykey.ppk
To change the passphrase on a key (you will be prompted for the old
and new passphrases):
\c puttygen -P mykey.ppk
To change the comment on a key:
\c puttygen -C "new comment" mykey.ppk
To convert a key into OpenSSH's private key format:
\c puttygen mykey.ppk -O private-openssh -o my-openssh-key
To convert a key \e{from} another format (\c{puttygen} will
automatically detect the input key type):
\c puttygen my-ssh.com-key -o mykey.ppk
To display the fingerprint of a key (some key types require a
passphrase to extract even this much information):
\c puttygen -l mykey.ppk
To add the OpenSSH-format public half of a key to your authorised
keys file:
\c puttygen -L mykey.ppk >> $HOME/.ssh/authorized_keys
\S{puttygen-manpage-bugs} BUGS
There's currently no way to supply passphrases in batch mode, or
even just to specify that you don't want a passphrase at all.

Some files were not shown because too many files have changed in this diff Show More