ASP.NET 中上传图片
上传图片虽然简单,我也还是要记下来,以防万一哪天我忘了呢?嘿嘿,自己也可再看看。。
//string test = Server.MapPath(@"\UpLoad");
string fileName = this.fulPic.FileName;
string fullFileName= Path.Combine(Server.MapPath(@".\UpLoad"),this.fulPic.FileName);
string databasePath = Path.Combine(@"\UpLoad",fileName);//把这个值保存到数据库做为图片相对路径
this.fulPic.SaveAs(fullFileName);
//string test = Server.MapPath(@"\UpLoad");
string fileName = this.fulPic.FileName;
string fullFileName= Path.Combine(Server.MapPath(@".\UpLoad"),this.fulPic.FileName);
string databasePath = Path.Combine(@"\UpLoad",fileName);//把这个值保存到数据库做为图片相对路径
this.fulPic.SaveAs(fullFileName);