DirectoryNotFoundException: Could not find a part of the path "……"
2005-11-03 16:37
671 查看
DirectoryNotFoundException: Could not find a part of the path ,用google或者Baidu搜索,都能找到相关的问题。今天我也遇到了这个问题,许多人出现这个问题的时候,都是由于“文件或目录确实不存在”,“目录权限不正确”,“代码中虚拟路径与物理路径同时存在”。
我的情况归根结底类似于“文件或者目录不存在”,我的案例是一个ASP.NET文件上传类库,由于代码的疏忽,造成有时文件名丢失,只在saveAS方法里边留了个存放文件的目录,没有文件名。也就是说没错的时候应该是“路径+文件名”,而出错的时候只有一个“路径”。
至此,问题解决。似乎.NET不会胡来,它说出了什么问题,大概就出了什么。围绕Exception提示总能够找到解决办法。
我的情况归根结底类似于“文件或者目录不存在”,我的案例是一个ASP.NET文件上传类库,由于代码的疏忽,造成有时文件名丢失,只在saveAS方法里边留了个存放文件的目录,没有文件名。也就是说没错的时候应该是“路径+文件名”,而出错的时候只有一个“路径”。
至此,问题解决。似乎.NET不会胡来,它说出了什么问题,大概就出了什么。围绕Exception提示总能够找到解决办法。
相关文章推荐
- Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'F:\'.
- 解决文件无法上传的问题,错误信息:System.IO.DirectoryNotFoundException: Could not find a part of the path.
- 【.Net码农】关于使用FileUpload控件报 Could not find a part of the path "X/1.jpg"
- 关于使用FileUpload控件报 Could not find a part of the path "X\1.jpg"
- .net中创建目录的问题(未找到路径X的一部分|Could not find a part of the path)
- 用webclient实现无空间上传文件错误:Could not find a part of the path .....
- 访问Storm ui界面,出现org.apache.storm.utils.NimbusLeaderNotFoundException: Could not find leader nimbus from seed hosts ["master" "slave1"]. Did you specify a valid list of nimbus hosts for confi的问题解决(图文详解)
- 用Reflector的插件Reflexil 报错: could not find a part of the path 'c:\documents and settings\ ……的解决办法
- 访问Storm ui界面,出现org.apache.storm.utils.NimbusLeaderNotFoundException: Could not find leader nimbus from seed hosts ["master"]. Did you specify a valid list of nimbus hosts for confi的问题解决(图文详解)
- 报ClassNotFoundException: Didn't find class "...Activity" on path: DexPathList
- Could not load file or assembly "xxx" or one of its dependencies. The system cannot find the file sp
- bundle install时候出现"Could not find modernizr-2.6.2 in any of the sources"
- DevExpress Exception Solution - The target "X" for the callback could not be found or did not implement ICallbackEventHandler
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path表头报错解决
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- maven编译error:Could not find tool 'aapt'. Please provide a proper Android SDK directory path as confi
- "无法启动Web服务器。Web服务器无法找到请求的资源" 或 "unable to start debugging on the web server.the web server could not find the request"解决方法
- 6.The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- 记录一下,关于错误提示:could not find a part of path “X:\”的解决办法
- java.lang.ClassNotFoundException:Didn't find class "android.os.PersistableBundle" on path 奇葩BUG解决