Esempio n. 1
0
        private void Wchat_Register(HttpContext context)
        {
            string result = "no";

            #region  获取微信登录的信息

            string wcode = String_Manage.Return_Request_Str("wcode");

            if (wcode != "")
            {
                // 获取用户的access_token和openid
                wcode = Get_Http_Url_Content.GetPostContent("https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx2fbe800be068f5ec&secret=592edb2d54ec68eb935b3b731441cbf8&code=" + wcode + "&grant_type=authorization_code");
                Wchat wchat_access_token = JsonHelper.JsonDeserialize <Wchat>(wcode);

                if (!string.IsNullOrEmpty(wchat_access_token.access_token))
                {
                    // 获取用户信息
                    wcode = Get_Http_Url_Content.GetPostContent("https://api.weixin.qq.com/sns/userinfo?access_token=" + wchat_access_token.access_token + "&openid=" + wchat_access_token.openid + "");

                    GetUser_Wchat wchat_userinfo = JsonHelper.JsonDeserialize <GetUser_Wchat>(wcode);

                    if (!string.IsNullOrEmpty(wchat_userinfo.openid))
                    {
                        result = Is_Register_Wchat(wchat_userinfo.nickname, wchat_userinfo.sex, wchat_userinfo.headimgurl, 3, wchat_userinfo.openid);
                    }
                }
            }

            context.Response.Write(result);

            #endregion
        }
Esempio n. 2
0
        public override void Page_Load(ref NVelocity.VelocityContext context)
        {
            base.Page_Load(ref context);

            #region  加载头部及Title
            NewXzc.Web.templatecs.Head head = new Head();
            head.Init_Head(context, 0);

            context.Put("title", "找回密码_女装搭配|衣品搭配");
            #endregion

            int uid = CheckIsLogin_HongRenHui.GetUserID("FINDRED_HREN_USERID");

            if (uid <= 0)
            {
                context.Put("redirecturl", "/findpwd");
            }
            else
            {
                context.Put("codes", String_Manage.Return_Request_Str("code"));

                string tel = new BLL.RED_USER().GetModel(uid).TEL;

                //tel = tel.Substring(0, 3) + "****" + tel.Substring(7, 4);

                context.Put("tel", tel);
            }
        }
        private void Update_User_Pwd(HttpContext context)
        {
            string result = "ok";

            user_model = user_bll.GetModel(UserID_HongRenHui);

            if (user_model != null)
            {
                string pwd = String_Manage.Return_Request_Str("pwd");
                if (pwd == "")
                {
                    result = "nopwd";
                }
                else
                {
                    pwd            = NewXzc.Common.DEncrypt.DESEncrypt.Encrypt(pwd);//给密码加密
                    user_model.PWD = pwd;

                    if (!user_bll.Update(user_model, 2))
                    {
                        result = "no";
                    }
                }
            }
            else
            {
                result = "nologin";
            }

            context.Response.Write(result);
        }
