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 7179371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:07:36+00:00 2026-05-28T17:07:36+00:00

For my application, i have a part where all the settings are. This can

  • 0

For my application, i have a part where all the settings are. This can be accessed by clicking the settings button.
Now, what i want to do, i before it pops up the settings, add a small login screen, so that only an admin can change the settings.

At first i thought of keeping it very simple by just add a default username “Admin” and password “AdminPass”
This i would just check if the userinput is the same as what it should be in code, and if it is the dame it will continue.

But there is a downside at this, the username and pass are hardcoded inside, so it cant be changed anymore within the application. (unless i would do it in the settings, but that is just a xml that can be read outside the app, and thus not a correct solution).

So i wonder, what would be the best approach for this problem ? So that after logging in the first time with the default, the admin can change the admin pass, and this is saved into the application (and thus is saved after the application restarts).

  • 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-05-28T17:07:37+00:00Added an answer on May 28, 2026 at 5:07 pm

    One way could be to get the hash of password and store in a text file. Then when user enter the password, hash it. Match with the hash stored in the text file. If it matches you can allow login.

    Similarly if user decides to change the password, replace the old hash with the new one

    You can use this code for hashing the password

    public static string EncodePassword(string password)
    {  byte[] bytes   = Encoding.Unicode.GetBytes(password);
       byte[] inArray = HashAlgorithm.Create("SHA1").ComputeHash(bytes);
       return Convert.ToBase64String(inArray);
    }
    

    You can also save this information in application configuration file

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

Sidebar

Related Questions

I have a regular .NET application. In this case I have a part that's
We have a part of an application where, say, 20% of the time it
For part of my application I have a need to create an image of
I have web application of which major part is javascript. I request images from
I have an application that I have to run as Administrator. One small part
We have an application that is being moved to .NET. One part of the
I have an application that uses Hibernate for its domain objects. One part of
I am writing a little application in android which would have a server part
I have a WCF service as part of a client/server application I am working
I have a UserControl that is part of my application, I am rendering it

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.