Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Need Help Moving/Copying File

Need Help Moving/Copying File

Scheduled Pinned Locked Moved C#
helpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Saiyed Alam
    wrote on last edited by
    #1

    How can I copy or move file from one directory to another.

    V A 2 Replies Last reply
    0
    • S Saiyed Alam

      How can I copy or move file from one directory to another.

      V Offline
      V Offline
      Vikram A Punathambekar
      wrote on last edited by
      #2

      http://www.google.co.in/search?hl=en&q=c%23+copy+files&meta=[^]

      Cheers, Vikram.


      The hands that help are holier than the lips that pray.

      A 1 Reply Last reply
      0
      • S Saiyed Alam

        How can I copy or move file from one directory to another.

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        Sytem.IO.File.Copy("Try reading the books","or use Google, lazy")

        Bob Ashfield Consultants Ltd

        1 Reply Last reply
        0
        • V Vikram A Punathambekar

          http://www.google.co.in/search?hl=en&q=c%23+copy+files&meta=[^]

          Cheers, Vikram.


          The hands that help are holier than the lips that pray.

          A Offline
          A Offline
          Abdul Gafoor
          wrote on last edited by
          #4

          Lets copy file in asynchronously

          FileStream sourceFile = new FileStream(.....);
          FileStream destinationFile = new FileStream(....);

          byte[] buffer = new byte[BUFFER_LENGTH];
          AsyncCallback readCallback = null;
          readCallback = delegate(IAsyncResult readResult)
          {
          int byteRead = sourceFile.EndRead(readResult);
          destination.BeginWrite(buffer,0,byteRead,new AsyncCallback(delegate(IAsyncResult writeResult)
          {
          desitnationFile.EndWrite(writeResult);
          destinationFile.Flush();
          sourceFile.BeginRead(buffer,0,buffer.Length,readCallback,null);
          }),null);
          };

          sourceFile.BeginRead(buffer,0,buffer.Length,readCallback,null);

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups