
/// <summary>
/// 指定路径移动(剪切)文件
/// 注意:文件的移动要求原路径文件必须存在,新路径文件必须不存在
/// </summary>
/// <param name="oldPath">原路径</param>
/// <param name="newPath">新路径</param>
public void moveMyFile ( string oldPath, string newPath )
{
if ( File.Exists ( oldPath ) && !File.Exists ( newPath ) )
{
File.Move ( oldPath, newPath );
MessageBox.Show ( "移动(剪切)成功!" );
}
else
{
MessageBox.Show ( "原路径文件不存在或新路径文件已存在!" );
}
}




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