Thanks.
FileInfo sm = new FileInfo(@"C:\Users\Totiruzi\Desktop\English to Russian.txt");
sm.CopyTo(Environment.GetFolderPath(Environment.SpecialFolder.SendTo)+@"G:\English to Russian.txt");
Console.WriteLine("Has English to Russian been copied to G?");
Console.ReadKey();
VulpesPosted Nov 4, 2013, 6:16 AM
Tito OnowuPosted Nov 4, 2013, 6:21 AM
Tito OnowuPosted Nov 4, 2013, 6:19 AM
Sanjeeb LenkaPosted Nov 4, 2013, 6:09 AM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace IfExample
{
class CopyFile
{
static void Main()
{
string oldPath = @"C:\Users\Totiruzi\Desktop\English to Russian.txt";
string newpath = @"G:\";
string newFileName = "English to Russian.txt";
FileInfo f1 = new FileInfo(oldPath);
if (f1.Exists)
{
f1.CopyTo(string.Format("{0}{1}{2}", newpath, newFileName, f1.Extension));
}
Console.WriteLine("Has English to Russian been copied to G?");
Console.ReadKey();
}
}
}