代码删除文件夹内图片问题
System.IO.FileInfo file = new System.IO.FileInfo("~/imgsc/fzxm03.jpg");
file.Delete();
路径那里写这个不行,还必须写E:/Mynetkb/imgsc/fzxm03.jpg 我想按照我上面的那种格式写应该怎么写路径啊?
没有多少分
[解决办法]
Server.MapPath()
[解决办法]
找路径一般用Server.MapPath()
发布时间: 2012-09-25 09:55:59 作者: rapoo
代码删除文件夹内图片问题
System.IO.FileInfo file = new System.IO.FileInfo("~/imgsc/fzxm03.jpg");
file.Delete();
路径那里写这个不行,还必须写E:/Mynetkb/imgsc/fzxm03.jpg 我想按照我上面的那种格式写应该怎么写路径啊?
没有多少分
[解决办法]
Server.MapPath()
[解决办法]
找路径一般用Server.MapPath()