Ejemplo n.º 1
0
        private delegate void ShowUI(CmdResult command); /*显示结果集*/


        private void MainFrm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (MessageBox.Show("真的要退出吗?", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
            {
                e.Cancel = true;
                return;
            }
            else
            {
                CheckPwd form1 = new CheckPwd();
                if (form1.ShowDialog() == DialogResult.OK)
                {
                    this.btnEnd_Click(sender, e);
                    /*清理缓存*/
                    try
                    {
                        //bool bIsNext = true;
                        //var enumer = NCSys.Result.GetEnumerator();
                        //while (bIsNext == true)
                        //{
                        //    bIsNext = enumer.MoveNext();
                        //    if (bIsNext == false) break;
                        //    var s0 = enumer.Current;
                        //    CollectVModel s1 = s0.Value;
                        //    if (s1 == null) continue;

                        //    SysPro pro;
                        //    NCSys.Pro.TryGetValue(s1.Ledger, out pro);
                        //    if (pro == null) continue;
                        //    int cc = 0;
                        //    while (++cc <= 2)
                        //    {
                        //        if (MemcachedMgr.RemoveKey(pro.ProjectKey + s1.CachedKey) == true)
                        //        {
                        //            //FileLog.WriteLog("key:" + pro.ProjectKey + s1.CachedKey + "移除成功");
                        //            break;
                        //        }
                        //        Thread.Sleep(5);
                        //    }
                        //}
                    }
                    catch (Exception ex)
                    {
                        FileLog.Error("退出清理缓存错误" + ex.Message + ex.StackTrace);
                    }
                }
                else
                {
                    e.Cancel = true;
                    return;
                }
            }
        }
Ejemplo n.º 2
0
        private void btnCfg_Click(object sender, EventArgs e)
        {
            CheckPwd form1 = new CheckPwd();

            if (form1.ShowDialog() == DialogResult.OK)
            {
                FormCfg form = new FormCfg();
                form.ShowDialog();
            }
            else
            {
                return;
            }
        }