public void AddNewUser(userDetails prUser) { int iNewID = GetNewUserID(0); int iExtra = 0; // Make sure the generated ID is not already in use while (true) { if (mUsersOnline.ContainsKey(iNewID)) { iExtra++; iNewID = GetNewUserID(iExtra); } else break; } mUsersOnline.Add(iNewID, prUser); // Update max user key mMaxUserKey = GetLargestKeyUserDict(); SendUserListToTutors(); }
// Check the password against a user public bool VerifyPassword(userDetails prUser) { foreach (KeyValuePair<int, TutorDetails> iUser in mTutors) { // Find the username if (iUser.Value.Name == prUser.Username) { // Check the pass if (iUser.Value.Password == prUser.Password) { return true; } } } return false; }
private void btnSendMsg_Click(object sender, EventArgs e) { userDetails iTempAdmin = new userDetails(); mIOProcessor.ParseNewString("I;" + txtCommandLine.Text, iTempAdmin); }