Song.Site/Manage/Utility/UploadPath/SelectFile.ashx.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using Song.ServiceInterfaces;
using Song.Entities;
using WeiSha.Common;

namespace Song.Site.Manage.Utility.UploadPath
{
    /// <summary>
    /// 选择文件
    /// </summary>
    public class SelectFile : IHttpHandler
    {        
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                //上传路径
                string uploadPathKey = WeiSha.Common.Request.QueryString["path"].String;
                string path = WeiSha.Common.Upload.Get[uploadPathKey].Virtual;
                string uid = WeiSha.Common.Request.QueryString["uid"].String;   //全局唯一值
                string file = WeiSha.Common.Request.QueryString["file"].String;
                //添加附件
                Song.Entities.Accessory acc = new Song.Entities.Accessory();
                //视频操作对象                
                string videoFile = HttpContext.Current.Server.MapPath(path + file); //上传后的视频文件
                WeiSha.Common.VideoHandler handler = WeiSha.Common.VideoHandler.Hanlder(videoFile);
                if (handler.Width > 0) acc = setAcc(acc, handler);
                if (!string.IsNullOrWhiteSpace(uid))
                {
                    //参数
                    acc.As_Name = Path.GetFileName(file);
                    acc.As_FileName = file;
                    acc.As_Uid = uid;
                    acc.As_IsOuter = false;     //非外部链接
                    acc.As_Type = uploadPathKey;
                    Business.Do<IAccessory>().Delete(uid, false);
                    Business.Do<IAccessory>().Add(acc);
                }
            }
            catch
            {
            }
           
        }
        
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

        /// <summary>
        /// 设置附件的各项参数
        /// </summary>
后面还有 16 行代码,解锁后查看完整代码

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

AI 解读

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

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