在页面后面的代码容易实现
System.IO.File.Delete(Server.MapPath(path));
直接这样就可以了,但是如果我是写在一个类库里面比如有个方法在类库里面,并添加System.Web的引用
publice bool DelImage(string path)
{
System.IO.File.Delete(Server.MapPath(path));}
但是不行的,我究竟应该怎么写的?
System.IO.File.Delete(Server.MapPath(path));
直接这样就可以了,但是如果我是写在一个类库里面比如有个方法在类库里面,并添加System.Web的引用
publice bool DelImage(string path)
{
System.IO.File.Delete(Server.MapPath(path));}
但是不行的,我究竟应该怎么写的?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货