亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? uploadedfile.cs

?? PowUpload的C#源文件,用來做大文件上傳的項目
?? CS
字號:
?namespace ElementIT.PowUpload
{
    using System;
    using System.Drawing;
    using System.IO;
    using System.Security.Cryptography;
    using System.Text;

    public class UploadedFile
    {
        internal string _ClientFilePath = "";
        internal long _ContentLength = 0;
        internal string _ContentType = "";
        private object _CustomData = null;
        internal string _FieldName = "";
        internal FileStream _fs = null;
        private bool _ImageWasRead = false;
        private int _ImgHeight = 0;
        private int _ImgWidth = 0;
        private Stream _InputStream = null;
        internal bool _IsComplete = false;
        private bool _IsImage = false;
        internal bool _Rejected = false;
        internal string _TempFileName = "";
        internal BinaryWriter _w = null;

        internal UploadedFile()
        {
        }

        public void CloseInputStream()
        {
            if (this._InputStream != null)
            {
                this._InputStream.Close();
            }
        }

        public void CopyTo(string filename)
        {
            this.CopyTo(filename, false);
        }

        public void CopyTo(string filename, bool overwrite)
        {
            if ((this._TempFileName != null) && (this._TempFileName != ""))
            {
                if ((this._ClientFilePath == null) || (this._ClientFilePath == ""))
                {
                    throw new IOException("The client file path is empty (the file was not selected in the form). You cannot run this method.");
                }
                if (overwrite)
                {
                    if (File.Exists(filename))
                    {
                        File.Delete(filename);
                    }
                }
                else if (File.Exists(filename))
                {
                    throw new IOException(string.Format("File {0} already exists.", filename));
                }
                File.Copy(this._TempFileName, filename);
            }
        }

        public void Dispose()
        {
            UploadModule.AddDebugInfo("UploadedFile.Dispose(): _TempFileName=" + this._TempFileName);
            try
            {
                if (this._fs != null)
                {
                    this._fs.Close();
                }
            }
            catch
            {
            }
            try
            {
                if (this._w != null)
                {
                    this._w.Close();
                }
            }
            catch
            {
            }
            try
            {
                if (this._InputStream != null)
                {
                    this._InputStream.Close();
                }
            }
            catch
            {
            }
            try
            {
                if (((this._TempFileName != null) && (this._TempFileName != "")) && File.Exists(this._TempFileName))
                {
                    File.Delete(this._TempFileName);
                }
            }
            catch
            {
            }
        }

        ~UploadedFile()
        {
            this.Dispose();
        }

        public string GetHashMD5()
        {
            if (!this._IsComplete)
            {
                throw new Exception("Method or property can't be executed while file upload not complete!");
            }
            if ((this._TempFileName != null) && (this._TempFileName != ""))
            {
                try
                {
                    StringBuilder builder = new StringBuilder();
                    MD5 md = new MD5CryptoServiceProvider();
                    FileStream inputStream = new FileStream(this._TempFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                    byte[] buffer = null;
                    try
                    {
                        buffer = md.ComputeHash(inputStream);
                    }
                    finally
                    {
                        inputStream.Close();
                    }
                    if (buffer != null)
                    {
                        foreach (byte num in buffer)
                        {
                            builder.Append(num.ToString("x2"));
                        }
                    }
                    return builder.ToString();
                }
                catch
                {
                    return null;
                }
            }
            return null;
        }

        public static string GetSafeName(string filepath)
        {
            int num = filepath.LastIndexOf(@"\");
            int num2 = filepath.LastIndexOf("/");
            string str = "";
            if ((num == -1) && (num2 == -1))
            {
                str = filepath;
            }
            else if (num > num2)
            {
                str = filepath.Substring(num + 1, (filepath.Length - num) - 1);
            }
            else
            {
                str = filepath.Substring(num2 + 1, (filepath.Length - num2) - 1);
            }
            char[] chArray = new char[] { '?', '*', '\\', '/', ':' };
            char[] invalidPathChars = Path.InvalidPathChars;
            char[] array = new char[invalidPathChars.Length + chArray.Length];
            chArray.CopyTo(array, 0);
            invalidPathChars.CopyTo(array, chArray.Length);
            for (int i = 0; i <= (array.Length - 1); i++)
            {
                int index;
                do
                {
                    index = str.IndexOf(array[i]);
                    if (index != -1)
                    {
                        str = str.Remove(index, 1);
                    }
                }
                while (index != -1);
            }
            if (str.Length > 0xff)
            {
                str = str.Substring(str.Length - 0xff, 0xff);
            }
            return str;
        }

        public void SaveAs(string filename)
        {
            this.SaveAs(filename, false);
        }

        public void SaveAs(string filename, bool overwrite)
        {
            if (!this._IsComplete)
            {
                throw new Exception("Method or property can't be executed while file upload not complete!");
            }
            if ((this._ClientFilePath == null) || (this._ClientFilePath == ""))
            {
                throw new IOException("The client file path is empty (the file was not selected in the form). You cannot run this method.");
            }
            if (overwrite)
            {
                if (File.Exists(filename))
                {
                    File.Delete(filename);
                }
            }
            else if (File.Exists(filename))
            {
                throw new IOException(string.Format("File {0} already exists. Set the overwrite parameter to \"true\" to overwtite the file.", filename));
            }
            File.Move(this._TempFileName, filename);
        }

        private void SetImgParams()
        {
            if (!this._ImageWasRead && !this._Rejected)
            {
                Image image = null;
                try
                {
                    image = Image.FromFile(this._TempFileName);
                    this._ImgHeight = image.Height;
                    this._ImgWidth = image.Width;
                    this._IsImage = true;
                }
                catch
                {
                    this._ImgHeight = 0;
                    this._ImgWidth = 0;
                    this._IsImage = false;
                }
                finally
                {
                    this._ImageWasRead = true;
                    if (image != null)
                    {
                        image.Dispose();
                    }
                }
            }
        }

        public string ClientFilePath
        {
            get
            {
                return this._ClientFilePath;
            }
        }

        public long ContentLength
        {
            get
            {
                return this._ContentLength;
            }
        }

        public string ContentType
        {
            get
            {
                return this._ContentType;
            }
        }

        public object CustomData
        {
            get
            {
                return this._CustomData;
            }
            set
            {
                this._CustomData = value;
            }
        }

        public string Extension
        {
            get
            {
                if ((this._ClientFilePath != "") && (this._ClientFilePath != null))
                {
                    try
                    {
                        return Path.GetExtension(GetSafeName(this._ClientFilePath));
                    }
                    catch
                    {
                    }
                }
                return "";
            }
        }

        public string FieldName
        {
            get
            {
                return this._FieldName;
            }
        }

        public string FileName
        {
            get
            {
                return this._ClientFilePath;
            }
        }

        public int ImageHeight
        {
            get
            {
                if (!this._IsComplete)
                {
                    throw new Exception("Method or property can't be executed while file upload not complete!");
                }
                this.SetImgParams();
                return this._ImgHeight;
            }
        }

        public int ImageWidth
        {
            get
            {
                if (!this._IsComplete)
                {
                    throw new Exception("Method or property can't be executed while file upload not complete!");
                }
                this.SetImgParams();
                return this._ImgWidth;
            }
        }

        public Stream InputStream
        {
            get
            {
                if ((this._Rejected || (this._ClientFilePath == null)) || ((this._ClientFilePath == "") || !File.Exists(this._TempFileName)))
                {
                    return null;
                }
                if ((this._InputStream == null) && this._IsComplete)
                {
                    this._InputStream = new FileStream(this._TempFileName, FileMode.Open);
                }
                else if ((this._InputStream == null) && !this._IsComplete)
                {
                    this._InputStream = new FileStream(this._TempFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                }
                return this._InputStream;
            }
        }

        public bool IsComplete
        {
            get
            {
                return this._IsComplete;
            }
        }

        public bool IsImage
        {
            get
            {
                if (!this._IsComplete)
                {
                    throw new Exception("Method or property can't be executed while file upload not complete!");
                }
                this.SetImgParams();
                return this._IsImage;
            }
        }

        public bool Rejected
        {
            get
            {
                return this._Rejected;
            }
        }

        public string SafeFileName
        {
            get
            {
                if ((this._ClientFilePath != null) && (this._ClientFilePath != ""))
                {
                    return GetSafeName(this._ClientFilePath);
                }
                return "";
            }
        }

        public string TempFileName
        {
            get
            {
                return this._TempFileName;
            }
            set
            {
                this._TempFileName = value;
            }
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
无码av免费一区二区三区试看| 国产精品一区二区不卡| 激情小说欧美图片| 91片在线免费观看| 欧美精品一区二区在线播放| 亚洲一区视频在线| 成人一级片在线观看| 欧美一区日韩一区| 亚洲一区二区三区不卡国产欧美| 国产成人精品亚洲777人妖| 91精品中文字幕一区二区三区| 国产精品久久久久国产精品日日| 精品一区二区三区欧美| 欧美日韩综合一区| 亚洲天堂成人在线观看| 国产v综合v亚洲欧| 精品国产免费久久| 青青青伊人色综合久久| 欧美日韩在线三级| 亚洲精品v日韩精品| 不卡视频一二三四| 亚洲国产精品精华液2区45| 久久福利视频一区二区| 欧美一级高清片| 美女视频网站黄色亚洲| 91精品国产综合久久福利| 亚洲第一久久影院| 欧美日韩国产一二三| 亚洲va欧美va国产va天堂影院| 欧美视频一区在线| 亚洲在线视频一区| 欧美色图天堂网| 亚洲与欧洲av电影| 欧美日韩一级黄| 日韩二区三区四区| 欧美一个色资源| 麻豆精品久久精品色综合| 欧美一区二区在线视频| 黄一区二区三区| 久久精品综合网| 成人激情开心网| 亚洲欧洲三级电影| 91久久精品一区二区三| 午夜精品久久久久久久久久| 欧美精品久久99| 久久精品99久久久| 中文字幕欧美日韩一区| 色婷婷综合久久| 天天色综合成人网| 成人黄色电影在线 | 欧美日韩国产乱码电影| 精品国产亚洲在线| 三级欧美在线一区| 成人动漫一区二区三区| 26uuu国产电影一区二区| 久久精品理论片| 欧美一区二区三区在线观看| 亚洲美女电影在线| 日本一区二区高清| 久久精品视频网| 久国产精品韩国三级视频| 欧美综合一区二区| 91丨九色丨国产丨porny| 久久久精品蜜桃| 亚洲午夜激情av| 久久视频一区二区| 成人午夜碰碰视频| 精品国产免费久久| 亚洲日本免费电影| 欧美日韩一级片在线观看| 蜜桃视频在线观看一区二区| 亚洲一区二区欧美| 51精品国自产在线| 国产激情视频一区二区三区欧美| 国产精品久久三| 色哟哟一区二区在线观看| 青青草97国产精品免费观看 | 在线不卡一区二区| 久久69国产一区二区蜜臀| 中文字幕精品在线不卡| 91成人网在线| 欧美一区二区观看视频| 在线看国产一区| 制服丝袜日韩国产| 久久精子c满五个校花| 亚洲18女电影在线观看| 国产福利精品一区二区| 亚洲一区国产视频| 99精品久久只有精品| 欧美电影一区二区| 成人免费在线播放视频| 成人av资源站| 在线不卡中文字幕| 精品视频在线免费看| av福利精品导航| 免费一级片91| 日本久久精品电影| 久久蜜桃香蕉精品一区二区三区| 97久久精品人人澡人人爽| 久久超碰97中文字幕| 日韩国产精品久久久久久亚洲| 17c精品麻豆一区二区免费| 欧美韩日一区二区三区四区| 欧美精品一区二区三区四区| 欧美日韩国产bt| 在线观看国产91| 欧美在线视频不卡| 欧美日韩一区二区三区高清| 在线观看一区二区精品视频| 91久久一区二区| 欧美视频一区二区三区四区| 欧美伊人精品成人久久综合97| 97aⅴ精品视频一二三区| jvid福利写真一区二区三区| 成人av先锋影音| 99热99精品| 一本久道久久综合中文字幕| 一本大道久久精品懂色aⅴ| 91黄视频在线观看| 欧美午夜在线观看| 91精品免费在线| 欧美一区二区视频在线观看2020| 91精品国产麻豆国产自产在线| 欧美一区二区三区在线视频| www国产亚洲精品久久麻豆| 26uuu欧美| 国产嫩草影院久久久久| 国产精品免费视频一区| 亚洲人成影院在线观看| 洋洋成人永久网站入口| 亚洲成人免费视| 久久精品二区亚洲w码| 国产不卡一区视频| 成人国产免费视频| 欧美无人高清视频在线观看| 日韩免费在线观看| 国产午夜精品美女毛片视频| 亚洲天堂成人在线观看| 香港成人在线视频| 国产精品1024| 91国偷自产一区二区开放时间| 欧美日韩黄色一区二区| 欧美精品一区二区在线观看| 国产精品久久久久永久免费观看 | jvid福利写真一区二区三区| 欧美三级在线播放| 2023国产精品自拍| 亚洲美女免费在线| 裸体在线国模精品偷拍| jlzzjlzz亚洲女人18| 在线不卡免费av| 中文字幕视频一区二区三区久| 午夜精品福利一区二区三区蜜桃| 韩国精品在线观看| 91福利视频在线| 国产日产欧美一区| 亚洲一区二区视频在线观看| 国内精品久久久久影院一蜜桃| 91免费视频网址| 久久综合av免费| 亚洲国产视频直播| 不卡一卡二卡三乱码免费网站| 欧美丰满少妇xxxxx高潮对白| 国产女人aaa级久久久级 | 日本道色综合久久| 久久久影视传媒| 日韩电影网1区2区| 91社区在线播放| 精品国产制服丝袜高跟| 性欧美疯狂xxxxbbbb| 大陆成人av片| 日韩欧美国产小视频| 亚洲一区二区三区中文字幕在线| 国产综合色在线| 欧美日韩1234| 亚洲综合图片区| 色综合视频一区二区三区高清| 久久久精品日韩欧美| 美脚の诱脚舐め脚责91| 欧美美女视频在线观看| 尤物av一区二区| 99re在线视频这里只有精品| 国产亚洲精品精华液| 久久er精品视频| 日韩一区二区高清| 日韩国产精品久久久久久亚洲| 欧美日韩一区三区| 亚洲主播在线播放| 欧美色爱综合网| 亚洲综合一区二区精品导航| 91久久香蕉国产日韩欧美9色| 亚洲人成网站在线| 91一区一区三区| 亚洲另类春色校园小说| 91在线国产福利| 亚洲精品成人少妇| 欧美日韩情趣电影| 性做久久久久久免费观看| 欧美日韩高清一区二区| 日韩精品国产欧美|