Beispiel #1
0
        /// <summary>
        /// 检查更新
        /// </summary>
        public void CheckUpdate()
        {
            String Version = "1.1";

            Form1.MainForm.Text = "四川师范大学自动报平安 v" + Version + " by CrazyNut [L.C.G]";
            var serverVersion = NutWeb.Nut_Get("47.103.197.183/software/sicnu/version", null);

            if (serverVersion != null)
            {
                if (Version != serverVersion.Html)
                {
                    NutDebug("\r\n\r\n当前软件版本:" + Version + " 服务器最新版本:" + serverVersion.Html + " \r\n\r\n请到下方链接下载更新\r\n\r\nhttp://47.103.197.183/software/sicnu/川师自动报平安.zip");
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 根据cookie获取最新的账号信息
        /// </summary>
        /// <param name="Cookie"></param>
        /// <returns>完成返回null 没完成返回表单wid参数</returns>
        public static Global.User GetUserInfo(String Cookie)
        {
            try
            {
                var GetUrl    = "http://ehall.sicnu.edu.cn/qljfwapp/sys/lwReportEpidemicUndergraduate/modules/application/getMyTodayReportWid.do";
                var GetResult = NutWeb.Nut_Get(GetUrl, null, Cookie);

                var GetUrl2    = "http://ehall.sicnu.edu.cn/qljfwapp/sys/lwReportEpidemicUndergraduate/modules/application/getLatestDailyReportData.do";
                var GetResult2 = NutWeb.Nut_Get(GetUrl2, null, Cookie);

                var returnUser = new Global.User();
                if (GetResult != null && GetResult2 != null)
                {
                    JObject JsonObj = (JObject)JsonConvert.DeserializeObject(GetResult.Html);
                    var     rows    = JsonObj["datas"]["getMyTodayReportWid"]["rows"].First;

                    JObject JsonObj2 = (JObject)JsonConvert.DeserializeObject(GetResult2.Html);
                    var     rows2    = JsonObj2["datas"]["getLatestDailyReportData"]["rows"].First;

                    if (rows != null && rows2 != null)
                    {
                        returnUser.Cookie         = Cookie;
                        returnUser.TodayTaskState = rows["CHECKED_DISPLAY"].ToString();
                        returnUser.Name           = rows["USER_NAME"].ToString();
                        returnUser.TodayWid       = rows["WID"].ToString();
                        returnUser.GetTodayJb     = rows;
                        returnUser.LatestDailyJb  = rows2;
                        Form1.MainForm.NutDebug("获取成功! 当前用户--->" + returnUser.Name);
                        Form1.MainForm.NutDebug("今日填报状态--->" + returnUser.TodayTaskState);
                        return(returnUser);
                    }
                }
                Form1.MainForm.NutDebug("当前账号Cookie已经失效");
                returnUser.TodayTaskState = "账号失效";
                return(returnUser);
            }
            catch
            {
                Form1.MainForm.NutDebug("当前账号Cookie已经失效");
                var returnUser = new Global.User();
                returnUser.TodayTaskState = "账号失效";
                return(returnUser);
            }
        }