منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
[VB.NET] بخصوص تشفير FoxLearn.License - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : [VB.NET] بخصوص تشفير FoxLearn.License (/showthread.php?tid=54235)



بخصوص تشفير FoxLearn.License - h2551996 - 16-07-25

السلام عليكم
قمت بتفعيل ترخيص البرنامج ( تجريبي - مدى الحياة )


فورم توليد سيريال 
كود :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using FoxLearn.License;

namespace FoxLicensMemo
{
   public partial class frmGenerate : Form
   {
       public frmGenerate()
       {
           InitializeComponent();
       }


       const int ProductCode = 1;

       private void frmGenerate_Load(object sender, EventArgs e)
       {
           cboLicenseType.SelectedIndex = 0;
           //Get computer id, it's unique for each computer
           txtProductID.Text = "";
       }

       private void button1_Click(object sender, EventArgs e)
       {
           KeyManager km = new KeyManager(txtProductID.Text);
           KeyValuesClass kv;
           string productKey = string.Empty;
           if (cboLicenseType.SelectedIndex == 0)
           {
               kv = new KeyValuesClass()
               {
                   Type = LicenseType.FULL,
                   Header = Convert.ToByte(9),
                   Footer = Convert.ToByte(6),
                   ProductCode = (byte)ProductCode,//As order of your software
                   Edition = Edition.ENTERPRISE,
                   Version = 1
               };
               if (!km.GenerateKey(kv, ref productKey))//Generate full license key
                   txtProductKey.Text = "ERROR";
           }
           else
           {
               kv = new KeyValuesClass()
               {
                   Type = LicenseType.TRIAL,
                   Header = Convert.ToByte(9),
                   Footer = Convert.ToByte(6),
                   ProductCode = (byte)ProductCode,
                   Edition = Edition.ENTERPRISE,
                   Version = 1,
                   Expiration = DateTime.Now.Date.AddDays(Convert.ToInt32(txtExperience.Text))
               };
               if (!km.GenerateKey(kv, ref productKey))//Generate trial license key
                   txtProductKey.Text = "ERROR";
           }
           txtProductKey.Text = productKey;
       }

       private void txtProductKey_TextChanged(object sender, EventArgs e)
       {

       }
   }
}
وكود قبول الكود هذا هو
كود :
Dim km As KeyManager = New KeyManager(serial.Text)
       Dim productKey As String = 1

       If km.ValidKey(productKey) Then
           Dim kv As KeyValuesClass = New KeyValuesClass()

           If km.DisassembleKey(productKey, kv) Then
               Dim lic As LicenseInfo = New LicenseInfo()
               lic.ProductKey = productKey
               lic.FullName = "FoxLearn"

               If kv.Type = LicenseType.TRIAL Then
                   lic.Day = kv.Expiration.Day
                   lic.Month = kv.Expiration.Month
                   lic.Year = kv.Expiration.Year
               End If
               MessageBox.Show("You have been successfully registered.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information)
               Process.Start("First System.exe")
               End
           End If
       Else
           MessageBox.Show("Your product key is invalid.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information)
           End
       End If
       My.Settings.date_ex = Date.Now

       My.Settings.Save()
لماذا يظهر الخطا ولا يقبل السيريال


RE: بخصوص تشفير FoxLearn.License - h2551996 - 17-07-25

هو نفس المشروع لديك
ايضا المشروع المرفق من طرفك
تظهر نفس الرسالة