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

📄 default.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 _Default : System.Web.UI.Page
{
    private string _uploadID = string.Empty;

    public string UploadID
    {
        get
        {
            return this._uploadID;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        string fpath = Path.Combine(Request.PhysicalApplicationPath, "temp");
        AspnetUpload upldr = new AspnetUpload();
        upldr.RegisterProgressBar();
        this._uploadID = upldr.get_UploadID();
        if (!Directory.Exists(fpath))
            Directory.CreateDirectory(fpath);
        upldr.set_UploadFolder(fpath);
        btn_upload.Attributes.Add("onclick", "this.disabled = true; showProgressBar(); " + ClientScript.GetPostBackEventReference(btn_upload,string.Empty) + ";");
        
        Master.Page.ClientScript.RegisterClientScriptInclude("prototype", "JavaScript/prototype-1.3.1.js");
        Master.Page.ClientScript.RegisterClientScriptInclude("dom-drag", "JavaScript/dom-drag.js");
    }
    protected void btn_upload_Click(object sender, EventArgs e)
    {
        string fpath = Path.Combine(Request.PhysicalApplicationPath, "temp");
        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 + -