1 string pLocalFilePath ="";//要複製的文件路徑 2 string pSaveFilePath ="";//指定存儲的路徑 3 if (File.Exists(pLocalFilePath))//必須判斷要複製的文件是否存在 4 { 5 File.Copy(pLocalFilePath, pSaveFilePath, true);//三個參數分別是源文件路徑,存儲路徑,若存儲路徑有相同文件是否替換 6 }
1 string pLocalFilePath ="";//要複製的文件路徑 2 string pSaveFilePath ="";//指定存儲的路徑 3 if (File.Exists(pLocalFilePath))//必須判斷要複製的文件是否存在 4 { 5 File.Copy(pLocalFilePath, pSaveFilePath, true);//三個參數分別是源文件路徑,存儲路徑,若存儲路徑有相同文件是否替換 6 }