Exemplo n.º 1
0
        public static void ipcam_setup_set(gensysEntities db, device genbox)
        {
            var partIpcam = from ipcam in db.ipcam
                            where (from genbox_cpu in db.genbox_cpu
                                   where genbox_cpu.genbox_uuid == genbox.uuid
                                   select genbox_cpu.ipcam_uuid).Contains(ipcam.uuid)
                            select ipcam;

            //生成json格式参数
            var ipcamJson = partIpcam.ToList().ToJson();

            ipcamJson = "{\"ipcams\":" + ipcamJson + "}";

            //发送给genbox
            string result = "";

            try
            {
                while ((result = HttpPost("http://" + genbox.ip + ":9999/cgi-bin/ipcam_setup_set.cgi", ipcamJson, "application/json")) == "fail<br/>")
                {
                    Thread.Sleep(1000);
                }
            }
            catch (Exception ex)
            {
                //return ex.Message + ex.StackTrace;
            }
        }
Exemplo n.º 2
0
        //[Display(Name = "记住登陆?")]
        //public bool rememberme { get; set; }

        public String Login()
        {
            gensysEntities db         = new gensysEntities();
            var            userResult = db.sys_user.Where(u => u.username == username).ToList();

            if (userResult.Count <= 0)
            {
                return("该用户名不存在!");
            }
            else if (userResult[0].password != password)
            {
                return("密码错误!");
            }
            else
            {
                return("验证通过!");
            }
        }