
/// <summary>
/// 指定路径移动文件夹
/// 注意:
/// ① 文件夹的移动只能在同一盘符内部实现移动
/// ② 文件夹的移动要求原路径文件夹必须存在,新路径文件夹必须不存在
/// </summary>
/// <param name="oldPath">移动原路径</param>
/// <param name="newPath">移动后路径</param>
public void moveMyDirectory ( string oldPath, string newPath )
{
if ( Directory.Exists ( oldPath ) && !Directory.Exists ( newPath ) )
{
Directory.Move ( oldPath, newPath );
MessageBox.Show ( "移动成功!" );
}
else
{
MessageBox.Show ( "原路径文件夹不存在或新路径文件夹已存在!" );
}
}




by: 发表于:2018-02-02 09:54:02 顶(0) | 踩(0) 回复
??
回复评论