default2.aspx.cs
来自「带进度条大文件上传源码(单文件多文件都可以传)+v2.0」· CS 代码 · 共 38 行
CS
38 行
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 + =
减小字号Ctrl + -
显示快捷键?