protected void btnSubmit_Click(object sender, EventArgs e)
{
HttpFileCollection files = Request.Files;
HttpPostedFile userPostedFile = files[0];
string fullfilename = userPostedFile.FileName.ToString();
//上传文件
string uploadpath = HttpContext.Current.Server.MapPath("~/upload/" + fullfilename);
userPostedFile.SaveAs(uploadpath);
this.labValidate.Text = "文件上传成功!请到项目的upload文件夹里查看!";
}
.net中上传文件到服务器端
最新推荐文章于 2024-08-29 11:44:44 发布