MvcBug/Controllers/DefaultController.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data.SqlClient;
using System.Data;
namespace MvcBug.Controllers
{
public class DefaultController : Controller
{
//
// GET: /Default/
public ActionResult Index()
{
if (Session["Name"] == null)
{
Response.Redirect("/Default/Login");
}
else
{
ViewData["Name"] = Session["Name"];
ViewData["Showallbug"] = Session["Showallbug"];
}
return View();
}
public ActionResult Login()
{
ViewData["employDt"] = new DAL.QueryDAL().GetDataTable("employ", "Id", "Id,Code,Name", "", "", "");
return View();
}
public void LoginOut()
{
Session["Name"] = null;
Session["Id"] = null;
Session["Showallbug"] = null;
Response.Redirect("/Default/Login");
}
public string ToLogin(FormCollection forms)
{
string Password = forms["Password"];
string Name = forms["Name"];
string jsonstr = string.Empty;
try
{
DataTable dt = new DAL.EmployDAL().Login(Name);
if (dt.Rows.Count>0 && Password == "123456")
{
Session["Name"] = dt.Rows[0]["Name"];
Session["Id"] = dt.Rows[0]["Id"];
Session["Showallbug"] = dt.Rows[0]["Showallbug"];
jsonstr = "{\"success\":true}";
}
else
{
jsonstr = "{\"errorMsg\":\"账号不正确!\"}";
}
后面还有 10 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。