问题:
不会使用Image.FromFile(),看到网上的答案都是写filepath在服务器上的,没有写怎么读取当前解决方案下的图片的路径,写相对路径找不到。
System.IO.FileNotFoundException
解决方法:
Image.FromFile(Server.MapPath("~/Content/imgs/defaultImg.jpeg"))
其中:
./当前目录
/网站主目录
../上层目录
~/网站虚拟目录
问题:
不会使用Image.FromFile(),看到网上的答案都是写filepath在服务器上的,没有写怎么读取当前解决方案下的图片的路径,写相对路径找不到。
System.IO.FileNotFoundException
解决方法:
Image.FromFile(Server.MapPath("~/Content/imgs/defaultImg.jpeg"))
其中:
./当前目录
/网站主目录
../上层目录
~/网站虚拟目录