Пример #1
0
        public void Request(string t, string pars, out string res)
        {
            WebHelper w = new WebHelper(pars);

            IBLL.IUpdate bll = new BLL.UpdateBLL();
            try
            {
                w.ReflectionMethod(bll, t);
            }
            catch (Exception ex)
            {
                w.WriteError(ex);
            }
            res = w.NmJson();
        }
Пример #2
0
        public static void Upadte()
        {
            try
            {
                {
                    //更新中间件
                    IBLL.IUpdate bll = new BLL.UpdateBLL();
                    bll.AutoUpdate();
                }
                {
                    //更新数据库
                    IBLL.ISys bll     = new BLL.Sys();
                    int       ser_ver = Conv.ToInt(bll.Read("ser_ver").Split('_')[1]);
                    int       ver     = Conv.ToInt(Appsetting.versions.Split('_')[1]);
                    if (ser_ver < ver)
                    {
                        //需要更新
                        Type         t     = soft_update.GetType();
                        MethodInfo[] infos = t.GetMethods();
                        foreach (MethodInfo info in infos)
                        {
                            if (info.Name.IndexOf("_") > -1)
                            {
                                int time = Conv.ToInt(info.Name.Split('_')[1]);

                                if (time > ser_ver)
                                {
                                    info.Invoke(soft_update, null);
                                }
                            }
                        }
                    }
                    else if (ser_ver > ver)
                    {
                        //需要更新程序
                        Log.writeLog("中间件版本过低,请更新");
                    }
                }
            }
            catch (Exception ex)
            {
                Log.writeLog("更新失败" + Environment.NewLine + ex.ToString());
            }
        }