Need Help Moving/Copying File
-
How can I copy or move file from one directory to another.
-
How can I copy or move file from one directory to another.
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.
-
How can I copy or move file from one directory to another.
-
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.
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);