首页 新闻 赞助 找找看

iis6上传报错

0
悬赏园豆:10 [已解决问题] 解决于 2015-06-25 18:01

用NeatUpload上传时,如下图的报错,我是少配置什么里面,还是什么原因?在本地ii7是好的,服务器上的是iis6就报错了。

..00..的主页 ..00.. | 初学一级 | 园豆:49
提问于:2015-06-25 14:25
< >
分享
最佳答案
0

使用 _wmkdir 方法创建目录失败,如果在 iReturn != 0 时,立即调用 _get_errno ,那么你应该会得到 EEXIST 或 ENOENT  的错误码,你可以试试,然后把错误码贴出来。

收获园豆:10
Launcher | 高人七级 |园豆:45045 | 2015-06-25 14:55

不明白,源代码报错这点是这样的, 怎么加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.. | 园豆:49 (初学一级) | 2015-06-25 15:37

@..00..: 这不是你写的代码吗?

Launcher | 园豆:45045 (高人七级) | 2015-06-25 15:38

@Launcher: 不是,我拷贝的,里面的代码我没理解 

..00.. | 园豆:49 (初学一级) | 2015-06-25 15:51

@..00..: 那你别用 _mkdir 了,还是用 DirectoryInfo.Create 这个方法吧!然后,你得有写的权限,所以你需要给你的应用程序池设置一个具有写权限的帐户,或者为应用程序池账号添加对某一目录写的权限。

Launcher | 园豆:45045 (高人七级) | 2015-06-25 15:56

@Launcher: 非常感谢,我知道什么错了,我的路径错了,权限也没设置写入。。。。晕

..00.. | 园豆:49 (初学一级) | 2015-06-25 17:45
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册