示例#1
0
        static bool CheckTrial(PluginEntry pe)
        {
            TrialMaker t = new TrialMaker("TT6", Application.StartupPath + "\\RegFile.reg",
                //Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetp.dbf",
                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\TMSetp.dbf",
                "",
                60, 1000, "745");
            //Environment.SpecialFolder.ApplicationData
            byte[] MyOwnKey = { 97, 250, 1, 5, 84, 21, 7, 63,
            4, 54, 87, 56, 123, 10, 3, 62,
            7, 9, 20, 36, 37, 21, 101, 57};
            t.TripleDESKey = MyOwnKey;

            TrialMaker.RunTypes RT = t.ShowDialog();
            //bool is_trial;
            if (RT != TrialMaker.RunTypes.Expired)
            {
                /*
                if (RT == TrialMaker.RunTypes.Full)
                    is_trial = false;
                else
                    is_trial = true;
                 * */
                return true;
                //Application.Run(new Form1(is_trial));
            }
            return false;
            //return true;
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            TrialMaker t = new TrialMaker("TMTest1", Application.StartupPath + "\\RegFile.reg",
                                          Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetp.dbf",
                                          "Phone: +98 21 88281536\nMobile: +98 912 2881860",
                                          5, 10, "745");

            byte[] MyOwnKey = { 97, 250,  1,  5,  84, 21,   7, 63,
                                4,   54, 87, 56, 123, 10,   3, 62,
                                7,    9, 20, 36,  37, 21, 101, 57 };
            t.TripleDESKey = MyOwnKey;
            bool is_trial;

            TrialMaker.RunTypes RT = t.ShowDialog();
            if (RT != TrialMaker.RunTypes.Expired)
            {
                if (RT == TrialMaker.RunTypes.Full)
                {
                    is_trial = false;
                }
                else
                {
                    is_trial = true;
                }

                //Application.Run(new Form1(is_trial));
            }
        }
示例#3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TrialMaker t = new TrialMaker("TMTest1", Application.StartupPath + "\\RegFile.reg",
                                          Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetp.dbf",
                                          "Phone: +98 21 88281536\nMobile: +98 912 2881860",
                                          5, 10, "745");

            byte[] MyOwnKey = { 97, 250,  1,  5,  84, 21,   7, 63,
                                4,   54, 87, 56, 123, 10,   3, 62,
                                7,    9, 20, 36,  37, 21, 101, 57 };
            t.TripleDESKey = MyOwnKey;

            TrialMaker.RunTypes RT = t.ShowDialog();
            bool is_trial;

            if (RT != TrialMaker.RunTypes.Expired)
            {
                if (RT == TrialMaker.RunTypes.Full)
                {
                    is_trial = false;
                }
                else
                {
                    is_trial = true;
                }

                Application.Run(new Form1(is_trial));
            }
        }
示例#4
0
        private bool CheckTrial()
        {
            bool   result   = false;
            string hideFile = Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetp13.dbf";

            TrialMaker     trial     = new TrialMaker("BCFReader", hideFile);
            bool           isPassed  = trial.IsPassed;
            TrialMakerForm trialForm = new TrialMakerForm(trial);

            if (isPassed)
            {
                result = true;
            }
            else
            {
                DialogResult dr = trialForm.ShowDialog();
                if (dr == DialogResult.OK) //continue to run
                {
                    result = true;
                }
                else if (dr == DialogResult.Cancel)
                {
                    result = false;
                }
            }
            return(result);
        }
示例#5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            TrialMaker t = new TrialMaker("SiriusQuality2", Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\rxsv.reg",
                                          Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\tndaxlasv.dbf",
                                          "E-mail: [email protected]",
                                          30, 100, "257");

            Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.System));

            byte[] MyOwnKey = { 97, 150,  1,  5,  84, 21,   7, 63,
                                4,   54, 87, 56, 123, 10,   3, 62,
                                7,    9, 20, 36,  37, 21, 121, 57 };
            t.TripleDESKey = MyOwnKey;

            TrialMaker.RunTypes RT = t.ShowDialog();
            bool is_trial;

            if (RT != TrialMaker.RunTypes.Expired)
            {
                if (RT == TrialMaker.RunTypes.Full)
                {
                    is_trial = false;
                }
                else
                {
                    is_trial = true;
                }
                Application.Run(new MainForm(is_trial));
            }
        }
