Hi all,
i want to add my Account Credentials in app.config manually and after that i want to read my credential from app.config in code behind..
plz help thanx...
sumitk
Hi all,
i want to add my Account Credentials in app.config manually and after that i want to read my credential from app.config in code behind..
plz help thanx...
sumitk
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Blocked AccountRank #403 · 6.2K reputationPosted Sep 19, 2012, 7:47 PM EDT
I am enclosing sample project in which I am accessing values from app.config
Blocked AccountRank #403 · 6.2K reputationPosted Sep 18, 2012, 10:24 PM EDT
add key in your App.Config like that
Sumit KumawatRank #4,008 · 372 reputationPosted Sep 19, 2012, 2:02 AM EDT
thanx for the reply but this code is giving null exception.
Blocked AccountRank #403 · 6.2K reputationPosted Sep 19, 2012, 3:23 AM EDT
ConfigurationManager.AppSettings["UserName"].ToString();
Sumit KumawatRank #4,008 · 372 reputationPosted Sep 19, 2012, 3:52 AM EDT
below is my app config
and in code behind ob button click im using this
i tried in every way but still its giving null :(
im not getting why it is happening can u plz share some link or demo project for this.
its will b worthy for me...
thnx
Sumit KumawatRank #4,008 · 372 reputationPosted Sep 19, 2012, 9:18 PM EDT
thanx a lot for ur help...but still there is some problem..
im uploading one demo in which im using ur code but in my project itz still giving a null ex plz have look on my demo im not able to find the reason why null ex coming in my demo...
Blocked AccountRank #403 · 6.2K reputationPosted Sep 19, 2012, 9:40 PM EDT
change one thing in your demo project
Rename your App1.config to App.config
your problem will be resolved.
Sumit KumawatRank #4,008 · 372 reputationPosted Sep 19, 2012, 9:46 PM EDT
Sumit KumawatRank #4,008 · 372 reputationPosted Sep 20, 2012, 1:51 AM EDT
Do u have any idea how to read app config from the window service?
i am writhing the code in on start method same as wpf button click.
i m uploading my demo project.