I\'m playing around with C# and I encountered a problem. When I try to make a new file, the program breaks and says that the file is being used by another process. It\'s pro
As per MSDN the File.Create Method (String) uses a FileStream which in your case is not being closed. Use something like this:
FileStream fs = new FileStream(NameTb.Text + ".txt");
File.Create(fs);
fs.Close();
or @Muctadir Dinar
var fileStream = File.Create(NameTb.Text + ".txt");
//... do all the writing using fileStream
fileStream.Close();