示例#6
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TrialMaker t = new TrialMaker("RAT1", Application.StartupPath + "\\RegFile.reg",
                                          Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\RAT.dbf",
                                          "Phone: +841682699970\nMobile: +84972253758",
                                          30, 7, PASSWORD);

            byte[] MyOwnKey = { 97, 250,  1,  5,  84, 21,   7, 63,
                                4,   54, 87, 56, 123, 10,   3, 62,
                                7,    9, 20, 36,  37, 21, 101, 57 };
            t.TripleDESKey = MyOwnKey;

            TrialMaker.RunTypes RT = t.ShowDialog();
            bool is_trial;

            if (RT != TrialMaker.RunTypes.Expired)
            {
                if (RT == TrialMaker.RunTypes.Full)
                {
                    is_trial = false;
                }
                else
                {
                    is_trial = true;
                }

                Application.Run(new form.Main(is_trial));
            }

            //Application.Run(new form.Main(true));
        }
示例#7
0
        public TrialMakerForm(TrialMaker trial)
        {
            trialMaker = trial;
            runType    = trialMaker.RunType;
            InitializeComponent();

            DisplaySettings();
        }
示例#8
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new frmMain());


            //SplashScreen.SplashScreen.ShowSplashScreen();
            //Application.DoEvents();
            //SplashScreen.SplashScreen.SetStatus("Loading module 1");
            //System.Threading.Thread.Sleep(500);
            //SplashScreen.SplashScreen.SetStatus("Loading module 2");
            //System.Threading.Thread.Sleep(300);
            //SplashScreen.SplashScreen.SetStatus("Loading module 3");
            //System.Threading.Thread.Sleep(900);
            //SplashScreen.SplashScreen.SetStatus("Loading module 4");
            //System.Threading.Thread.Sleep(100);
            //SplashScreen.SplashScreen.SetStatus("Loading module 5");
            //System.Threading.Thread.Sleep(400);
            //SplashScreen.SplashScreen.SetStatus("Loading module 6");
            //System.Threading.Thread.Sleep(50);
            //SplashScreen.SplashScreen.SetStatus("Loading module 7");
            //System.Threading.Thread.Sleep(240);
            //SplashScreen.SplashScreen.SetStatus("Loading module 8");
            //System.Threading.Thread.Sleep(900);
            //SplashScreen.SplashScreen.SetStatus("Loading module 9");
            //System.Threading.Thread.Sleep(240);
            //SplashScreen.SplashScreen.SetStatus("Loading module 10");
            //System.Threading.Thread.Sleep(90);
            //SplashScreen.SplashScreen.CloseForm();

            TrialMaker t = new TrialMaker("EZ_Sales_App_2010", Application.StartupPath + "\\RegFile.reg",
                                          Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetp.dbf",
                                          "Phone:+0903332010 \nMobile:+0909577079",
                                          30, 300, "66234879121237699861");

            byte[] MyOwnKey = { 97, 250,  1,  5,  84, 21,   7, 63,
                                4,   54, 87, 56, 123, 10,   3, 62,
                                7,    9, 20, 36,  37, 21, 101, 57 };
            t.TripleDESKey = MyOwnKey;

            TrialMaker.RunTypes RT = t.ShowDialog();
            bool is_trial;

            if (RT != TrialMaker.RunTypes.Expired)
            {
                if (RT == TrialMaker.RunTypes.Full)
                {
                    is_trial = false;
                }
                else
                {
                    is_trial = true;
                }

                Application.Run(new frmMain(is_trial));
            }
        }
