Over a million developers have joined DZone.

Protect String Content By Marshalling

·

IntPtr bstr = Marshal.SecureStringToBSTR(password);
    
try
{
    // ...
    // use the bstr
    // ...
}
finally
{
    Marshal.ZeroFreeBSTR(bstr);
}

Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}