一步一步学asp.net_Ajax登录设计(25)
来源:未知 责任编辑:责任编辑 发表时间:2014-05-10 12:25 点击:次
141: string UserName = (string)context.Session["UserName"];
142:
143: memberBLL bll = new memberBLL();
144:
145: if (!Tools.IsNullOrEmpty(UserName))
146:
147: {
148:
149: //如果session存在,直接返回用户状态
150:
151: bll.WriteJsonForLogin(true, UserName);
152:
153: }
154:
155: else
156:
157: {
158:
159: //用户自动登录状态检测
160:
161: context.Response.Write(bll.CheckLoginStatus());
162:
163: }
164:
165: }
166:
167: /// <summary>
168:
169: /// 会员登录
170:
171: /// </summary>
172:
173: /// <param name="context"></param>
174:
175: public void MemberLogin(HttpContext context)
176:
177: {
178:
179: try
180:
181: {
182:
183: //获取数据
184:
185: string Name = context.Request["Name"];
186:
187: string Pwd = context.Request["Pwd"];
188:
189: string IsSaveName = context.Request["cbName"];
190:
191: string IsSavePwd = context.Request["cbPwd"];
192:
193: //用户登录状态
194:
195: bool Status = false;
196:
197: //返回给客户端的json数据
198:
199: string ReturnJson = "";
200:
201: //sql注入检测
202:
203: if (Tools.IsValidInput(ref Name, true) && (Tools.IsValidInput(ref Pwd, true)) && (Tools.IsValidInput(ref IsSaveName, true)) && (Tools.IsValidInput(ref IsSavePwd, true)))
204:
205: {
206:
207: member info = new member();
208:
209: memberBLL bll = new memberBLL();
210:
211: info.username = Name;
212:
213: info.password = Pwd;
214:
215: ReturnJson = bll.ReturnJson(info, out Status);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>