Copying A File : File Info : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » File Info »

 

Copying A File








    

/*
 * C# Programmers Pocket Consultant
 * Author: Gregory S. MacBeth
 * Email: gmacbeth@comporium.net
 * Create Date: June 27, 2003
 * Last Modified Date:
 * Version: 1
 */
using System;
using System.IO;

namespace Client.Chapter_11___File_and_Streams
{
  public class CopyingAFile {
    static void Main(string[] args)
    {
      FileInfo MyFile = new FileInfo(@"c:\Projects\Testing.txt");

      MyFile.Create();
      MyFile.CopyTo(@"c:\Projects\MyFolder\Moved Testing.txt");

      //or
      MyFile.CopyTo(@"c:\Projects\MyFolder\Moved Testing.txt", true);
    }
  }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo File Stream
» File Info