1
If System.IO.Directory.Exists(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID())) Then
System.IO.Directory.Delete(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID()), True)
End If
我使用上面的代码片段删除一个目录,但我得到这个错误:资料夹删除不工作
'G:\Projects\Latest\LTCIndia 05-04-12 1415\images\TravelogueGallery\19' is not a valid virtual path.
有什么不好的代码?
更新:我已经用正确答案更新了这个问题。上面的代码片段工作得很好。谢谢你们的时间。
删除删除行上的MapPath。看看是否有帮助。 – asawyer 2012-04-05 23:26:39
http://stackoverflow.com/questions/942514/is-not-a-valid-virtual-path – 2012-04-05 23:28:31
可能的重复检查你的相对路径。 – coder 2012-04-05 23:29:13