title: Visual basic closing a file
body: <p>I'm using Visual basic 2012, and I'm experimenting with manipulating .txt files. I've managed to make a button to create them, but the button I made to delete them always runs into and error, claiming the file is still in use. I've tried to write code to close the file, but no success. The closest I've gotten was when I tried</p>
  
  <pre><code>    FileStream.Close("C:\Testfile")
  </code></pre>
  
  <p>But I get an error saying that It needs to be linked to an object. I don't have the faintest idea what it mean by object, and I don't have any other ideas
  Can someone tell me what I need to do to fix this, or alternatively, another solution</p>