Protect string content by marshalling
IntPtr bstr = Marshal.SecureStringToBSTR(password); try { // ... // use the bstr // ... } finally { Marshal.ZeroFreeBSTR(bstr); }
DZone Snippets > mstampar > marshalling
12387 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Miroslav Stampar http://mstampar.awardspace.com
IntPtr bstr = Marshal.SecureStringToBSTR(password); try { // ... // use the bstr // ... } finally { Marshal.ZeroFreeBSTR(bstr); }