示例#9
0
        static void Main()
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);

            TrialMaker t = new TrialMaker("StokeRobotLaserControlSys1", Application.StartupPath + "\\RegFile.reg",
                                          Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\SRLCS1.dbf",
                                          "Mail: [email protected]",
                                          30, 100000, "158");

            byte[] MyOwnKey = { 97, 250,  1,  5,  84, 21,   7, 63,
                                4,   54, 87, 56, 123, 10,   3, 62,
                                7,    9, 20, 36,  37, 21, 101, 57 };
            t.TripleDESKey = MyOwnKey;

            TrialMaker.RunTypes RT = t.ShowDialog();
            if (RT == TrialMaker.RunTypes.Expired)
            {
                return;
            }

            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            if (CheckActiveProcess() == true)
            {
                Application.Exit();
                return;
            }

            ShowSplashScreen();

            // BasicConfigurator.Configure();
            log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(Application.StartupPath + "\\System\\log.xml"));

            // Einschalten internes Debugging der LOG Komponenete
            // log4net.Util.LogLog.InternalDebugging = true;
            MainApp.log.Info("Application started.");

            // set the NumberGroupSeparator for all forms
            System.Globalization.CultureInfo newCultureInfo = new System.Globalization.CultureInfo(System.Threading.Thread.CurrentThread.CurrentCulture.LCID);
            newCultureInfo.NumberFormat.NumberDecimalSeparator = ".";
            newCultureInfo.NumberFormat.NumberGroupSeparator   = ",";
            newCultureInfo.TextInfo.ListSeparator = ";";
            Application.CurrentCulture            = newCultureInfo;

            // load the settings
            MainApp.appSettings          = new Settings();
            MainApp.appSettings.FileName = Application.StartupPath + "\\System\\AppSet.xml";
            MainApp.appSettings.ReadSettings();

            mainApp = new MainApp();
            Application.Run(mainApp);
            MainApp.log.Info("Application stopped.");

            MainApp.appSettings.WriteSettings();
        }
示例#10
0
        static void Main()
        {
            //try
            //{
            if (mutex.WaitOne(TimeSpan.Zero, true))     //<<< make multi instances possible
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                //if (DateTime.Now < (new DateTime(2015, 1, 1, 0, 0, 0)))
                //{
                TrialMaker t = new TrialMaker("UDE", Application.StartupPath + "\\RegFile.reg",
                                              Application.StartupPath + "\\Con" + "figW32.d" + "ll",
                                              "[email protected]\nPhone: +91 422 2533603\nMobile: +91 9790101300",
                                              10 + 10 + 5, 100 + 50, "A1" + "9F2");

                byte[] Monkey = { 53, 23, 21, 33,  55, 11,   5, 12,
                                  56, 67, 90, 76, 253, 10,   3, 62,
                                  99, 54, 95, 23, 199, 43, 212, 32 };
                t.TripleDESKey = Monkey;

                TrialMaker.RunTypes RT = t.ShowDialog();
                if (RT == TrialMaker.RunTypes.Full)
                {
                    MessageBox.Show("Good Luck!");
                    Application.Run(new Main());
                }
                else if (RT == TrialMaker.RunTypes.Trial)
                {
                    MessageBox.Show("Trial Period", "Trial", MessageBoxButtons.OK);
                    Application.Run(new Main());
                }
                else
                {
                    MessageBox.Show("Contact [email protected]", "License Expired", MessageBoxButtons.OK);
                }

                //}
                //else
                //{
                //}
            }
            else
            {
                Application.DoEvents();
                // send our Win32 message to make the currently running instance
                // jump on top of all the other windows
                NativeMethods.PostMessage(
                    (IntPtr)NativeMethods.HWND_BROADCAST,
                    NativeMethods.WM_SHOWME,
                    IntPtr.Zero,
                    IntPtr.Zero);
            }
        }
