string lstrFileFolder = HttpContext.Current.Server.MapPath(Com.Common.m_folderData); 
            
string subFolder = System.DateTime.Today.AddDays(-1).ToString("yyMMdd");
            
string newFolder = System.DateTime.Today.ToString("yyMMdd");
            
string path = lstrFileFolder + subFolder;
            
//判断目录是否存在,存在则改名 
            if (Directory.Exists(path))
           
 newFolder;
            }

 

System.IO.Directory.Move("源目录","新目录");  
  OR   

 

  项目->引用     浏览     COM组件     Microsoft     Scripting     Runtime     ,  
          Scripting.FileSystemObject     fso=new     Scripting.FileSystemObjectClass();      
  fso.GetFolder("目录").Name="新目录名";

 

关于Scripting Runtime 对象的官方说明:

An Introduction to the Scripting Runtime Object Library

http://msdn.microsoft.com/en-us/library/aa155438(office.10).aspx

相关文章:

  • 2021-05-31
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-03-05
  • 2022-12-23
猜你喜欢
  • 2021-04-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-03-15
相关资源
相似解决方案