Pregunta

Quiero copiar un archivo desde a hasta B en C#.¿Cómo puedo hacer eso?

¿Fue útil?

Solución

El Archivo.El método de copia:

Enlace de MSDN

Otros consejos

Sin ningún tipo de control de código de error:

File.Copy(path, path2);

El uso de la clase FileInfo.

FileInfo fi = new FileInfo("a.txt");
fi.CopyTo("b.txt");

Sistema.IO.Archivo.Copia

Esto debería funcionar!

using System.IO;

...

var path = //your current filePath
var outputPath = //the directory where you want your (.txt) file


File.Copy(path,outputPath);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top