一步一步学asp.net_Ajax登录设计(29)
来源:未知 责任编辑:责任编辑 发表时间:2014-05-10 12:25 点击:次
82:
83: /// </summary>
84:
85: /// <param name="IsSaveName">"1"代表保存,"0"代表不保存</param>
86:
87: /// <param name="IsSavePwd">"1"代表保存,"0"代表不保存</param>
88:
89: /// <returns></returns>
90:
91: public RememberType GetRememberType(string IsSaveName, string IsSavePwd)
92:
93: {
94:
95: RememberType SaveType = RememberType.NoRemember;
96:
97: //保存帐号和密码
98:
99: if (IsSaveName.Equals("1") && IsSavePwd.Equals("1"))
100:
101: {
102:
103: SaveType = RememberType.RememberNameAndPwd;
104:
105: }
106:
107: //保存帐号
108:
109: if (IsSaveName.Equals("1") && !IsSavePwd.Equals("1"))
110:
111: {
112:
113: SaveType = RememberType.RememberName;
114:
115: }
116:
117: else if(!IsSaveName.Equals("1"))
118:
119: {
120:
121: SaveType = RememberType.NoRemember;
122:
123: }
124:
125: return SaveType;
126:
127: }
128:
129: /// <summary>
130:
131: /// 检查用户登录状态,用于验证自动登录(并返回json格式)
132:
133: /// </summary>
134:
135: /// <returns></returns>
136:
137: public string CheckLoginStatus()
138:
139: {
140:
141: //登录状态
142:
143: bool Status = true;
144:
145: string UserName = Common.CookieHelper.GetCookieValue("UserName");
146:
147: //如果cookies为空,直接返回
148:
149: if (Tools.IsNullOrEmpty(UserName))
150:
151: {
152:
153: Status = false;
154:
155: }
156:
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>