How do I check if access to a storage device(USB flash drive) is denied or not via c#?

I am writing a program to monitor connected devices and need to do some actions if the flash drive is blocked(access is denied, third-party software is responsible for blocking the flash drives). How do I check if I have access to a flash drive or not? I can't find a way or I'm not looking well...

Author: Sebastian1, 2020-11-10