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

  • SEARCH
  • Home
  • 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 7847933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:02:57+00:00 2026-06-02T18:02:57+00:00

Can anyone help with some problems I have. I am trying to create an

  • 0

Can anyone help with some problems I have. I am trying to create an self made authentication method, im abit stuck in a few areas and was hoping some one could help. First thing I would like to ask is how to solve the problem I have commented in the code:

    public string Authentication(string studentID, string password)
    {
        var result = students.FirstOrDefault(n => n.StudentID == studentID);
        //find the StudentID that matches the string studentID 
        if (result != null)
        //if result matches then do this
        {
            //---------------------------------------------------------------------------- 
            byte[] passwordHash = Hash(password, result.Salt);
            string HashedPassword = Convert.ToBase64String(passwordHash);
            //----------------------------------------------------------------------------
            // take the specific students salt and generate hash/salt for string password (same way student.Passowrd was created)

            System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
            byte[] UserPassword = enc.GetBytes(HashedPassword);
            UserPassword.SequenceEqual(result.Password); // byte[] does not contain a definition for SequenceEqual?
            //check if the HashedPassword (string password) matches the stored student.Password
        }
        return result.StudentID; 
        //if string password(HashedPassword)  matches stored hash(student.Passowrd) return student list 


        //else return a message saying login failed 
    }
  • 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-02T18:02:58+00:00Added an answer on June 2, 2026 at 6:02 pm

    “Cannot be used like a method” is likely because you added brackets: result.Password() if it is a property drop the brackets result.Password. Adding the brackets makes the compiler attempt to compile it as a method call when in fact it is a property or field.

    The second error is you are trying to return students, which is a list of students. The method requires a string as a return value. Did you mean to instead return result.StudentID;? The exception is detailing the failed attempt at compiling the cast from List<Student> to string.

    I cannot offer any advice on the second half of your questions.

    Update

    You are expected to find a method called SequenceEqual on byte[]. This is a Linq extension method so you may need to add:

    using System.Linq;

    To the top of your file.

    You will then likely get an error trying to pass a string to this method: SequenceEqual(result.Password);.

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

Sidebar

Related Questions

Can anyone help? I have some code that is shared between 2 projects. The
Can anyone suggest some good browser add-on tools/extensions to help with development? I have
I was wondering if anyone can help me write some code for the following
Are there some help resources, or can anyone give me a brief Idea how
Can anyone help me with the trying to write SQL (MS SqlServer) - I
can anyone help me in trying to check whether JavaScript is enabled in client
Can anyone help? I have been using the entity framework and its going well
Can any one please help me solve this. I am resizing some flash object/embed
Can anyone help me to figure out the the use of yield and return
can anyone help me with construction of an IF in a stored procedure in

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.