Ejemplo n.º 1
0
        private void timerEncypt_Tick(object sender, EventArgs e)
        {
            //
            // "c13124f32117de81"

            if (!inited)
            {
                string fp = System.Environment.CurrentDirectory + "\\courses\\" + this.CourseNo + "\\pag2a.swf";

                if (!File.Exists(fp))
                {
                    timerEncypt.Enabled = false;
                    MessageBox.Show("课程文件不存在,请检查:" + fp);
                    return;
                }

                swf.Movie = fp;

                inited = true;

                timerEncypt.Interval = 1200;

                return;
            }

            if (!second)
            {
                timerEncypt.Interval = 60000;// 60 secs
                second = true;
            }

            //callFunction("pula_key", AES.AesCtr.encrypt(UnixTool.timestamp().ToString(), this.CourseKey, 256));

            callFunction("pula_key", AES.AesCtr.encrypt(UnixTool.timestamp().ToString(), this.CourseKey, 256));
        }
Ejemplo n.º 2
0
        private void btnSyncActive_Click(object sender, EventArgs e)
        {
            JsonResult jr = RemoteServiceProxy.SyncActive(machineCode);

            if (jr.error)
            {
                UIHelper.ShowAlert(jr.message);
            }
            else
            {
                long tick = 0;
                long.TryParse(jr.data["expiredTime"], out tick);
                tick = tick / 1000;



                // AddLog("success=" + jr.message);
                //save
                int n = 0;
                if (tick == 0)
                {
                    SqlLiteHelper.ExecuteNonQuery("update system set active_code=?,node_name=?,active_time=datetime('now','localtime'),node_id=?,expire_time=null",
                                                  jr.data["licenseKey"], jr.data["name"], jr.data["classroomId"]);
                }
                else
                {
                    DateTime expire_time = UnixTool.ConvertIntDateTime(tick);
                    if (expire_time.CompareTo(System.DateTime.Now) <= 0)
                    {
                        //到期了
                        expired = true;
                        UIHelper.ShowAlert("激活信息已经失效,请与总部联系");
                        return;
                    }


                    n = SqlLiteHelper.ExecuteNonQuery("update system set active_code=?,node_name=?,active_time=datetime('now','localtime'),node_id=?,expire_time=datetime(?, 'unixepoch', 'localtime')",
                                                      jr.data["licenseKey"], jr.data["name"], jr.data["classroomId"], tick);
                }
                // int n = SqlLiteHelper.ExecuteNonQuery("update system set node_id=?", jr.data["classroomId"]);
                UIHelper.ShowInfo("成功同步激活信息");
                ShowSuccess(true);

                DialogResult = DialogResult.OK;
            }
        }
Ejemplo n.º 3
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     callFunction("pula_key", AES.AesCtr.encrypt(UnixTool.timestamp().ToString(), this.CourseKey, 256));
 }