The issue you are getting is because you've just created the file using the line:
using (FileStream fs = File.Create(path))
The file is open at this point, and you then attempt to open the same file again using:
TextWriter sw = new StreamWriter("C:\\mytest.txt");
Use one or the other. Not both.