Below is the part code I currently use to write to a file,
Try
Using sWriter As New IO.StreamWriter("C:\Tmp.txt", False)
sWriter.Write(m_Buffer.ToString) : sWriter.Flush()
End Using
Return True
Catch ex As IOException
End Try
but some time this results in error
Access to the path 'C:\Tmp.txt' is denied
My question is, Is there a safe way of detecting File access permissions, without handling exceptions, I mean if I can some how check before opening a file for any filehandle opened for it.
I think I have made my point. Thanks in Advance