Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8458267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:01:51+00:00 2026-06-10T13:01:51+00:00

I searched SO and found some posts, but could not get them to work.

  • 0

I searched SO and found some posts, but could not get them to work.

Question: How would I loop to the next item in my List Collection (custLoginHist[1] etc)?

    List<eCommCustomer.oCustomer> custLoginHist = new List<eComm.oCustomer>();
    eCommCustomerDAL.GetCustomerPrevLogin(custLoginHist, oCust);

    if (custLoginHist.Count > 0)
    {
        eCommSecurityFactory oSecFactory = new eCommSecurityFactory();
        if (oCust.CustHash == oSecFactory.CreateHash(custLoginHist[0].CustSalt, custLoginHist[0].CustHash))
        {
            //Password has been used before;
            return false;
        }
        else
        {
            // Valid password;
            return true;
        }
    }
    return true;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:01:52+00:00Added an answer on June 10, 2026 at 1:01 pm
    foreach(eCommCustomer.oCustomer cust in custLoginHist)
    {
      //Do something with cust here.
    }
    

    OR:

    for(int i = 0; i != custLoginHist.Count; ++i)
    {
      eCommCustomer.oCustomer cust = custLoginHist[i];
      //Do something with cust here.
    }
    

    In this case, we want to return false for any single match, and true otherwise, so:

    foreach(eCommCustomer.oCustomer cust in custLoginHist)
      if(oCust.CustHash == oSecFactory.CreateHash(custLoginHist[0].CustSalt, custLoginHist[0].CustHash)
        return false;
    return true;//if we reached here, no matches.
    

    This is a bad idea though, because you’ve made breaking into the system easier. If I try to set my password to something, and you refuse, I now know that one of your users uses that password. You are much better off letting this case happen, though you should perhaps be blocking some of the more likely offenders (“password”, “password1”, etc) with a quality check.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched for an answer and found some c#-examples, but could not get this
I searched and found three fairly good posts but all of them were animating
I've searched and I found some things about compiling to JARs in Eclipse, but
I searched through here as best I could and though I found some relevant
Searched around on SO for an answer. Found some interesting stuff but I am
I have searched and found another with quite close question but the result was
I've searched the site for similar posts but i found just one where the
I've searched extensibly but haven't found anything useful. I am wondering if it would
I searched (trust me!) but for some reason, haven't quite found the answer I'm
Can you please give me advise? I searched for questions but did not found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.