📄 uploadfile.aspx.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;
/// <summary>
/// Flash 上传之文件存储板块
/// </summary>
public partial class UpLoad_UpLoadFile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
UpLoad();
}
protected void UpLoad()
{
string saveToFolder = "/UpFile/";
HttpFileCollection uploadedFiles = Request.Files;
string NewFileName = Session["UpLoadFileName"].ToString();
string Path = Server.MapPath(saveToFolder);
for (int i = 0; i < uploadedFiles.Count; i++)
{
HttpPostedFile F = uploadedFiles[i];
if (uploadedFiles[i] != null && F.ContentLength > 0)
{
string newName = F.FileName.Substring(F.FileName.LastIndexOf("\\") + 1);
F.SaveAs(Path + "/" + NewFileName + F.FileName.Substring(F.FileName.LastIndexOf(".")));
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -