FineAdmin.Web/Controllers/HomeController.cs

(开头部分) 4KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FineAdmin.Web.Areas.SysSet.Models;
using FineAdmin.Model;
using FineAdmin.Common;
using System.IO;
using FineAdmin.IService;

namespace FineAdmin.Web.Controllers
{
    public class HomeController : BaseController
    {
        public IDonationService DonationService { get; set; }

        public override ActionResult Index(int? id)
        {
            ViewBag.Account = Operator == null ? "" : Operator.Account;
            ViewBag.HeadIcon = Operator == null ? "" : Operator.HeadIcon;
            return View(new WebModel().GetWebInfo());
        }

        public ActionResult Main()
        {
            DonationModel donationModel = DonationService.GetConsoleNumShow();
            ViewBag.DonationTop = DonationService.GetSumPriceTop(5).ToList();
            return View(donationModel);
        }

        public JsonResult ExportFile()
        {
            UploadFile uploadFile = new UploadFile();
            try
            {
                var file = Request.Files[0];    //获取选中文件
                var filecombin = file.FileName.Split('.');
                if (file == null || string.IsNullOrEmpty(file.FileName) || file.ContentLength == 0 || filecombin.Length < 2)
                {
                    uploadFile.code = -1;
                    uploadFile.src = "";
                    uploadFile.msg = "上传出错!请检查文件名或文件内容";
                    return Json(uploadFile, JsonRequestBehavior.AllowGet);
                }

                if (!IsAllowedExtension(file))
                {
                    uploadFile.code = -1;
                    uploadFile.src = "";
                    uploadFile.msg = "检测到上传文件有问题!";
                    return Json(uploadFile, JsonRequestBehavior.AllowGet);
                }
                
                //定义本地路径位置
                string localPath = Server.MapPath("~/Upload");
                string filePathName = string.Empty; //最终文件名
                filePathName = Common.Common.CreateNo() + "." + filecombin[1];
                //Upload不存在则创建文件夹
                if (!System.IO.Directory.Exists(localPath))
后面还有 82 行代码,解锁后查看完整代码

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

AI 解读

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

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