Creating and writting file
string path = "C:\\mytest.txt";
if (File.Exists(path))
{
File.Delete(path);
}
using (FileStream fs = File.Create(path))
{
//fs.Close();
// fs.CanWrite = true;
TextWriter sw = new StreamWriter("C:\\mytest.txt");//error is coming here
sw.WriteLine("ddd", "dddd", "dsdsd");
--------------
-------------
--------
}
I am trying to create and write to text file but is giving error file is being used by another person