Song.Site/Teacher/Register.ashx.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WeiSha.Common;
using Song.ServiceInterfaces;
using Song.Extend;
namespace Song.Site.Teacher
{
/// <summary>
/// Register 的摘要说明
/// </summary>
public class Register : IHttpHandler
{
//账号,密码,验证码
string acc = WeiSha.Common.Request.Form["tbAcc"].String;
string pw = WeiSha.Common.Request.Form["tbPw"].String;
string code = WeiSha.Common.Request.Form["tbCode"].String;
protected HttpResponse Response { get; private set; }
public void ProcessRequest(HttpContext context)
{
this.Response = context.Response;
if (!string.IsNullOrWhiteSpace(acc))
{
_register();
}
else
{
if (context.Request.UrlReferrer != null)
{
context.Response.Redirect(context.Request.UrlReferrer.ToString());
}
else
{
context.Response.Redirect("index.ashx");
}
}
}
private void _register()
{
if (!isCodeImg())
{
//注册时的验证码不正确
this.Response.Redirect("index.ashx?loyout=reg&error=2&acc=" + acc);
}
//当前机构,通过二级域名判断,如果不存在或无法判断,则返回默认机构
Song.Entities.Organization org = Business.Do<IOrganization>().OrganCurrent();
Song.Entities.Teacher tmp = new Entities.Teacher();
tmp.Th_AccName = acc;
tmp.Th_Pw = pw;
//判断账号是否存在
bool isHav = Business.Do<ITeacher>().IsTeacherExist(org.Org_ID, tmp);
if (!isHav)
{
int id = Business.Do<ITeacher>().TeacherAdd(tmp);
tmp = Business.Do<ITeacher>().TeacherSingle(acc, pw, org.Org_ID);
LoginState.Teacher.Write(tmp);
this.Response.Redirect("panel.ashx?mmid=589");
}
后面还有 26 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
