Hey Hey,

I get a lot of newsletters daily, some of them from Microsoft (just their standard newsletters)...

This weeks contained a link to Spot the Bug... I haven't seen it nor seen it posted before, however some of you may have...

It's actually pretty cool... I'm gonna use it to kill my boredom later

My Only request at this point is that if you spot the bug... keep your post hidden for the rest of us that aren't programmers and wanna give it a try..

http://blogs.msdn.com/rsamona/archive/2006/01.aspx

Code:
class CUserManager
{
public:
  void   CreateLogin(String * strUserName, String * strPassword);
  void   AddLoginToDB(String * strUserName, Byte bytePasswordHash[]);
};
 
int _tmain()
{
  CUserManager objUsrMgr;
 
  String * struser = S"newuser";
  String * struserpass = S"password";
 
  objUsrMgr.CreateLogin(struser, struserpass);
 
  return 0;
}
 
void CUserManager::CreateLogin(String * strUserName, String * strPassword)
{
  System::Text::ASCIIEncoding *pAscii = new System::Text::ASCIIEncoding();
 
  Byte bytePassword[] = pAscii->GetBytes(strPassword);
 
  SHA1CryptoServiceProvider *pSha1 = new SHA1CryptoServiceProvider();
  Byte byteHash[] = pSha1->ComputeHash(bytePassword);  
 
  AddLoginToDB(strUserName, byteHash);
 
  return;
}
 
void CUserManager::AddLoginToDB(String * strUserName, Byte bytePasswordHash [])
{
  //Add the user name and the password hash to the database
  return;
}
Peace,
HT