سؤال
اريد نسخ ملف من أ إلى ب في C#.كيف أفعل ذلك ؟
المحلول
الملف.نسخ الطريقة:
نصائح أخرى
دون أي معالجة الأخطاء البرمجية:
File.Copy(path, path2);
استخدام FileInfo الدرجة.
FileInfo fi = new FileInfo("a.txt");
fi.CopyTo("b.txt");
النظام.IO.الملف.نسخ
هذا يجب أن تعمل!
using System.IO;
...
var path = //your current filePath
var outputPath = //the directory where you want your (.txt) file
File.Copy(path,outputPath);
لا تنتمي إلى StackOverflow