Detect if string is numeric
// Detect if a string is numeric
public static bool IsNumeric(string text)
{
return Regex.IsMatch(text,"^\\d+$");
}
-----------------------
Protect string content by marshalling
// Protect string content by marshalling
IntPtr bstr = Marshal.SecureStringToBSTR(password);
try
{
// ...
// use the bstr
// ...
}
finally
{
Marshal.ZeroFreeBSTR(bstr);
}
Friday, March 19, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment