C# Frequently Asked QuestionsThe C# team posts answers to common questionsHow do I send out simple debug messages to help with my debugging- October 9, 2006 Visual Studio offers tons of useful debugging features and allows you to step through your code line-by-line. However, there are times when you dont want to step through your application, but want to make it output simple text strings with variable values, etc. Enter the System.Diagnostics.Debug class and its Write methods. By using the Debug class, you can output messages similarly to the way the Win32 API function OutputDebugString. However, the beauty of the Debug class is that when you...http://blogs.msdn.com/csharpfaq/archive/2006/10/09/How-do-I-send-out-simple-debug-messages... How do I calculate a MD5 hash from a string- October 9, 2006 It is a common practice to store passwords in databases using a hash. MD5 (defined in RFC 1321) is a common hash algorithm, and using it from C is easy. Heres an implementation of a method that converts a string to an MD5 hash, which is a 32-character string of hexadecimal numbers.public string CalculateMD5Hash(string input) step 1, calculate MD5 hash from input MD5 md5 = System.Security.Cryptography.MD5.Create(); byte inputBytes = System.Text.Encoding.ASCII.GetBytes(input); ...http://blogs.msdn.com/csharpfaq/archive/2006/10/09/How-do-I-calculate-a-MD5-hash-from-a-st... |