Copy file from one directory to another

后端 未结 5 425
执笔经年
执笔经年 2021-01-28 13:11

I am pretty new to C# and I am trying to get my program to copy a file from one location to another. The method I have is as below;

    private void CopyInstallF         


        
5条回答
  •  不知归路
    2021-01-28 13:55

    Either FIle.Copy Move it to new location like below

    new_file_path = file_path.Replace(".xls", " created on " + File.GetLastWriteTime(file_path).ToString("dd-MM-yyyy hh-mm-ss tt") + ".xls");
                            File.Move(file_path, new_file_path);
                            File.Delete(file_path);
    

提交回复
热议问题