I'm trying to check a file for its security permissions to determine if it is writeable or not.
The code looks like that:
Function IsFileWritePermission(ByVal sFileName As String) As Boolean
Dim fp As FileIOPermission
fp = New FileIOPermission(FileIOPermissionAccess.Write, sFileName)
Catch ex As Security.SecurityException
Catch ex As Exception
The file i'm testing has a Deny Write permission and the function still return true. If I try to open the file to write, it raises an error exception for write permission.