⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default2.aspx.cs

📁 带进度条大文件上传源码(单文件多文件都可以传)+v2.0
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using Bestcomy.Web.Controls.Upload;
//该源码下载自【编程联盟】ASp.Net下载中心 【 http://aspx.bcbbs.net 】
public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string fpath = Path.Combine(Request.PhysicalApplicationPath, "temp");
        if (!Directory.Exists(fpath))
            Directory.CreateDirectory(fpath);
        AspnetUpload upldr = new AspnetUpload();
        upldr.set_UploadFolder(fpath);
        upldr.RegisterModelessProgressBar(this.btn_upload);

    }
    protected void btn_upload_Click(object sender, EventArgs e)
    {
        string fpath = Path.Combine(Request.PhysicalApplicationPath, "temp");
        UploadFileCollection files = AspnetUpload.GetUploadFiles("file1");
        foreach (UploadFile file in files)
        {
            //UploadFile file = AspnetUpload.GetUploadFile("file1");
            if (file != null)
                file.SaveAs(Path.Combine(fpath, Path.GetFileName(file.get_FileName())));
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -