Except of course you hopefully aren't storing an unencrypted password in an app/web.config file!
On Sun, Jan 17, 2010 at 2:06 PM, akram mellice <[email protected]> wrote: > an example for using the app.config is that u can store ur database > connection string in it and use it in the application > example: > > <?xml version="1.0" encoding="utf-8" ?> > <configuration> > <configSections> > </configSections> > <appSettings> > <add key="DataBaseConnectionString" > value="Data Source=ServerName;Initial Catalog=DataBaseNAme;Persist > Security Info=True;User ID=UserName;Password=Password" /> > </appSettings> > <connectionStrings /> > </configuration> > > and in the application you can do this: > string connectionString = > ConfigurationSettings.AppSettings["DataBaseConnectionString"]; > > hope that was clear > > On Thu, Jan 14, 2010 at 9:27 PM, Sue <[email protected]> wrote: >> >> Thanks a lot for the info! >> >> On Jan 14, 5:32 am, Anachronistic <[email protected]> wrote: >> > Hi Sue, >> > >> > App.config is exactly what it sounds like: it's an XML-based >> > configuration file that stores information related to the current >> > project (for example, a console or Windows Forms application). >> > >> > It is the sibling to the Web Site Project configuration file >> > Web.config, which is also XML-based. >> > >> > These two configuration files are quite extensible and flexible. >> > You'll come to rely on them. They are also very strict in terms of >> > ordering and syntax; you'll be hard-pressed to do any permanent damage >> > (so no worries there), but they will complain very loudly to you if >> > things aren't as expected. Luckily, the .config files are well-tread >> > in the .NET world and ample documentation and examples exist online. >> > >> > My advice would be to become very acquainted with the MSDN >> > documentation athttp://msdn.microsoft.com/en-us/default.aspxas you >> > will find 90% of your answers within, and it's easy to switch versions >> > (there is documentation for version 2.0 versus 3.0 versus 3.5 for most >> > topics). >> > >> > Hope that helps! >> > >> > Alan >> > >> > http://www.twitter.com/anachronistic > > > > -- > Akram Mellice >
