WebSite/Uploader.cs

(开头部分) 3KB

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

using System;
using System.Collections;
using System.IO;
using System.Web;

public class Uploader
{
    private string currentType = null;
    private string filename = null;
    private string originalName = null;
    private string state = "SUCCESS";
    private HttpPostedFile uploadFile = null;
    private string uploadpath = null;
    private string URL = null;

    private bool checkSize(int size)
    {
        return (this.uploadFile.ContentLength >= ((size * 0x400) * 0x400));
    }

    private bool checkType(string[] filetype)
    {
        this.currentType = this.getFileExt();
        return (Array.IndexOf<string>(filetype, this.currentType) == -1);
    }

    private void createFolder()
    {
        if (!Directory.Exists(this.uploadpath))
        {
            Directory.CreateDirectory(this.uploadpath);
        }
    }

    public void deleteFolder(string path)
    {
    }

    private string getFileExt()
    {
        string[] temp = this.uploadFile.FileName.Split(new char[] { '.' });
        return ("." + temp[temp.Length - 1].ToLower());
    }

    public string getOtherInfo(HttpContext cxt, string field)
    {
        string info = null;
        if (!((cxt.Request.Form[field] == null) || string.IsNullOrEmpty(cxt.Request.Form[field])))
        {
            info = (field == "fileName") ? cxt.Request.Form[field].Split(new char[] { ',' })[1] : cxt.Request.Form[field];
        }
        return info;
    }

    private Hashtable getUploadInfo()
    {
        Hashtable infoList = new Hashtable();
        infoList.Add("state", this.state);
        infoList.Add("url", this.URL);
        infoList.Add("originalName", this.originalName);
后面还有 71 行代码,购买后查看完整代码

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

AI 解读 AI

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

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