用NeatUpload上传时,如下图的报错,我是少配置什么里面,还是什么原因?在本地ii7是好的,服务器上的是iis6就报错了。
使用 _wmkdir 方法创建目录失败,如果在 iReturn != 0 时,立即调用 _get_errno ,那么你应该会得到 EEXIST 或 ENOENT 的错误码,你可以试试,然后把错误码贴出来。
不明白,源代码报错这点是这样的, 怎么加get errno
private static void CreateDirectoryUsingDll(DirectoryInfo dir) { // On some occasion, the DirectoryInfo.Create() function will // throw an error due to a bug in the .Net Framework design. For // example, it may happen that the user has no permissions to // list entries in a lower level in the directory path, and the // Create() call will simply fail. // To workaround it, we use mkdir directly. System.Collections.ArrayList oDirsToCreate = new System.Collections.ArrayList(); // Check the entire path structure to find directories that must be created. while (dir != null && !dir.Exists) { oDirsToCreate.Add(dir.FullName); dir = dir.Parent; } // "dir == null" means that the check arrives in the root and it doesn't exist too. if (dir == null) throw (new System.IO.DirectoryNotFoundException("Directory \"" + oDirsToCreate[oDirsToCreate.Count - 1] + "\" not found.")); // Create all directories that must be created (from bottom to top). for (int i = oDirsToCreate.Count - 1; i >= 0; i--) { string sPath = (string)oDirsToCreate[i]; int iReturn = _mkdir(sPath); if (iReturn != 0) throw new ApplicationException("Error calling [msvcrt.dll]:_wmkdir(" + sPath + "), error code: " + iReturn); } }
@..00..: 这不是你写的代码吗?
@Launcher: 不是,我拷贝的,里面的代码我没理解
@..00..: 那你别用 _mkdir 了,还是用 DirectoryInfo.Create 这个方法吧!然后,你得有写的权限,所以你需要给你的应用程序池设置一个具有写权限的帐户,或者为应用程序池账号添加对某一目录写的权限。
@Launcher: 非常感谢,我知道什么错了,我的路径错了,权限也没设置写入。。。。晕