Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否存在移动/重命名asp.net文件夹的问题?_Asp.net - Fatal编程技术网

是否存在移动/重命名asp.net文件夹的问题?

是否存在移动/重命名asp.net文件夹的问题?,asp.net,Asp.net,我想用asp.net重命名文件夹: string oldFolderTitlePath = ServerPhyscialPath + oldFolderTitle + "/"; string newFolderTiltePath = ServerPhyscialPath + newFolderTille+ "/"; DirectoryInfo diPath = new DirectoryInfo(oldFolderTitlePath); if(diPath.Exists) { ///N

我想用asp.net重命名文件夹:

string oldFolderTitlePath = ServerPhyscialPath + oldFolderTitle + "/";
string newFolderTiltePath = ServerPhyscialPath + newFolderTille+ "/";

DirectoryInfo diPath = new DirectoryInfo(oldFolderTitlePath);

if(diPath.Exists)
{
   ///Now move(Rename) folder on the server         
   Directory.Move(oldFolderTitlePath, newFolderTiltePath);               
}
我想知道旧文件夹是否包含大量文件,大小是否超过1GB。在asp.net上重命名文件夹会花费很多时间吗


提前谢谢。

一般来说,不需要花很多时间。您基本上是在更改目录的名称,而不是在磁盘上移动其内容

也就是说,我会非常小心地做你正在做的事情。我总是对来自ASP.NET的IO操作保持警惕——原因是:许多用户可能同时执行此代码。这可能会导致各种各样的问题。您需要确保此操作是线程安全的(可能通过锁定静态变量)


您是否已经在测试环境中对其进行了测试?你无论如何都应该这样做,它会为你回答你的问题。奇怪的问题。您是否有问题,或者您是否询问它是否会导致问题(您希望/有什么问题类型?)?我感觉当您这样做时,应用程序将被回收。