现在要将服务器上一个共享目录中的一个文件删除,系统提示如下信息:“Access to the path '\\2003jpsvr\encode\test\mastInfo\0000\0000\0006\0000-0000-0006-006-0-01-0-02-1024x768.WMV' is denied.“
请问 这是何种原因造成??
有何解决方案??
望各位大虾不惜赐教!!!我的删除文件代码 如下:
if (File.Exists(rootpath + dstpath))
{
//获取文件信息
FileInfo fi = new FileInfo(rootpath + dstpath);
if (fi.Attributes.ToString().IndexOf("ReadOnly") !=-1)
{
//文件属性更改
fi.Attributes = FileAttributes.Normal;
}
//文件删除
Functions.DeleteFile(rootpath + dstpath);
}
请问 这是何种原因造成??
有何解决方案??
望各位大虾不惜赐教!!!我的删除文件代码 如下:
if (File.Exists(rootpath + dstpath))
{
//获取文件信息
FileInfo fi = new FileInfo(rootpath + dstpath);
if (fi.Attributes.ToString().IndexOf("ReadOnly") !=-1)
{
//文件属性更改
fi.Attributes = FileAttributes.Normal;
}
//文件删除
Functions.DeleteFile(rootpath + dstpath);
}
解决方案 »
- Visual2010发布application后,安装的问题,谢谢
- 如何在ASP.net中创建Excel并设置Excel导出样式
- MDI子窗体的背景色可调吗?好像都是灰色的
- VS2005 安装后调试时从提示:"邦定句柄无效,无法启动调试项目"
- 基本的技术难题!
- 打包问题
- 数据库的删除~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 各位进来看看了!!!!
- 有人有c#做的时钟程序源代码吗?急用
- 取DataSet中指定数据的方法!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- windows窗体的Language问题
- TabControl小问题,请救!
-----------原因
如果在将服务器提升为域控制器之前在其上安装了 Microsoft Internet 信息服务 (IIS) 6.0 和 ASP.NET,就会出现这个问题。如果存在以下情况,并且这些情况按以下顺序发生,就会出现这个问题: 1. 您在一台成员服务器上安装了 IIS 6.0 和 ASP.NET。
2. 您使用 Dcpromo.exe 工具将该成员服务器提升为域控制器。
3. 您在该域控制器上安装了 Windows SharePoint Services。
在这种情况下,Network Service 组对域控制器上的 Temporary ASP.NET Files 文件夹没有足够的权限。解决方案
要解决此问题,请按照下列步骤操作: 1. 单击“开始”,然后单击“运行”。
2. 在“打开”框中,键入 cmd,然后单击“确定”。
3. 转到 Drive:\Windows\Microsoft.Net\Framework\v1.1.4322 文件夹,其中 Drive 是安装了 Windows 的驱动器。为此,请在命令提示符处键入以下行(其中 Drive 是安装了 Windows 的驱动器),然后按 Enter:
cd Drive:\windows\microsoft.net\framework\v1.1.4322
4. 为 Network Service 组添加对 Temporary ASP.NET Files 文件夹的适当权限。为此,请键入以下行,然后按 Enter:
aspnet_regiis -ir