title: how to resolve system security exception by using vb.net
body: <p>in one of the case i have got the 
   <code>Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED)</code> when am trying to create a file and writing data using file system object in vb.net</p>
  
  <pre><code>DIM fso,file
  const ForWriting = 2
  fso = CreateObject("Scripting.FileSystemObject")
  file= fso.opentextfile("C:\test\log.csv",ForWriting,True)
  file.write("This,is,a,sampledata")
  file.close()
  </code></pre>
  
  <p>How can i sort out this issue, kindly advice.</p>