示例#11
0
        /// <summary>
        /// Check if the trial mode is active or not.
        /// </summary>
        /// <returns>Return true if trial is active</returns>
        public static bool IsTrialActive(out LicenceExpiry licence)
        {
            var tMaker = new TrialMaker("HouseApp", AppDataPath + "\\LICENCE.LICX", AppDataPath + "\\SYS.DAT",
                                        "Contact us Details:\n\nEmail: [email protected] \n\nWebSite: www.ihome.org.il", 30, 150, "745");

            byte[] myOwnKey =
            {
                97, 250,  1,  5,  84, 21,   7, 63,
                4,   54, 87, 56, 123, 10,   3, 62,
                7,    9, 20, 36,  37, 21, 101, 57
            };

            tMaker.TripleDESKey = myOwnKey;

            TrialMaker.RunTypes rt = tMaker.ShowDialog();

            if (rt == TrialMaker.RunTypes.Expired)
            {
                licence = null;
                return(false);
            }
            var isTrial = rt != TrialMaker.RunTypes.Full;

            if (!isTrial)
            {
                // now we need to check that the application has not expired, if so we will delete the licence keys
                licence = LicenceExpiry.Read();
                if (licence != null)
                {
                    if (licence.DaysTillExpiry <= 0)
                    {
                        // delete the licence key
                        if (File.Exists(AppDataPath + "\\LICENCE.LICX"))
                        {
                            File.Delete(string.Format("{0}\\{1}", AppDataPath, "LICENCE.LICX"));
                            MessageBox.Show("Your Licence has Expired", "Licence Expiry", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            Application.Exit();
                        }
                    }
                }
            }
            else
            {
                licence = new LicenceExpiry();

                DateTime dtNow     = DateTime.Now;
                DateTime dtExpires = dtNow.AddDays(tMaker.TrialPeriodDays);

                licence.ExpiryDate = new DateTime(dtExpires.Year, dtExpires.Month, dtExpires.Day + 0, 0, 0, 0);
            }

            return(true);
        }
示例#12
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TrialMaker t = new TrialMaker("TMTest1", Application.StartupPath + "\\RegFile365.reg",
                                          Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetp365.dbf",
                                          "Owner : م/محمد دبور",
                                          365, 999999999, "914");

            // أول رقم ده عدد الايام والتاني عدد المرات والتالت الايدنتفاير

            byte[] MyOwnKey = { 97, 250,  1,  5,  84, 21,   7, 63,
                                4,   54, 87, 56, 123, 10,   3, 62,
                                7,    9, 20, 36,  37, 21, 101, 57 };
            t.TripleDESKey = MyOwnKey;

            TrialMaker.RunTypes RT = t.ShowDialog();
            bool is_trial;

            if (RT != TrialMaker.RunTypes.Expired)
            {
                if (RT == TrialMaker.RunTypes.Full)
                {
                    is_trial = false;
                }
                else
                {
                    is_trial = true;
                }

                BackEnd.SessionInfo.cn = new SqlConnection();
                BackEnd.SessionInfo.cn.ConnectionString = BackEnd.SessionInfo.Connection;
                BackEnd.SessionInfo.cn.Open();
                try {
                    SqlCommand cm = new SqlCommand();
                    cm.Connection  = BackEnd.SessionInfo.cn;
                    cm.CommandText = "CREATE TABLE [dbo].[Users]([ID][int] IDENTITY(1, 1) NOT NULL, [UserName] [nvarchar](max) NULL,[Password][nvarchar](max) NULL,[Permissions][nvarchar](max) NULL,CONSTRAINT[PK_Users] PRIMARY KEY CLUSTERED([ID] ASC)WITH(PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON[PRIMARY]) ON[PRIMARY] TEXTIMAGE_ON[PRIMARY]";
                    cm.ExecuteNonQuery();
                    cm.CommandText = "Insert into Users(UserName,Password,Permissions) values('Admin','+Vs4ZHwle88=','yyyyyyyyyyyyyy')";
                    cm.ExecuteNonQuery();
                }
                catch { }
                Application.Run(new FrontEnd.Login());
            }
        }
