MyNote/Controllers/NoteController.cs

(开头部分) 8KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using System.Text;
using System.Configuration;
using System.Web.Configuration;

namespace MyNote.Controllers
{
    /// <summary>
    /// 记事本控制器。
    /// </summary>
    public class NoteController : Controller
    {
        private static string CodeName = "";

        /// <summary>
        /// 记事本页面
        /// </summary>
        /// <returns></returns>
        public ActionResult Home()
        {
            //从配置文件获取到字典
            Configuration config = WebConfigurationManager.OpenWebConfiguration("/Views");
            AppSettingsSection app = config.AppSettings;
            CodeName = app.Settings["CodeName"].Value;
            //存储到缓存
            Response.Cookies["CodeName"].Value = CodeName;
            //传到页面
            ViewBag.CodeName = CodeName.Split(',');
            return View();
        }

        /// <summary>
        /// 提交保存(修改保存)
        /// </summary>
        /// <returns></returns>
        [ValidateInput(false)]
        public string Submit()
        {
            int id = Convert.ToInt32(Request["id"].ToString());
            string tex = Request["tex"];
            string type = Request["Type"];
            string title = Request["Title"];
            string Des = Request["Des"];
            if (type == "-1")
            {
                type = "默认";
            }
            Model.NoteModel model = new Model.NoteModel();
            model.NoteContent = tex;
            model.NoteDes = Des;
            model.NoteTitle = title;
            model.NoteType = type;
            BLL.MyNoteBLL bll = new BLL.MyNoteBLL();
            //保存
            if (id == 0)
后面还有 168 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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