Web/admin/document/fileupload.cs

(开头部分) 8KB

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

namespace School_Web.admin.document
{
    using System;
    using System.IO;
    using System.Runtime.CompilerServices;
    using System.Web.UI.WebControls;

    public class fileupload
    {
        [MethodImpl(MethodImplOptions.NoInlining)]
        public string CoverFile(FileUpload ffFile, string strAbsolutePath, string strOldFileName)
        {
            string str = "";
            if (!(ffFile.PostedFile.FileName != string.Empty))
            {
                return str;
            }
            if (strOldFileName != string.Empty)
            {
                this.DeleteFile(strAbsolutePath, strOldFileName);
            }
            return this.SaveFile(ffFile, strAbsolutePath);
        }

        [MethodImpl(MethodImplOptions.NoInlining)]
        public bool CreateDirectory(string sPath)
        {
            string path = sPath;
            try
            {
                if (!Directory.Exists(path))
                {
                    DirectoryInfo info = Directory.CreateDirectory(path);
                }
                return true;
            }
            catch
            {
                return false;
            }
        }

        [MethodImpl(MethodImplOptions.NoInlining)]
        public void DeleteFile(string strAbsolutePath, string strFileName)
        {
            if (strAbsolutePath.LastIndexOf(@"\") == strAbsolutePath.Length)
            {
                if (File.Exists(strAbsolutePath + strFileName))
                {
                    File.Delete(strAbsolutePath + strFileName);
                }
            }
            else if (File.Exists(strAbsolutePath + @"\" + strFileName))
            {
                File.Delete(strAbsolutePath + @"\" + strFileName);
            }
        }

        [MethodImpl(MethodImplOptions.NoInlining)]
        public void DeleteFile_URL_AND_Name(string strAbsolutePathName)
后面还有 195 行代码,购买后查看完整代码

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

AI 解读

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

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