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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:58:10+00:00 2026-06-05T04:58:10+00:00

i already have a phpcode with hard coded values, $username = abcd; $password =

  • 0

i already have a phpcode with hard coded values,

$username = "abcd";
$password = "abcd123";

now i wanted to put those values to web.config file.here is my work,but something wrong here.

<appSettings>
<add key="username" username="abcd"/>
<add key="password" password="abcd123"/>
<appSettings/>

so.. is there any problem ? and i also wanted to know how can i take this settings to aspx.cs file.. i mean [configurationmanager] something

  • 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-05T04:58:12+00:00Added an answer on June 5, 2026 at 4:58 am

    You need to declare them with the key and value properties instead, like so:

    <appSettings>
       <add key="username" value="abcd"/>
       <add key="password" value="abcd123"/>
    <appSettings/>
    

    If you want the basics, you can access the keys via:

    string username = System.Configuration.ConfigurationManager.AppSettings["username"].ToString();
    string password = System.Configuration.ConfigurationManager.AppSettings["password"].ToString();
    

    To access my web config keys I always make a static class in my application. It means I can access them wherever I require and I’m not using the strings all over my application (if it changes in the web config I’d have to go through all the occurrences changing them). Here’s a sample:

    using System.Configuration;
    
    public static class AppSettingsGet
    {    
        public static string Username
        {
            get { return ConfigurationManager.AppSettings["username"].ToString(); }
        }
    
        public static string Password
        {
            get { return ConfigurationManager.AppSettings["password"].ToString(); }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I already have a web application that allows my clients to scanner documents from
I already have a relative_layout.xml and it contains sub layouts. Now I've to add
i have already configured SMS gateway & some php code.Now my project is thatone
This is my php code (I already have a connection to the db): $result
I already have the dragging and dropping of a UIImageView to another UIImageView but
I already have an development certificate in apple developer portal . Am developing an
I already have a function on my page that produces url from curl. I
I already have a working android app with several persisted objects/classes. But what if
I already have the action viewed approved. I want to add another object to
I already have the automatically generated back button in the top left corner, but

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.