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
Your problem is that File.Create will open a stream allowing you to do what you like to the file:
http://msdn.microsoft.com/en-us/library/d62kzs03.aspx
A FileStream that provides read/write access to the file specified in path.
Therefore, technically, it is in use already.
Just remove the File.Create altogether. The StreamWriter will handle creating the file if it doesn't exist.
Also, invest in using constructs to properly dispose of your file connections too. Will help avoid this in the future.