private static bool CanAccessCredentials() { return new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).IsGranted(); } }