Example #1
0
        static bool CheckTrial(PluginEntry pe)
        {
            TrialMaker t = new TrialMaker("TT1", Application.StartupPath + "\\RegFile.reg",
                //Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetp.dbf",
                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\TMSetp.dbf",
                "",
                30, 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;
        }
Example #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            SoftwareLocker.TrialMaker t = new SoftwareLocker.TrialMaker("TMTest1", Application.StartupPath + "\\RegFile.reg",
                                                                        Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\TMSetp.dbf",
                                                                        "Phone:", 5, 10, "745", "prodcard232");

            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));
            }
        }
Example #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TrialMaker t = new TrialMaker("RMSClient", Application.StartupPath + "\\RMSClientRegFile.reg",
                Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\RMSClient.dbf",
                "Phone: +88 21 88281536\nMobile: +88 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));
            }
        }
Example #4
0
        //System.Windows.Forms.Application.EnableVisualStyles();
        // System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
        protected override void OnStartup(StartupEventArgs e)
        {
            try
            {
                base.OnStartup(e);
                if (ApplicationRunningHelper.AlreadyRunning())
                {
                    System.Windows.Application.Current.Shutdown();
                    return;
                }
                SoftwareLocker.TrialMaker t = new SoftwareLocker.TrialMaker("ZebecLoadMasterGasCommerce", System.IO.Directory.GetCurrentDirectory() + "\\RegFile.reg",
                                                                            Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\1L2O3D4I5C6A7T8O9R2.dbf",
                                                                            "",
                                                                            20, "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=
                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;

                    //System.Windows.Application.Run(new MainWindow(is_trial))
                    //if (is_trial == true)
                    //{

                    System.Windows.Application.Current.StartupUri = new Uri("/ZebecLoadMaster;component/MainWindow.xaml",
                                                                            UriKind.Relative);
                    //}
                    //else
                    //{
                    //    System.Windows.Application.Current.Shutdown();
                    //}
                    //LoginDialog dlg = new LoginDialog();
                    //if (dlg.ShowDialog() != true)
                    //    return;

                    //switch (dlg.ChoiceApp)
                    //{
                    //    case ChoiceApp.CustomerEntry:
                    //        StartupUri = new Uri("/MyApp;component/Forms/CustomerEntry.xaml",
                    //            UriKind.Relative);
                    //        break;
                    //    case ChoiceApp.VendorEntry:
                    //        StartupUri = new Uri("/MyApp;component/Forms/VendorEntry.xaml",
                    //            UriKind.Relative);
                    //        break;
                    //}
                }
                else if (RT == TrialMaker.RunTypes.Expired)
                {
                    //System.Windows.MessageBox.Show("Trial Period of this Application Has Expired.Please Contact Administrator");
                    System.Windows.Application.Current.Shutdown();
                }
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(ex.Message + "Error");
            }
        }
Example #5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TrialMaker t = new TrialMaker("Clinic", 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));
            }

            if (!File.Exists("WriteLines.txt"))
            {
                PassSQL SqlForm = new PassSQL();
                SqlForm.ShowDialog();
                if (SqlForm.DialogResult == DialogResult.Cancel)
                {
                    return;
                }

            }
            try
            {
                Logger.Log("CreateNewDatabase", "begin");
                string[] lines = System.IO.File.ReadAllLines("WriteLines.txt");
                // GetConnectionString(lines[0], lines[1]);
                DatabaseFactory.CreateNewDatabase("", GetConnectionString(lines[0], lines[1]));

            }
            catch (Exception e)
            {

                Logger.Log("CreateNewDatabase", "fail");

                File.Delete("WriteLines.txt");
                MessageBox.Show("Lỗi database! Xin chạy lại chương trình!");
            }
            try
            {

                if (!Helper.checkAdminExists("clinicuser"))
                {
                    Logger.Log("checkAdminExists", "true");
                    CreateUserForm createUserForm = new CreateUserForm();
                    if (createUserForm.ShowDialog() == DialogResult.OK)
                    {

                        LoginForm login = new LoginForm();

                        if (login.ShowDialog() == DialogResult.OK)
                        {

                            Application.Run(new Form1(LoginForm.Authority, LoginForm.Name1));
                        }
                    }
                }
                else
                {
                    Logger.Log("checkAdminExists", "false");
                    LoginForm login = new LoginForm();

                    if (login.ShowDialog() == DialogResult.OK)
                    {
                        Application.Run(new Form1(LoginForm.Authority, LoginForm.Name1));
                    }

                }
            }
            catch (Exception ex)
            {
                Logger.Log("TryOpenLoginForm", "false");
            }
        }
Example #6
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));
            }
        }