Hi group,
I want my app to show a msg if my it doesn't have the required
permission(s), however this simply doesn't work.
What am I overlooking/doing wrong??
[VB.NET]
Try
Dim x As New SecurityPermission(SecurityPermissionFlag.Unmanage dCode)
x.Flags = Security.Permissions.SecurityPermissionFlag.Unmana gedCode
x.Demand()
MessageBox.Show("YES UnmanagedCode permission")
Catch ex As Exception
MessageBox.Show("NO UnmanagedCode permission")
' application.exit
End Try
To ensure that my app doesn't have UnmanagedCode permission I run it from
a network share. But the app always claims to have unmanaged permission.
Trying a pinvoke (=unmanaged) for instance gives a security exception.
TIA,
Marius.