String In Csharp

 

Saturday, May 30, 2009

Protect string content by marshalling

// Protect string content by marshalling

IntPtr bstr = Marshal.SecureStringToBSTR(password);

try
{
// ...
// use the bstr
// ...
}
finally
{
Marshal.ZeroFreeBSTR(bstr);
}

No comments:

Post a Comment

All Menu