app.config After Deployment RRS feed

  • General discussion

  • See This Code

    //app.config File

    <?xml version="1.0" encoding="utf-8" ?>
            <add name="ConnString"
                connectionString="Data Source=Pc-3\SQLEXPRESS;Initial Catalog=MyDataBase;Persist Security Info=True;User ID=sa;Password=p@ssw0rd"
                providerName="System.Data.SqlClient" />


    After Deployement I Can Change The The Database Name,Server Name  And Password For That Location It Is Not Secur Way To Store The Connection String Coz Any One Can Go And Get Server Password I Wnt That User Can Chane The Database Name,Server Name  And Password Bt When He Open That File Dnt Wnt To Show The Current Server Password Wnt It To Be Hide But At The Same Time If I Install That Application More Than one Pc Wnt To Set Or Reset Server Name And Password How I Achive Such Thing.......

    Wednesday, May 4, 2011 11:33 AM

All replies

  • Hi there,

    I think you are asking, "Is it possible to encrypt the password so that my users cannot go and find out what it is?"

    You should think about integrated security wherever possible - if that is not an option and you need to store passwords, why don't you encrypt with one of the .NET encryption routines, and then decrypt when you access the setting?

    Have a look here for some code

    Tuesday, May 29, 2012 7:52 AM