Is there a way to prevent .NET from ever disk caching a variable?
I'm not开发者_JAVA技巧 sure I wrote the headline right, but I've got a service that holds a password in memory. It's notification thing, and so will be running 24/7 ideally.
It uses a password to some other resources that I send to it at startup in a UPD packet.
I'd like to find a way to instruct windows never to stick that value in the disk cache so if the worst happened, the theoretical bad guy couldn't pick apart the cache and find the password.
Can someone please point me in the right direction to figuring out how to do this?
You should use the SecureString
class.
精彩评论