示例#13
0
文件: Program.cs 项目: rozytwan/POS
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TrialMaker t = new TrialMaker("TMTestSM", Application.StartupPath + "\\RegFile.reg", Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetup.dbf", "", 30, "745");

            byte[] MyOwenKey = { 97, 250, 1, 5, 84, 21, 7, 63, 4, 54, 87, 56, 123, 10, 3, 62, 7, 9, 20, 36, 37, 21, 101, 57 };
            t.TripleDESKey = MyOwenKey;
            TrialMaker.RunTypes RT = t.ShowDialog();
            string abc             = @"Software\restrictedarea\restrictedValues\pospos\PosPrivate";
            Secure scr             = new Secure();
            bool   logic           = scr.Algorithm(frmDialog.trial_code, abc);

            if (logic == true)
            {
                Application.Run(new Login());
            }
        }
示例#14
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (!System.Diagnostics.Debugger.IsAttached)
            {
                TrialMaker t = new TrialMaker("NavPlanner", Application.StartupPath + "\\RegFile.reg",
                                              Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetp.dbf",
                                              "Email: [email protected]\n  [email protected]",
                                              60, Int32.MaxValue, "786");

                byte[] MyOwnKey = { 97, 250,  1,  5,  84, 21,   7, 63,
                                    4,   54, 87, 56, 123, 10,   3, 62,
                                    7,    9, 20, 36,  37, 21, 101, 57 };
                t.TripleDESKey = MyOwnKey;

                var  RT = t.ShowDialog();
                bool is_trial;
                if (RT.Item1 != TrialMaker.RunTypes.Expired)
                {
                    if (RT.Item1 == TrialMaker.RunTypes.Full)
                    {
                        is_trial = false;
                    }
                    else
                    {
                        is_trial = true;
                    }

                    Application.Run(new Main_Form_New_Design2(is_trial, RT.Item2));
                }
            }
            else
            {
                Application.Run(new Main_Form_New_Design2(true, string.Empty));
            }
        }
