复制文件夹时权限被拒绝 [英] Permission denied when copying a folder

查看:282
本文介绍了复制文件夹时权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,






它需要能够复制服务器上的文件夹.它将从服务器复制文件夹,并将其放置在同一服务器上的同一目录中.这是我正在使用的代码行:

Hello,
 I am writing an app that will sit on the desktop.  It needs to be able to make a copy of a folder that sits on the server.  It will copy the folder from the server and place it in the same directory on the same server.  This is the line of code that I am using:

System.IO.File.Copy(sDistinationFolder +"NewOrderTemplate",sDistinationFolder + myDate.Date +"_" + mtxtJobNumber.Text);

System.IO.File.Copy(sDistinationFolder + "NewOrderTemplate", sDistinationFolder + myDate.Date + "_" + mtxtJobNumber.Text);

因此,如您所见,我正在复制一个名为"NewOrderTemplate"的文件夹,新副本将称为date_jobnumber.

So, as you can see, I am copying a folder called 'NewOrderTemplate' and the new copy will be called date_jobnumber. 

当我尝试运行此程序时,我总是会被拒绝权限.根文件夹具有完全权限的所有人".

When I try to run this I always get a permission denied.  The root folder has 'everyone' with full permissions.

请帮助.

谢谢,
Michael.

Thanks,
Michael.

推荐答案

我认为有一个文件正在被另一个或您自己的应用程序使用,因为目录中的文件已锁定,所以您无法复制它.

每个目录都会发生这种情况吗?
I geus there is a file in use by an other or your own application, because a file in the directory is locked you can't copy it.

Does this occur with every directory?


这篇关于复制文件夹时权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