if (this.FileUpload1.HasFile)
{
string filename = System.IO.Path.GetFileName(this.FileUpload1.FileName);//获取上传文件的名称
string phypath = Server.MapPath("Image/" + filename);//获取上传的路径
this.FileUpload1.SaveAs(phypath);//将文件上传至指定路径
Response.Write("上传成功");
}
转载于:https://blog.51cto.com/aiyong/1429458