I need to write contents of a file to another file using File.OpenRead and File.OpenWrite methods. I am unable to figure out how to do it.
How can i modify the follo
You should be using File.Copy unless you want to append to the second file.
File.Copy
If you want to append you can still use the File class.
string content = File.ReadAllText("C:\\file1.txt"); File.AppendAllText("D:\\file2.txt",content);