示例#1
0
        /// <summary>
        /// 获取轮播图片信息
        /// </summary>
        /// <returns></returns>
        private Hashtable CheckVerCode(HttpContext context)
        {
            Hashtable htRet   = new Hashtable();
            Hashtable rowData = new Hashtable();

            try
            {
                DBIndex dbm      = new DBIndex();
                string  sVerCode = CConvert.ToString(context.Request["vercode"]);
                string  sMac     = CConvert.ToString(context.Request["mac"]);

                DataSet ds = dbm.getVercodeInfoByCode(sVerCode);
                if (ds.Tables[0].Rows.Count == 0)
                {
                    htRet["msg"] = "授权码不正确!";
                    htRet["ok"]  = false;
                }
                else
                {
                    DataRow dr = ds.Tables[0].Rows[0];

                    if (CConvert.ToString(dr["mac"]) == "")
                    {
                        if (dbm.UpdateMac(sVerCode, sMac) != 1)
                        {
                            htRet["msg"] = "授权码不正确!";
                            htRet["ok"]  = false;
                            return(htRet);
                        }
                    }
                    else
                    {
                        if (CConvert.ToString(dr["mac"]) != sMac)
                        {
                            htRet["msg"] = "授权码不正确!";
                            htRet["ok"]  = false;
                            return(htRet);
                        }
                    }


                    htRet["ok"] = true;
                }
            }
            catch (Exception ex)
            {
                htRet["ok"]  = false;
                htRet["msg"] = "获取轮播信息失败!" + ex.Message;
            }
            return(htRet);
        }