FJDPXT202002/Controllers/MainController.cs

(开头部分) 12KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using FJDPXT202002.Common;
using FJDPXT202002.EntityClass;
using FJDPXT202002.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace FJDPXT202002.Controllers
{
    public class MainController : Controller
    {
        Models.FJDPXTEntities myModel = new FJDPXTEntities();
        // GET: Main
        public ActionResult Login()
        {
            string jobNumber = "";
            string password = "";
            bool isRember = false;
            //读取浏览器请求传递的cookie

            //读取浏览器请求传递的cookie
            HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies["user"];
            if (cookie != null)//判断cookie是否存在
            {
                if (cookie["jobNumber"] != null)
                {
                    //对字符串进行 URL 解码并返回已解码的字符串
                    jobNumber = System.Web.HttpContext.Current.Server.UrlDecode(cookie["jobNumber"]);
                }
                if (cookie["Password"] != null)
                {
                    password = System.Web.HttpContext.Current.Server.UrlDecode(cookie["password"]);
                }
                isRember = true;
            }


            ViewData["jobNumber"] = jobNumber;
            ViewBag.password = password;
            ViewBag.isRember = isRember;
            return View();
        }
        public ActionResult Main()
        {

            try
            {
                int userID = Convert.ToInt32(Session["UserID"].ToString());
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                //如果出现异常就说明没有登录,重定向到登录页面
                return Redirect(Url.Content("~/Main/Login"));
            }
            return View();
        }
        public ActionResult CreateValidCode()
后面还有 201 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。