Re: Structure analogous to web.config in a windows application???
From: Tal Sharfi (talsharf_at_netvision.net.il)
Date: 09/21/04
- Next message: Matt Berther: "Re: Structure analogous to web.config in a windows application???"
- Previous message: Sean Fullerton: "Any thoughts on providing search functions in a win app"
- In reply to: Novice: "Structure analogous to web.config in a windows application???"
- Next in thread: Matt Berther: "Re: Structure analogous to web.config in a windows application???"
- Reply: Matt Berther: "Re: Structure analogous to web.config in a windows application???"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 22 Sep 2004 00:00:36 +0200
hi
you can use the App.Config file. if you don'a have it yet on your project,
then, right click the project in the solution explorer->add new item->
choose 'Application Configuration'.
then edit it to something like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="MyKey" value="MyData" />
</appSettings>
</configuration>
and then you can access the data in the code by using:
using System.Configuration;
AppSettingsReader appSettings = new AppSettingsReader();
objetc = appSettings.GetValue("MyKey",typeof(System.String));
hope that will help
Tal Sharfi
"Novice" <6tc1ATqlinkDOTqueensuDOTca> wrote in message
news:1524CEA0-B8E0-4B94-86C5-B8D6C7286586@microsoft.com...
> Hey everyone - is there a file in a windows application that is analogous
> to
> the web.config in ASP.NET applications?
>
> Basically, I want to store a bunch of strings (that are NOT confidential)
> in
> a common configuration file and that I can easily access like the
> web.config
> file for ASP.NET applications.
>
> In summary I would like a place to store configuration information for a
> windows application and the methods I use to access that information.
>
> Thanks,
> Novice
- Next message: Matt Berther: "Re: Structure analogous to web.config in a windows application???"
- Previous message: Sean Fullerton: "Any thoughts on providing search functions in a win app"
- In reply to: Novice: "Structure analogous to web.config in a windows application???"
- Next in thread: Matt Berther: "Re: Structure analogous to web.config in a windows application???"
- Reply: Matt Berther: "Re: Structure analogous to web.config in a windows application???"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|