Exemple #1
0
 /******************************************************************************************/
 /// <summary>
 /// check license anf decrypt licanse data
 /// </summary>
 private void CheckLicenseParamter()
 {
     try
     {
         string        datestrformat = "dd/MM/yyyy";
         string        ILDate        = DateTime.Now.ToString(datestrformat);
         XmlDocument   xmlDoc        = new XmlDocument();
         CreateLicense cl            = new CreateLicense();
         if (!File.Exists("License.xml"))
         {
             cl.BuildLicenseFile();
         }
         else
         {
             xmlDoc.Load("License.xml");
             XmlNodeList nodeList = xmlDoc.DocumentElement.SelectNodes("/License/License");
             string      license_id = "", license_Date = "";
             foreach (XmlNode node in nodeList)
             {
                 license_id   = node.SelectSingleNode("License_id").InnerText;
                 license_Date = node.SelectSingleNode("License_Date").InnerText;
             }
             DecryptText(license_Date.ToString().Trim());
             string LicDate = s1.ToString();
             if (DateTime.Parse(LicDate) <= DateTime.Parse(ILDate))
             {
                 MessageBox.Show("תקופת הרישיון פגה, פנה לשירות על מנת לחדש");
                 License l = new License();
                 l.Show();
                 showLayoutEmpty();
                 //tableLayoutPanelTodayTimes.Visible = false;
                 //tableLayoutPanelSynName.Visible = false;
                 //tableLayoutPanelPrayTimes.Visible = false;
                 //tableLayoutPanelMsg.Visible = false;
                 //tableLayoutPanelParnas.Visible = false;
             }
             else
             {
                 showLayoutTT();
                 showLayoutPT();
                 showLayoutParns();
                 showLayoutMSG();
                 showLayoutHilio();
                 //tableLayoutPanelTodayTimes.Visible = true;
                 //tableLayoutPanelSynName.Visible = true;
                 //tableLayoutPanelPrayTimes.Visible = true;
                 //tableLayoutPanelMsg.Visible = true;
                 //tableLayoutPanelParnas.Visible = true;
             }
         }
     }
     catch { }
 }
Exemple #2
0
        public void LicenseEndDate()
        {
            XmlDocument   xmlDoc = new XmlDocument();
            CreateLicense cl     = new CreateLicense();

            if (!File.Exists("License.xml"))
            {
                cl.BuildEncryptLicenseDate();
            }
            else
            {
                xmlDoc.Load("License.xml");
                XmlNodeList nodeList = xmlDoc.DocumentElement.SelectNodes("/License/License");
                string      license_id = "", license_Date = "";
                foreach (XmlNode node in nodeList)
                {
                    license_id   = node.SelectSingleNode("License_id").InnerText;
                    license_Date = node.SelectSingleNode("License_Date").InnerText;
                }
                DecryptText(license_Date.ToString().Trim());
                string endDate = s1.ToString();
                lblEndLicDate.Text = "פקיעת תוקף רישיון :" + endDate;
            }
        }