Not really, I assume you're worried about things like passwords ending
up in the page file and the like. MS introduced the SecureString in V2,
then revoked it in V3 (at least stopped using it) as it's just not
secure. You can also try playing with volatile char arrays, I've heard
that's an option in that you can be (fairly) sure it's overwritten when
you overwrite each element. I recall issues with volatile, but I don't
use it so don't know what they are. There are also some Win32 API calls
which can allocate a bit of the page file (working from memory here,
basically just google password dotnet secure, that sort of thing) but
again that's problematic.
Sorry for being nebulous, I did look at this a while ago and came to
the conclusion that no there's no bulletproof way of protecting
strings, just try and hold them in memory for the shortest period
possible.
Mark C wrote:
> I know a string is immutable, but is there any trick or any other way
> to destroy a string
>
> Thanks
> www.quiznetonline.com