Note/View.aspx.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Note_View : MojoCube.Api.UI.MyPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] != null)
            {
                ViewState["pk_Note"] = MojoCube.Api.Text.Security.DecryptString(Request.QueryString["id"]);

                MojoCube.Office.Note.List list = new MojoCube.Office.Note.List();
                list.GetData(int.Parse(ViewState["pk_Note"].ToString()));

                if (Session["UserID"].ToString() != list.fk_User.ToString())
                {
                    lnbEdit.Enabled = false;

                    if (list.TypeID == 0)
                    {
                        Response.Redirect("~/Commons/Info.aspx?type=1");
                    }
                }

                lblTitle.Text = list.Title;

                MojoCube.Office.User.List user = new MojoCube.Office.User.List();
                user.GetData(list.fk_User);
                lblFrom.Text = "创建:" + user.FullName;

                lblDate.Text = list.CreateDate;
                lblDescription.Text = list.Description;

                ViewState["ParentID"] = list.ParentID;

                if (list.FilePath != "")
                {
                    string domain = System.Configuration.ConfigurationManager.AppSettings["Domain"];

                    string path = list.FilePath;
                    int index = path.LastIndexOf('.') + 1;
                    string fileType = path.Substring(index, path.Length - index);

                    if (fileType == "jpg" || fileType == "jpeg" || fileType == "gif" || fileType == "png" || fileType == "bmp")
                    {
                        lblDescription.Text += "<div><img src=\"" + domain + "Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(list.FilePath) + "\" /></div>";
                    }
                    lblDescription.Text += "<hr /><a href=\"" + domain + "Files.aspx?file=" + MojoCube.Api.Text.Security.EncryptString(list.FilePath) + "\" target=\"_blank\"><i class=\"fa fa-paperclip\"></i> 下载附件</a>";
                }

                this.Title = "笔记查看:" + lblTitle.Text;
            }
            else
            {
后面还有 22 行代码,购买后查看完整代码

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

AI 解读 AI

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

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