Esempio n. 4
0
        /// <summary>
        /// 验证是否登录成功
        /// </summary>
        /// <param name="context"></param>
        private void Login_States(NVelocity.VelocityContext context)
        {
            int    login_type = String_Manage.Return_Request_Int("logintype", 0);
            string urls       = String_Manage.Return_Request_Str("urls");

            CookieManage_HongRenHui.AddCookie("RED_HREN_Login_Type", login_type.ToString(), 7, false);

            if (urls != "" && urls != "0")
            {
                CookieManage_HongRenHui.AddCookie("RED_HREN_Login_Urls", urls, 7, false);
            }
            else
            {
                CookieManage_HongRenHui.AddCookie("RED_HREN_Login_Urls", CheckIsLogin_HongRenHui.Get_User_CenterUrl_HongRenHui(), 7, false);
            }

            if (CheckIsLogin_HongRenHui.IsLogin("RED_HREN_USERID"))
            {
                if (urls != "")
                {
                    context.Put("redirecturl", urls);
                }
                else
                {
                    context.Put("redirecturl", CheckIsLogin_HongRenHui.Get_User_CenterUrl_HongRenHui());
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 加载首页头部
        /// </summary>
        /// <param name="context"></param>
        public void Init_Head(NVelocity.VelocityContext context)
        {
            //context.Put("title", "网红,网络红人,网红经济,衣品搭配");
            //context.Put("keywords", "网红,网络红人,网红经济,网红直播,网红营销,红人,衣品搭配");
            //context.Put("description", "衣品搭配是中国首家网络红人门户,有丰富的网红资讯是网络红人综合业务报道和网红推广的平台,可以满足广告主的投放诉求和网红的变现诉求实现网红经济化,提供红薯直播平台让主播们的分成更多,还能成就不少网红的明星梦。");

            context.Put("title", "穿衣搭配网|女装搭配|服装搭配|衣服搭配-衣品搭配网");
            context.Put("keywords", "女装,穿衣搭配,服装搭配,服饰搭配,韩国服饰,穿衣搭配网");
            context.Put("description", "衣品搭配网是最专业最权威的服装搭配网站。除了展示各类女装及配饰还有最专业最潮流的穿衣搭配指南,让时尚变的触手可及!");


            ////加载头部导航
            //context.Put("nav_list", Get_Top_Nav(context));

            //获取微信登录信息
            string wcode = String_Manage.Return_Request_Str("code");

            if (wcode != "")
            {
                context.Put("redirecturl", "/userlogin/wechat_return_url.aspx?code=" + wcode);
            }

            //Save_Img_Http.Save_Img_WebRequest("http://wx.qlogo.cn/mmopen/Q3auHgzwzM6Gv0vqjANHBUX7npN7tQGicuXxIkelKa3ibP8P5EBOPcb9yqougxLicZqcL9bwmo9M56QM8ibDPgXHia7M7kKEt7CNKK4PAPjNHiaxw/0", "jpg", 0);

            //string pwd = NewXzc.Common.DEncrypt.DESEncrypt.Encrypt("608");//给密码加密
        }
        private void ValidatePhone(HttpContext context)
        {
            string tel = String_Manage.Return_Request_Str("tel");

            string result = ValidatePhone_Function(context, tel);

            context.Response.Write(result);
        }
        private void Update_User_Info(HttpContext context)
        {
            string result = "ok";

            if (UserID_HongRenHui <= 0)
            {
                result = "nologin";
            }
            else
            {
                string user_head = String_Manage.Return_Request_Str("user_logo");
                string uname     = String_Manage.Return_Request_Str("uname");

                if (user_head == "")
                {
                    result = "nohead";
                }
                else if (uname == "")
                {
                    result = "noname";
                }
                else
                {
                    if (user_bll.GetRecordCount(" USERNAME='******' and tel<>'" + user_bll.GetModel(UserID_HongRenHui).TEL + "' ") <= 0)
                    {
                        user_model = user_bll.GetModel(UserID_HongRenHui);
                        if (user_model != null)
                        {
                            user_model.USER_HEAD = user_head;
                            user_model.USERNAME  = uname;

                            user_bll.Update(user_model, 1);
                        }
                        else
                        {
                            result = "nouser";
                        }
                    }
                    else
                    {
                        result = "repname";
                    }
                }
            }
            context.Response.Write(result);
        }
        /// <summary>
        /// 获取指定文件夹下的所有文件
        /// </summary>
        /// <param name="ftype"></param>
        private void Get_Folder_Files(int ftype, NVelocity.VelocityContext context)
        {
            try
            {
                string path = String_Manage.Return_Request_Str("furl");


                //context.Put("fl", path);

                DirectoryInfo di = new DirectoryInfo(path);
                //找到该目录下的文件
                FileInfo[] fis = di.GetFiles();
                foreach (FileInfo fi in fis)
                {
                    //文件名称
                    string filename = fi.Name;
                    //文件物理路径
                    string file_path = fi.FullName;
                    //文件扩展名
                    string file_desc = fi.Extension;

                    if (file_desc == ".txt")
                    {
                        StreamReader sr          = new StreamReader(file_path, System.Text.Encoding.Default);
                        String       txt_content = sr.ReadToEnd();

                        txt_content = txt_content.Replace("\r\n", "¤");
                        txt_content = txt_content.Replace("\n", "");

                        string[] txtarr = txt_content.Split('¤');

                        // 添加标题(关键词)和内容到数据库
                        Add_Title_Content_Keywords(ftype, txtarr);

                        sr.Close();
                    }
                }

                context.Put("r", "执行完成");
            }
            catch (Exception ex)
            {
                context.Put("r", ex.ToString());
            }
        }
Esempio n. 9
0
        private void Update_User_Pwd(HttpContext context)
        {
            string result = "ok";

            int uid = CheckIsLogin_HongRenHui.GetUserID("FINDRED_HREN_USERID");

            string phone = "";

            user_model = user_bll.GetModel(uid);

            if (user_model != null)
            {
                if (CookieManage_HongRenHui.GetCookieValue("FINDTEL_HREN_STATE") != "1")
                {
                    result = "notel";
                }
                else
                {
                    string pwd = String_Manage.Return_Request_Str("pwd");
                    if (pwd == "")
                    {
                        result = "nopwd";
                    }
                    else
                    {
                        pwd            = NewXzc.Common.DEncrypt.DESEncrypt.Encrypt(pwd);//给密码加密
                        user_model.PWD = pwd;

                        if (!user_bll.Update(user_model, 2))
                        {
                            result = "no";
                        }
                    }
                }
            }
            else
            {
                result = "nologin";
            }

            context.Response.Write(result);
        }
Esempio n. 10
0
        public override void Page_Load(ref NVelocity.VelocityContext context)
        {
            base.Page_Load(ref context);


            #region  加载头部及Title
            NewXzc.Web.templatecs.Head head = new Head();
            head.Init_Head(context, 0);

            context.Put("title", "微信登录");
            context.Put("keywords", "红人,衣品搭配,红人网,网络红人,微博红人,爱拍红人,红人服装,网络红人排行榜");
            context.Put("description", "衣品搭配,专注发掘不一样的红人神咖.衣品搭配是红人,衣品搭配,红人网,网络红人,微博红人,爱拍红人,红人服装,网络红人排行榜等综合红人报道平台.衣品搭配网络红人聚集平台,跟踪报道红人资讯,最新红人作品等等,第一时间满足粉丝需求.");
            #endregion


            //string appid = "wx2fbe800be068f5ec";// NewXzc.Common.ConfigHelper.GetConfigString("weixin_appid");
            //string appsecret = "592edb2d54ec68eb935b3b731441cbf8";// NewXzc.Common.ConfigHelper.GetConfigString("weixin_AppSecret");
            //string recall_url = HttpContext.Current.Request.Url.ToString().ToLower();

            //string cur_host = HttpContext.Current.Request.Url.Host;
            //recall_url = "http://m.ypindapei.com/userlogin/wechat_return_url.aspx";

            //recall_url = HttpContext.Current.Server.UrlEncode(recall_url);

            //string return_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appid + "&redirect_uri=" + recall_url + "&response_type=code&scope=snsapi_login&state=1#wechat_redirect";

            ////context.Put("redirecturl",return_url);

            //http://www.ypindapei.com/wechat?appid=wx2fbe800be068f5ec&scope=snsapi_login&state=1&redirect_uri=http%3a%2f%2fm.ypindapei.com%2fuserlogin%2fwechat_return_url.aspx&code=001HvRos1i2eer08Tjms1mB6ps1HvRod

            string returl_url  = String_Manage.Return_Request_Str("redirect_uri").ToLower();
            string returl_code = String_Manage.Return_Request_Str("code");

            if (returl_url.Contains("m.ypindapei.com"))
            {
                if (returl_code != "")
                {
                    context.Put("redirecturl", returl_url + "?code=" + returl_code);
                }
            }
        }
Esempio n. 11
0
        private void Wchat_Register(NVelocity.VelocityContext context)
        {
            string result = "no";

            #region  获取微信登录的信息

            string wcode = String_Manage.Return_Request_Str("code");

            if (wcode != "")
            {
                // 获取用户的access_token和openid
                wcode = Get_Http_Url_Content.GetPostContent("https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx2fbe800be068f5ec&secret=592edb2d54ec68eb935b3b731441cbf8&code=" + wcode + "&grant_type=authorization_code");
                NewXzc.Web.templatecs.Handle.ThirdRegisterHandle.Wchat wchat_access_token = JsonHelper.JsonDeserialize <NewXzc.Web.templatecs.Handle.ThirdRegisterHandle.Wchat>(wcode);

                if (!string.IsNullOrEmpty(wchat_access_token.access_token))
                {
                    // 获取用户信息
                    wcode = Get_Http_Url_Content.GetPostContent("https://api.weixin.qq.com/sns/userinfo?access_token=" + wchat_access_token.access_token + "&openid=" + wchat_access_token.openid + "");

                    NewXzc.Web.templatecs.Handle.ThirdRegisterHandle.GetUser_Wchat wchat_userinfo = JsonHelper.JsonDeserialize <NewXzc.Web.templatecs.Handle.ThirdRegisterHandle.GetUser_Wchat>(wcode);

                    if (!string.IsNullOrEmpty(wchat_userinfo.openid))
                    {
                        result = Is_Register_Wchat(wchat_userinfo.nickname, wchat_userinfo.sex, wchat_userinfo.headimgurl, 3, wchat_userinfo.openid);
                    }
                }
            }

            context.Put("resultss", result);

            if (result.Contains("people"))
            {
                context.Put("redirecturl", "http://www.ypindapei.com");
            }

            #endregion
        }
        private void SendPhoneVerifyCode(HttpContext context)
        {
            string phone = String_Manage.Return_Request_Str("Phone");

            //前台生成的验证码,用于点击发送验证码前验证用
            string send_code_yzm = String_Manage.Return_Request_Str("send_code_yzm");

            if (send_code_yzm != "")
            {
                try
                {
                    if (HttpContext.Current.Session["code"] != null)
                    {
                        if (!string.IsNullOrEmpty(HttpContext.Current.Session["code"].ToString()))
                        {
                            string str_yzm = HttpContext.Current.Session["code"].ToString();
                            if (send_code_yzm != str_yzm)
                            {
                                context.Response.Write("error_yzm");
                            }
                            else
                            {
                                if (phone != "")
                                {
                                    Random rd   = new Random();
                                    string code = rd.Next(100000, 999999).ToString();

                                    try
                                    {
                                        if (HttpContext.Current.Session["PhoneVerifyCode"] == null)
                                        {
                                            HttpContext.Current.Session["PhoneVerifyCode"] = code + "-" + phone;
                                        }
                                        else
                                        {
                                            if (string.IsNullOrEmpty(HttpContext.Current.Session["PhoneVerifyCode"].ToString()))
                                            {
                                                HttpContext.Current.Session["PhoneVerifyCode"] = code + "-" + phone;
                                            }
                                            else
                                            {
                                                string strSess = HttpContext.Current.Session["PhoneVerifyCode"].ToString();
                                                HttpContext.Current.Session["PhoneVerifyCode"] = strSess + "," + code + "-" + phone;
                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        HttpContext.Current.Session["PhoneVerifyCode"] = code + "-" + phone;
                                    }
                                    finally
                                    {
                                        //判断当前用户是否已经绑定过手机
                                        var istel = ValidatePhone_Function(context, phone);
                                        if (istel != "ok")
                                        {
                                            context.Response.Write(istel);
                                        }
                                        else
                                        {
                                            #region  发送短信
                                            string shortMessageWord = "衣品搭配注册验证码:" + code + ",欢迎加入衣品搭配。";
                                            string result           = Send_Short_Message.Send_Message_Short(shortMessageWord, phone);
                                            //string result = "ok";
                                            //result = result + code;

                                            context.Response.Write(result);
                                            #endregion
                                        }
                                    }
                                }
                                else
                                {
                                    context.Response.Write("notel");
                                }
                            }
                        }
                        else
                        {
                            context.Response.Write("noyzm");
                        }
                    }
                    else
                    {
                        context.Response.Write("noyzm");
                    }
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                context.Response.Write("noyzm");
            }
        }
        private void Is_Register(HttpContext context)
        {
            string result = "ok";

            string tel   = String_Manage.Return_Request_Str("tel");
            string pwd   = String_Manage.Return_Request_Str("upwd");
            string uname = String_Manage.Return_Request_Str("uname");



            var istel = ValidatePhone_Function(context, tel);

            if (istel != "ok")
            {
                result = istel;
            }
            else
            {
                if (pwd == "")
                {
                    result = "nopwd";
                }
                else if (uname == "")
                {
                    result = "nouser";
                }
                else
                {
                    pwd = NewXzc.Common.DEncrypt.DESEncrypt.Encrypt(pwd);//给密码加密

                    int userguid = user_bll.GetMaxId();

                    //user_model.USERID = user_bll.GetMaxId();
                    //user_model.TEL = tel;
                    //user_model.TEL_STATE = 1;
                    //user_model.USER_HEAD = "default.jpg";
                    //user_model.PWD = pwd;
                    //user_model.NICKNAME = uname;
                    //user_model.IP = RequestHelper.GetIP();
                    //user_model.ADDTIME = DateTime.Now;
                    //user_model.REMARK = "";

                    string empty = "";
                    int    cnt_0 = 0;
                    int    cnt_1 = 1;
                    int    utype = 1;

                    user_model.USERID               = userguid;
                    user_model.USERNAME             = uname;
                    user_model.PWD                  = pwd;
                    user_model.TEL                  = tel;
                    user_model.TEL_STATE            = cnt_1;
                    user_model.USER_HEAD            = "default.jpg";
                    user_model.SEX                  = cnt_1;
                    user_model.EMAIL                = empty;
                    user_model.USER_TYPE            = utype;
                    user_model.ISCOMPLETE           = cnt_0;
                    user_model.PROVINCE             = empty;
                    user_model.CITY                 = empty;
                    user_model.AREA                 = empty;
                    user_model.PEOPLE_IDENTITY      = empty;
                    user_model.OCCUPATION           = empty;
                    user_model.PERSONALITY          = empty;
                    user_model.INTRODUCE            = empty;
                    user_model.IDENTIFICATION_STATE = cnt_0;
                    user_model.SAME_HOBBY_PEOPLE    = empty;
                    user_model.EXP                  = cnt_0;
                    user_model.SCORE                = cnt_0;
                    user_model.REALM_NAME           = empty;
                    user_model.ADDTIME              = DateTime.Now;
                    user_model.IS_RED               = cnt_0;
                    user_model.STATE                = cnt_0;
                    user_model.REMARK               = empty;
                    user_model.Person_Desc          = empty;
                    user_model.Person_NickName      = empty;
                    user_model.Porder               = cnt_0;
                    user_model.UpdateTime           = DateTime.Now;
                    user_model.PLAT_VAL             = empty;
                    user_model.SPECIALTY_VAL        = empty;
                    user_model.IPURL                = empty;


                    if (user_bll.GetRecordCount(" USERNAME='******' and userid<>" + userguid + " ") <= 0)
                    {
                        if (!user_bll.Add(user_model))
                        {
                            result = "no";
                        }
                        else
                        {
                            CookieManage_HongRenHui.AddCookie("RED_HREN_USERID", userguid.ToString(), 1, false);
                        }
                    }
                    else
                    {
                        result = "repname";
                    }
                }
            }

            context.Response.Write(result);
        }
        private void VerifyCodeIsExists(HttpContext context)
        {
            string phone = String_Manage.Return_Request_Str("Phone");

            if (phone != "")
            {
                try
                {
                    string verifycode = context.Request["Vc"];

                    string phone2 = "", verifycode2 = "";

                    string[] items = null;

                    if (HttpContext.Current.Session["PhoneVerifyCode"] != null)
                    {
                        string PhoneVerifyCode = "";
                        PhoneVerifyCode = HttpContext.Current.Session["PhoneVerifyCode"].ToString();

                        if (PhoneVerifyCode.IndexOf(',') != -1)//有多个手机号和验证码,因为短信有可能延迟用户就会收到多个验证码,应该保证每个验证码是正确的。
                        {
                            items = PhoneVerifyCode.Split(',');
                        }
                        else
                        {
                            items    = new string[1];
                            items[0] = PhoneVerifyCode;
                        }
                    }

                    bool isOk = false;

                    for (int i = 0; i < items.Length; i++)
                    {
                        if (!string.IsNullOrEmpty(items[i]))
                        {
                            phone2      = items[i].Split('-')[1];
                            verifycode2 = items[i].Split('-')[0];

                            if (phone == phone2 && verifycode == verifycode2)
                            {
                                isOk = true;
                                break;
                            }
                        }
                    }

                    if (isOk)
                    {
                        //判断当前用户是否已经绑定过手机
                        var istel = ValidatePhone_Function(context, phone);
                        if (istel != "ok")
                        {
                            context.Response.Write(istel);
                            return;
                        }

                        context.Response.Write("1");
                    }
                    else
                    {
                        context.Response.Write("0");
                    }
                }
                catch (Exception ex)
                {
                    context.Response.Write("0");
                }
            }
            else
            {
                context.Response.Write("notel");
            }
            context.Response.End();
        }
Esempio n. 15
0
        public override void Page_Load(ref NVelocity.VelocityContext context)
        {
            base.Page_Load(ref context);

            #region  加载头部及Title

            string title_val    = "";
            string keywords_val = title_val;


            #endregion


            #region  热点

            //context.Put("hotarticle", ArticleHelper.Get_Hot_Articel());

            #endregion

            try
            {
                season_require_id = DbHelperSQL.GetSingle("select top 1 season_id from HRENH_SET_ARTICLE_SHOW_SEASON order by id desc").ToString();
            }
            catch (Exception ex)
            {
            }

            season_require_id_linshi = "," + season_require_id + ",";


            //子级
            srname = String_Manage.Return_Request_Str("srname");

            if (srname != "")
            {
                stype = ArticleHelper.Get_Dianpu_Type_Id(srname, 1);
            }

            typeurl = "/zhuanti/" + srname + "";

            context.Put("typepurl", typeurl);
            context.Put("srname", srname);


            head.Init_Head(context, type);

            #region  加载二级和三级

            if (stype > 0)
            {
                typename = ArticleHelper.Get_Type_Name(stype, type_parent);
            }

            if (typename != "")
            {
                title_val = typename.Substring(0, typename.IndexOf(","));
                typename  = title_val;
            }

            context.Put("title", title_val + "-衣品搭配网|" + typename + "衣服搭配");

            #region  获取keywords和description
            try
            {
                int type_linshi = type;

                if (stype > 0)
                {
                    type_linshi = stype;
                }

                DataSet kdds = DbHelperSQL.Query("select keywords,description,pid from hrenh_article_type where id=" + type_linshi + "");
                if (kdds != null && kdds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow kddr in kdds.Tables[0].Rows)
                    {
                        keywords_val = kddr["keywords"].ToString();
                        string description_val = kddr["description"].ToString();
                        int    spid            = Convert.ToInt32(kddr["pid"].ToString());

                        if (keywords_val != "")
                        {
                            title_val = keywords_val;
                        }

                        //if (description_val != "")
                        //{
                        //description = description_val;
                        //}

                        //上衣、裤装、裙装
                        if (spid >= 371 && spid <= 373)
                        {
                            description = "" + typename + "是每个女生衣橱里必备的服装单品。不论有多少款式的" + typename + "找到适合自己的款就能穿出属于自己的风格,适合自己的才能完美遮住自身缺点,这才是成功的" + typename + "搭配技巧。";
                        }
                        else if (spid == 403)//气质风格
                        {
                            description = "" + typename + "是目前时尚界较为流行的服装风格,受到很多漂亮MM的喜爱。根据自己的身高、体型、肤色等外在特点才能找到自己的穿衣风格,轻松变身时尚大咖。";
                        }
                        else if (spid == 404)//特定人群
                        {
                            description = "好的搭配能遮掉自身的很多缺点,适合自己的服装才能扬长避短,比如穿什么样的衣服能" + typename + ",一旦掌握了能" + typename + "的穿衣秘诀,无论是谁都能穿出明星范。";
                        }
                        else if (spid == 405)//潮流元素
                        {
                            description = "服装上的潮流元素每年都会不尽相同。例如" + typename + "原本是非常普遍的元素,也许哪年就会成为时下最流行的潮流元素,只有紧跟潮流元素的步伐才会离时尚越来越近。";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            #endregion

            if (title_val != "")
            {
                context.Put("title", title_val.Replace(",", ",").Replace(",", "|") + "-衣品搭配网|" + typename + "衣服搭配");
            }

            context.Put("keywords", keywords_val);
            context.Put("keywords_cname", keywords_val);

            context.Put("description", description);


            #endregion

            // 获取当前类型的封面图和描述
            Get_Type_Show_Dest(context);

            // 加载文章列表
            GetList(context);
        }
Esempio n. 16
0
        private void SendPhoneVerifyCode(HttpContext context)
        {
            int uid = CheckIsLogin_HongRenHui.GetUserID("FINDRED_HREN_USERID");

            string phone = "";

            user_model = user_bll.GetModel(uid);

            if (user_model != null)
            {
                phone = user_model.TEL;
            }

            if (phone != "")
            {
                Random rd   = new Random();
                string code = rd.Next(100000, 999999).ToString();



                //前台生成的验证码,用于点击发送验证码前验证用
                string send_code_yzm = String_Manage.Return_Request_Str("send_code_yzm");

                if (send_code_yzm != "")
                {
                    try
                    {
                        if (HttpContext.Current.Session["code"] != null)
                        {
                            if (!string.IsNullOrEmpty(HttpContext.Current.Session["code"].ToString()))
                            {
                                string str_yzm = HttpContext.Current.Session["code"].ToString();
                                if (send_code_yzm != str_yzm)
                                {
                                    context.Response.Write("error_yzm");
                                }
                                else
                                {
                                    try
                                    {
                                        if (HttpContext.Current.Session["PhoneVerifyCode"] == null)
                                        {
                                            HttpContext.Current.Session["PhoneVerifyCode"] = code + "-" + phone;
                                        }
                                        else
                                        {
                                            if (string.IsNullOrEmpty(HttpContext.Current.Session["PhoneVerifyCode"].ToString()))
                                            {
                                                HttpContext.Current.Session["PhoneVerifyCode"] = code + "-" + phone;
                                            }
                                            else
                                            {
                                                string strSess = HttpContext.Current.Session["PhoneVerifyCode"].ToString();
                                                HttpContext.Current.Session["PhoneVerifyCode"] = strSess + "," + code + "-" + phone;
                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        HttpContext.Current.Session["PhoneVerifyCode"] = code + "-" + phone;
                                    }
                                    finally
                                    {
                                        //判断当前用户是否已经绑定过手机
                                        #region  发送短信
                                        string shortMessageWord = "衣品搭配密码找回验证码:" + code + ",牢记密码,小主记得常来哦。";
                                        string result           = Send_Short_Message.Send_Message_Short(shortMessageWord, phone);
                                        //string result = "ok";
                                        //result = result + code;

                                        context.Response.Write(result);
                                        #endregion
                                    }
                                }
                            }
                            else
                            {
                                context.Response.Write("noyzm");
                            }
                        }
                        else
                        {
                            context.Response.Write("noyzm");
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
                else
                {
                    context.Response.Write("noyzm");
                }
            }
            else
            {
                context.Response.Write("nologin");
            }
        }
Esempio n. 17
0
        private void Is_Login(HttpContext context)
        {
            string result = "ok";

            string tel = String_Manage.Return_Request_Str("tel");
            string pwd = String_Manage.Return_Request_Str("upwd");

            pwd = NewXzc.Common.DEncrypt.DESEncrypt.Encrypt(pwd);//给密码加密

            int remmber = String_Manage.Return_Request_Int("remmber", 0);

            var istel = ValidatePhone_Function(context, tel);

            if (istel != "ok")
            {
                result = istel;
            }
            else
            {
                //前台生成的验证码,用于点击发送验证码前验证用
                string send_code_yzm = String_Manage.Return_Request_Str("send_code_yzm");

                if (send_code_yzm != "")
                {
                    try
                    {
                        if (HttpContext.Current.Session["code"] != null)
                        {
                            if (!string.IsNullOrEmpty(HttpContext.Current.Session["code"].ToString()))
                            {
                                string str_yzm = HttpContext.Current.Session["code"].ToString();
                                if (send_code_yzm != str_yzm)
                                {
                                    result = "error_yzm";
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }

                if (result == "ok")
                {
                    string sql = "select top 1 userid from THINK_SNS_DB.dbo.HRENH_THINK_USER where tel=@tel and pwd=@pwd order by userid asc";

                    SqlParameter[] para =
                    {
                        new SqlParameter("@tel", SqlDbType.NVarChar, 50),
                        new SqlParameter("@pwd", SqlDbType.NVarChar, 50)
                    };
                    para[0].Value = tel;
                    para[1].Value = pwd;

                    int t = 0;
                    try
                    {
                        t = Convert.ToInt32(DbHelperSQL.GetSingle(sql, para).ToString());
                    }
                    catch (Exception ex)
                    {
                    }

                    if (t <= 0)
                    {
                        result = "no";
                    }
                    else
                    {
                        result = CheckIsLogin_HongRenHui.Get_User_CenterUrl_HongRenHui();

                        if (remmber == 0)
                        {
                            CookieManage_HongRenHui.AddCookie("RED_HREN_USERID", t.ToString(), 1, false);
                        }
                        else
                        {
                            CookieManage_HongRenHui.AddCookie("RED_HREN_USERID", t.ToString(), 7, false);
                        }
                    }
                }
            }


            context.Response.Write(result);
        }
Esempio n. 18
0
        private void Is_Register(HttpContext context)
        {
            string result = "ok";

            string tel       = "123456";
            string pwd       = "123456";
            string uname     = String_Manage.Return_Request_Str("uname");
            string sex_val   = String_Manage.Return_Request_Str("sex_val");
            int    sex       = 1;
            string user_head = String_Manage.Return_Request_Str("uhead");

            //登录途径,0:红人汇PC端,1:红人汇wap端,2:微吧PC端,3:微吧wap端
            int login_type = Convert.ToInt32(CookieManage_HongRenHui.GetCookieValue("RED_HREN_Login_Type"));
            //第三方登录类型,0:默认,1:QQ,2:Sina,3:微信
            int third_logintype = String_Manage.Return_Request_Int("third_logintype", 0);
            //第三方登录账号的唯一标识ID
            string third_uopenid = String_Manage.Return_Request_Str("third_uopenid");

            pwd = NewXzc.Common.DEncrypt.DESEncrypt.Encrypt(pwd);//给密码加密

            if (sex_val == "1" || sex_val == "man" || sex_val == "男")
            {
                sex = 1;
            }
            else
            {
                sex = 2;
            }

            //int third_old_logintype = Convert.ToInt32(CookieManage_HongRenHui.GetCookieValue("RED_HREN_Third_Login"));


            if (user_bll.GetRecordCount(" third_openid='" + third_uopenid + "' ") <= 0)
            {
                if (third_uopenid != "")// && uname != "qzuser"  未授权(uname == "qzuser")
                {
                    //string[] uhead = user_head.Split(';');

                    //if (third_logintype == 1)
                    //{
                    //    //大头像
                    //    user_head = Save_Img_Http.Save_Img_WebRequest(uhead[0].ToString(), "jpg", 1);
                    //    ////小头像
                    //    //Save_Img_Http.Save_Img_WebRequest(uhead[1].ToString(), "jpg", 3);
                    //}
                    //else
                    //{
                    //    //大头像
                    //    user_head = Save_Img_Http.Save_Img_WebRequest(user_head, "jpg", 1);
                    //}

                    //大头像
                    user_head = Save_Img_Http.Save_Img_WebRequest(user_head, "jpg", 1);

                    user_head = user_head.Replace("large_", "").Replace(ImgHelper.GetCofigShowUrl(), "");

                    int userguid = user_bll.GetMaxId();

                    string empty = "";
                    int    cnt_0 = 0;
                    int    utype = login_type + 1;//用户注册途径,0:红人议会,1:红人汇,2:红人汇手机端,3:微吧,4:微吧手机端,5:红人爱品

                    user_model.USERID               = userguid;
                    user_model.USERNAME             = uname;
                    user_model.PWD                  = pwd;
                    user_model.TEL                  = tel;
                    user_model.TEL_STATE            = cnt_0;
                    user_model.USER_HEAD            = user_head;
                    user_model.SEX                  = sex;
                    user_model.EMAIL                = empty;
                    user_model.USER_TYPE            = utype;
                    user_model.ISCOMPLETE           = cnt_0;
                    user_model.PROVINCE             = empty;
                    user_model.CITY                 = empty;
                    user_model.AREA                 = empty;
                    user_model.PEOPLE_IDENTITY      = empty;
                    user_model.OCCUPATION           = empty;
                    user_model.PERSONALITY          = empty;
                    user_model.INTRODUCE            = empty;
                    user_model.IDENTIFICATION_STATE = cnt_0;
                    user_model.SAME_HOBBY_PEOPLE    = empty;
                    user_model.EXP                  = cnt_0;
                    user_model.SCORE                = cnt_0;
                    user_model.REALM_NAME           = empty;
                    user_model.ADDTIME              = DateTime.Now;
                    user_model.IS_RED               = cnt_0;
                    user_model.STATE                = cnt_0;
                    user_model.REMARK               = empty;
                    user_model.Person_Desc          = empty;
                    user_model.Person_NickName      = empty;
                    user_model.Porder               = cnt_0;
                    user_model.UpdateTime           = DateTime.Now;
                    user_model.PLAT_VAL             = empty;
                    user_model.SPECIALTY_VAL        = empty;
                    user_model.IPURL                = empty;



                    if (!user_bll.Add(user_model))
                    {
                        result = "no";
                    }
                    else
                    {
                        try
                        {
                            DbHelperSQL.ExecuteSql("update THINK_SNS_DB.dbo.hrenh_think_user set third_utype=" + third_logintype + ",third_openid='" + third_uopenid + "' where userid=" + userguid + " ");
                        }
                        catch (Exception ex)
                        {
                        }
                        CookieManage_HongRenHui.AddCookie("RED_HREN_USERID", userguid.ToString(), 7, false);
                        CookieManage_HongRenHui.AddCookie("RED_HREN_Third_Login", third_logintype.ToString(), 7, false);
                    }
                }
                else
                {
                    result = "noautho";
                }
            }
            else
            {
                CookieManage_HongRenHui.AddCookie("RED_HREN_USERID", DbHelperSQL.GetSingle("select top 1 userid from THINK_SNS_DB.dbo.hrenh_think_user where third_openid='" + third_uopenid + "' ").ToString(), 7, false);
                CookieManage_HongRenHui.AddCookie("RED_HREN_Third_Login", third_logintype.ToString(), 7, false);
            }

            if (result == "ok")
            {
                ////登录途径,0:红人汇PC端,1:红人汇wap端,2:微吧PC端,3:微吧wap端
                //switch (login_type)
                //{
                //    case 0:
                //        result = "http://www.ypindapei.com";
                //        break;
                //    case 1:
                //        result = "http://m.ypindapei.com";
                //        break;
                //    case 2:
                //        result = "http://weiba.ypindapei.com";
                //        break;
                //    case 3:
                //        result = "http://w.ypindapei.com";
                //        break;
                //    default:
                //        result = "http://www.ypindapei.com";
                //        break;
                //}
                //result = "/UserLogin/Login_Third.aspx";

                string urls = CookieManage_HongRenHui.GetCookieValue("RED_HREN_Login_Urls");

                if (urls != "" && urls != "0")
                {
                    result = urls;
                }
                else
                {
                    result = CheckIsLogin_HongRenHui.Get_User_CenterUrl_HongRenHui();
                }


                //登录微吧
                //Get_Http_Url_Content.GetPostContent("http://weiba.ypindapei.com/login?uid=" + NewXzc.Common.DEncrypt.DESEncrypt.Encrypt(CookieManage_HongRenHui.GetCookieValue("RED_HREN_USERID")));
            }

            context.Response.Write(result);
        }
Esempio n. 19
0
        public override void Page_Load(ref NVelocity.VelocityContext context)
        {
            base.Page_Load(ref context);

            #region  加载头部及Title

            string title_val    = "";
            string keywords_val = title_val;


            #endregion


            #region  热点

            //context.Put("hotarticle", ArticleHelper.Get_Hot_Articel());

            #endregion

            try
            {
                season_require_id = DbHelperSQL.GetSingle("select top 1 season_id from HRENH_SET_ARTICLE_SHOW_SEASON order by id desc").ToString();
            }
            catch (Exception ex)
            {
            }

            season_require_id_linshi = "," + season_require_id + ",";


            //当type_mark不为空时,用于作为当前子级的重写地址
            string linshi_srname = "";

            type = String_Manage.Return_Request_Int("type", 0);

            //父级
            prname = String_Manage.Return_Request_Str("prname");

            linshi_srname = prname;

            //子级
            srname = String_Manage.Return_Request_Str("srname");

            if (type == 370)
            {
                prname = "dapei";
            }

            if (prname == "")
            {
                context.Put("redirecturl", "/404");
            }
            else
            {
                if (type < 1)
                {
                    type = ArticleHelper.Get_Dianpu_Type_Id(prname, 0);
                }

                //通过汉字获取该汉字的首字母
                if (type < 370)
                {
                    type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(type_bll.GetModel(type).TypeName);
                }

                prname = ArticleHelper.Get_Type_Rname(type);

                if (type == 370)
                {
                    linshi_srname = prname;
                }

                if (srname != "")
                {
                    //typeurl = "/"+prname+"/"+srname+"/";
                    typeurl = "/" + prname + "/" + srname + ".html";
                    stype   = ArticleHelper.Get_Dianpu_Type_Id(srname, 1);
                }
                else
                {
                    if (linshi_srname != "")
                    {
                        if (prname != linshi_srname)
                        {
                            stype = ArticleHelper.Get_Dianpu_Type_Id(linshi_srname, 1);
                        }
                    }
                    //typeurl = "/" + prname + type_shouzimu + "/";
                    typeurl = "/" + linshi_srname + type_shouzimu + "/";
                }
            }

            context.Put("typepurl", typeurl);


            head.Init_Head(context, type);

            #region  加载二级和三级

            if (stype > 0)
            {
                typename = ArticleHelper.Get_Type_Name(stype, type_parent);
                typename = typename.Replace(",", "_");
            }
            else
            {
                typename = ArticleHelper.Get_Type_Name(type);
            }

            title_val = typename + "";

            if (type == 370)
            {
                title_val = "服装搭配|穿衣搭配|女装|红人汇穿衣搭配网";
            }

            context.Put("title", title_val);

            #region  获取keywords和description
            try
            {
                int type_linshi = type;

                if (stype > 0)
                {
                    type_linshi = stype;
                }

                DataSet kdds = DbHelperSQL.Query("select keywords,description from hrenh_article_type where id=" + type_linshi + "");
                if (kdds != null && kdds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow kddr in kdds.Tables[0].Rows)
                    {
                        keywords_val = kddr["keywords"].ToString();
                        string description_val = kddr["description"].ToString();

                        if (keywords_val != "")
                        {
                            title_val = keywords_val;
                        }

                        if (description_val != "")
                        {
                            description = description_val;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            #endregion

            if (type == 370)
            {
                context.Put("keywords", "女装,穿衣搭配,服装搭配,搭配技巧,服饰搭配,韩国服饰,穿衣搭配网");
                context.Put("keywords_cname", "搭配");

                context.Put("description", "红人汇穿衣搭配网是最专业的服装搭配网站。除了展示各类女装及配饰还有最专业最潮流的穿衣搭配指南,让时尚变的触手可及!");
            }
            else
            {
                context.Put("keywords", title_val.Replace("_", ",").Replace("|", ","));
                context.Put("keywords_cname", keywords_val.Replace("红人", ""));

                context.Put("description", description);
            }

            if (type < 370)
            {
                Get_Second_Third(context);
            }

            #endregion

            // 加载文章列表
            GetList(context);
        }
Esempio n. 20
0
        public override void Page_Load(ref NVelocity.VelocityContext context)
        {
            base.Page_Load(ref context);

            #region  加载头部及Title

            string title_val    = "";
            string keywords_val = title_val;


            #endregion


            #region  热点

            //context.Put("hotarticle", ArticleHelper.Get_Hot_Articel());

            #endregion

            try
            {
                season_require_id = DbHelperSQL.GetSingle("select top 1 season_id from HRENH_SET_ARTICLE_SHOW_SEASON order by id desc").ToString();
            }
            catch (Exception ex)
            {
            }

            season_require_id_linshi = "," + season_require_id + ",";


            //当type_mark不为空时,用于作为当前子级的重写地址
            string linshi_srname = "";

            type = String_Manage.Return_Request_Int("type", 0);

            //父级
            prname = String_Manage.Return_Request_Str("prname");

            linshi_srname = prname;

            //子级
            srname = String_Manage.Return_Request_Str("srname");

            if (type == 406)
            {
                prname = "zhuanti/hanxi";
            }
            else if (type == 407)
            {
                prname = "zhuanti/rixi";
            }
            else if (type == 408)
            {
                prname = "zhuanti/oumeiz";
            }
            else if (type == 417)
            {
                prname = "zhuanti/agez";
            }

            //if (prname == "")
            //{
            //    context.Put("redirecturl", "/404");
            //}
            //else
            //{

            //    if (type < 1)
            //    {
            //        type = ArticleHelper.Get_Dianpu_Type_Id(prname, 0);
            //    }

            //    //通过汉字获取该汉字的首字母
            //    if (type < 406)
            //    {
            //        type_shouzimu = Get_Hanzi_Shouzimu.GetSpellCode(type_bll.GetModel(type).TypeName);
            //    }

            //    prname = ArticleHelper.Get_Type_Rname(type);

            //    if (type==406 || type==407 || type==408)
            //    {
            //        linshi_srname = prname;
            //    }

            //    if (srname != "")
            //    {
            //        //typeurl = "/"+prname+"/"+srname+"/";
            //        typeurl = "/" + prname + "/" + srname + ".html";
            //        stype = ArticleHelper.Get_Dianpu_Type_Id(srname, 1);
            //    }
            //    else
            //    {
            //        if (linshi_srname != "")
            //        {
            //            if (prname != linshi_srname)
            //            {
            //                stype = ArticleHelper.Get_Dianpu_Type_Id(linshi_srname, 1);
            //            }
            //        }
            //        //typeurl = "/" + prname + type_shouzimu + "/";
            //        typeurl = "/" + linshi_srname + type_shouzimu + "/";
            //    }
            //}

            typeurl = "/" + prname;

            context.Put("typepurl", typeurl);


            head.Init_Head(context, type);

            #region  加载二级和三级

            if (stype > 0)
            {
                typename = ArticleHelper.Get_Type_Name(stype, type_parent);
                typename = typename.Replace(",", "_");
            }
            else
            {
                typename = ArticleHelper.Get_Type_Name(type);
            }

            title_val = typename + "";

            if (type == 406)
            {
                title_val = "韩国穿衣搭配|韩国女装搭配|韩国服饰图片-衣品搭配网|韩系穿衣搭配网";
            }
            else if (type == 407)
            {
                title_val = "日系风格|日系搭配|日系女装|日系服装搭配-衣品搭配网|日系衣服搭配";
            }
            else if (type == 408)
            {
                title_val = "欧美风搭配|欧美风图片|欧美风打扮-衣品搭配网|欧美衣服搭配";
            }
            else if (type == 417)
            {
                title_val = "矮个子女装|矮个子女生穿衣搭配|矮个子衣服的穿配法-衣品搭配网|矮个子衣服搭配";
            }

            context.Put("title", title_val);

            #region  获取keywords和description
            try
            {
                int type_linshi = type;

                if (stype > 0)
                {
                    type_linshi = stype;
                }

                DataSet kdds = DbHelperSQL.Query("select keywords,description from hrenh_article_type where id=" + type_linshi + "");
                if (kdds != null && kdds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow kddr in kdds.Tables[0].Rows)
                    {
                        keywords_val = kddr["keywords"].ToString();
                        string description_val = kddr["description"].ToString();

                        if (keywords_val != "")
                        {
                            title_val = keywords_val;
                        }

                        if (description_val != "")
                        {
                            description = description_val;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            #endregion

            if (type == 406 || type == 407 || type == 408 || type == 417)
            {
                if (type == 406)
                {
                    context.Put("keywords", "韩国服饰,韩国服饰搭配,韩国街拍");
                    context.Put("description", "韩国服饰是亚洲范围内非常流行的流行服饰,也是最受穿搭潮人们喜爱的服饰类型!韩系服装现在是时尚圈无法阻挡的一股潮流,衣品搭配网将给您展示最新潮的韩式穿搭!");
                }
                else if (type == 407)
                {
                    context.Put("keywords", "日系,日系风格,日系服装搭配,日系服装特点,甜美日系风,日系秋装搭配");
                    context.Put("description", "日系是夹在欧美风和韩系风中的一种特立流行风格,突出可爱风格。日系和韩系都是越来越流行的服装类型,衣品搭配网将给您展示最适合您的日系搭配方法!");
                }
                else if (type == 408)
                {
                    context.Put("keywords", "欧美风,欧美风搭配,欧美风打扮,欧美风格图片");
                    context.Put("description", "欧美风,随性、简单,不同于以简约优雅著称的英伦风,更偏向于街头类型的纽约范,任何人穿都会变得更加自信、有范、洋气、大牌,让你彻底脱胎换骨、远离土里土气。");
                }
                else if (type == 417)
                {
                    context.Put("keywords", "矮个子,女装,矮个子女装,矮个子穿衣搭配图片,矮个子街拍,矮个子服装搭配图片");
                    context.Put("description", "矮个子女生常常因为身高问题影响穿衣搭配,通过衣品搭配网的专业推荐和分析一定能解决矮个子女生穿衣搭配的难题。");
                }

                context.Put("keywords_cname", "搭配");
            }
            else
            {
                context.Put("keywords", title_val.Replace("_", ",").Replace("|", ","));
                context.Put("keywords_cname", keywords_val.Replace("红人", ""));

                context.Put("description", description);
            }

            #endregion

            // 获取当前类型的封面图和描述
            Get_Type_Show_Dest(context);

            // 加载文章列表
            GetList(context);
        }