C# Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 929 Page Views: 

Write a code to copy file from path1 to path2 using FileStreams and BinaryReader, BinaryWriter



Posted By: Avi Date: 14 October 2010 08:00:46 PM
 Answer:

s1 = new FileStream(path1, FileMode.Open, FileAccess.Read); s2 = new FileStream(path2, FileMode.CreateNew, FileAccess.Write); Br =new BinaryReader(s1); BW = new BinaryWriter(s2); byte bRead; for(int i = 0; i < br.BaseStream.Length(); i++) { bRead = br.R


Posted By: avibtech


Date: 14 October 2010 08:00:46 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image IXTF7H
Related Questions
C# : What does the function String.IsNullOrEmpty returns?

What does the function String.IsNullOrEmpty returns?

It returns true if string is empty or null, else false
Category: C# Date: 10/13/2010 4:29:31 PM
C# : Will this code compile: public static const int A = 10;

Will this code compile: public static const int A = 10;

No, const cannot be static
Category: C# Date: 10/13/2010 4:19:46 PM
C# : What will be the output of code:
int x = 0;
do
{
Console.Write(x++);
} while(x<5);
C# : What is Graphics object and how do you use it?

What is Graphics object and how do you use it?

Graphics class encapsulates GDI+ drawing surface. Grp.DrawLine(new Pen(Color.Black, 3), 10.0, 50, 34....
Category: C# Date: 10/13/2010 3:26:47 PM
C# : How do you define class that uses generic type?

How do you define class that uses generic type?

class Name<T> {}
Category: C# Date: 10/13/2010 3:10:32 PM