示例#15
0
        private void mnuRegistro_Click(object sender, EventArgs e)
        {
            var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            string path = appDataPath + @"\Optima\";

            TrialMaker t = new TrialMaker("Optima", Application.StartupPath + "\\RegFile.reg",
                                          path + "\\Optima.dbf",
                                          "Fixo: +55 (21)3226-2645\nCelular: +55 (21)99205-6591",
                                          5, 10, "289", true);

            byte[] MyOwnKey = { 97, 250,  1,  5,  84, 21,   7, 63,
                                4,   54, 87, 56, 123, 10,   3, 62,
                                7,    9, 20, 36,  37, 21, 101, 57 };
            t.TripleDESKey = MyOwnKey;

            TrialMaker.RunTypes RT = t.ShowDialog();

            if (RT == TrialMaker.RunTypes.Full)
            {
                MessageBox.Show("Está cópia já foi registrada.", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#16
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            AppDomain.CurrentDomain.SetData("DataDirectory", Directory.GetCurrentDirectory());

            frmSplash splash = new frmSplash();

            splash.Show();
            splash.Cursor = Cursors.AppStarting;


            Application.DoEvents();

            splash.setMensagem("Carregando configurações.");
            splash.setprogresso(100);
            Thread.Sleep(500);
            Application.DoEvents();

            //splash.setMensagem("Sincronizando informações com a nuvem.");
            //Application.DoEvents();

            /*Ao incluir um novo webservice no projeto SYNC copiar o conteundo de <system.serviceModel> </system.serviceModel>
             * para o app.config da aplicação principal.
             */

#if RELEASE
            ////Clientes
            //ClienteProxy cp = new ClienteProxy();
            //try
            //{
            //    cp.SyncCadastroCliente();
            //}
            //catch(Exception ex)
            //{
            //    MessageBox.Show(ex.InnerException.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}

            ////Produtos
            //ProdutoProxy pp = new ProdutoProxy();
            //try
            //{
            //    pp.SyncCadastroProduto();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}

            //FormaPagVendasProxy fpv = new FormaPagVendasProxy();
            //try
            //{
            //    fpv.SyncFormaPagVendas();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //}

            //CidadesProxy cid = new CidadesProxy();
            //try
            //{
            //    cid.SyncCidades();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}

            //ProdutosImpostosProxy prod = new ProdutosImpostosProxy();
            //try
            //{
            //    prod.SyncProdutosImpostos();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}

            //ParcelaProxy parcelas = new ParcelaProxy();
            //try
            //{
            //    splash.setMensagem("Sincronizando cadastro de parcelas");
            //    Application.DoEvents();
            //    parcelas.SyncParcela();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}

            //ProdutosImpostosProxy prod = new ProdutosImpostosProxy();
            //try
            //{
            //    splash.setMensagem("Sincronizando cadastro de Impostos aprendidos.");
            //    Application.DoEvents();
            //    prod.SyncProdutosImpostos();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}

            //CategoriaProxy categ = new CategoriaProxy();
            //try
            //{
            //    splash.setMensagem("Sincronizando cadastro de Categorias.");
            //    Application.DoEvents();
            //    categ.SyncCategoria();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}

            // ContaCorrenteProxy cc = new ContaCorrenteProxy();
            //try
            //{
            //    splash.setMensagem("Sincronizando cadastro de Conta Corrente.");
            //    Application.DoEvents();
            //    cc.SyncContaCorrente();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}

            //ContaCorrenteProxy cc = new ContaCorrenteProxy();
            //try
            //{
            //    splash.setMensagem("Sincronizando cadastro de Conta Corrente.");
            //    Application.DoEvents();
            //    cc.SyncContaCorrente();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}

            //ContaCorrenteProxy cc = new ContaCorrenteProxy();
            //try
            //{
            //    splash.setMensagem("Sincronizando cadastro de Conta Corrente.");
            //    Application.DoEvents();
            //    cc.SyncContaCorrente();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    throw;
            //}
#endif



            //splash.setprogresso(60);
            //Thread.Sleep(100);
            //Application.DoEvents();

            //splash.setMensagem("Sincronizado.");
            //splash.setprogresso(100);
            //Thread.Sleep(100);
            //Application.DoEvents();

            //Thread.Sleep(50);
            //Application.DoEvents();

            var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);


            string path = appDataPath + @"\Optima\";

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }



            TrialMaker t = new TrialMaker("Optima", Application.StartupPath + "\\RegFile.reg",
                                          path + "\\Optima.dbf",
                                          "Fixo: +55 (21)3226-2645\nCelular: +55 (21)99205-6591",
                                          30, 10, "289", false);

            byte[] MyOwnKey = { 97, 250,  1,  5,  84, 21,   7, 63,
                                4,   54, 87, 56, 123, 10,   3, 62,
                                7,    9, 20, 36,  37, 21, 101, 57 };
            t.TripleDESKey = MyOwnKey;
            splash.Cursor  = Cursors.Default;
            splash.Dispose();

            TrialMaker.RunTypes RT = t.ShowDialog();
            bool is_trial;
            int  NrDiasTrial = t.NrDiasFimAvalicao();


            if (RT != TrialMaker.RunTypes.Expired)
            {
                string MsgLogin = string.Empty;
                if (RT == TrialMaker.RunTypes.Full)
                {
                    is_trial = false;
                }
                else
                {
                    is_trial = true;
                }

                if (is_trial)
                {
                    MsgLogin = string.Format("Versão de avaliação. Tempo restante: {0} dia(s).", NrDiasTrial);
                }

                frmLogin login = new frmLogin(MsgLogin);


                if (login.ShowDialog() == DialogResult.OK)
                {
                    Application.Run(new frmPrincipal());
                }
                else
                {
                    Application.Exit();
                }
            }
            else
            {
                Application.Exit();
            }
        }