System.Web.HttpUtility.UrlDecode C# (CSharp) Method

UrlDecode() public static method

public static UrlDecode ( byte bytes, System e ) : string
bytes byte
e System
return string
        public static string UrlDecode(byte[] bytes, System.Text.Encoding e)
        {
            throw null;
        }

Same methods

HttpUtility::UrlDecode ( byte bytes, int offset, int count, System e ) : string
HttpUtility::UrlDecode ( string str ) : string
HttpUtility::UrlDecode ( string str, System e ) : string

Usage Example

Example #1
0
        public ActionResult DoLogin(string phone, string userPwd, int id = 0, string token = "", string tourl = "")
        {
            UserBll         userApi = new UserBll();
            PublicUserModel user    = new PublicUserModel();

            if (!string.IsNullOrEmpty(token))
            {
                user = userApi.PublicUserLoginByToken(token);
            }
            else
            {
                user = userApi.PublicUserLogin(phone, userPwd, 1, id);
            }

            if (user != null && user.UserID > 0)
            {
                String saveKey = System.Configuration.ConfigurationManager.AppSettings["AuthSaveKey"];
                if (String.IsNullOrEmpty(saveKey))
                {
                    saveKey = "WXLoginedUser";
                }
                Session[saveKey] = user;
                HttpCookie loginUserCookie = new HttpCookie(saveKey, CryptoUtility.TripleDESEncrypt(user.UserID.ToString()));
                loginUserCookie.Expires = DateTime.Now.AddDays(10);
                HttpContext.Response.Cookies.Add(loginUserCookie);
                if (!string.IsNullOrEmpty(tourl))
                {
                    return(new RedirectResult(HttpUtility.UrlDecode(tourl)));
                }
                return(Json(new { status = 0 }, JsonRequestBehavior.AllowGet));
            }
            if (!string.IsNullOrEmpty(tourl))
            {
                return(new RedirectResult("/m/u/login"));
            }
            return(Json(new { status = 1, msg = "用户名或者密码错误" }, JsonRequestBehavior.AllowGet));
        }