replacement of INI Files
-
Hi all, I want to know that what is replacement of the INI files Actually i have to save some settings like open connection, forms colorings etc in the settings files So what type of file i have to use in Vb2005 XML / Config/Settings what r they???? Thanks in advance Regards Hema Chaudhry
-
Hi all, I want to know that what is replacement of the INI files Actually i have to save some settings like open connection, forms colorings etc in the settings files So what type of file i have to use in Vb2005 XML / Config/Settings what r they???? Thanks in advance Regards Hema Chaudhry
the app.config file is just an XML file. You can actually do some fairly funky stuff with .NET 2.0 with regard to config files. The basics are that you have:
<appSettings>
<add key="mySetting" value="someValue" />
</appSettings>Which you can read with the
ConfigurationSettings
class in theSystem.Configuration
namespace ConfigurationSettings.AppSettings["mySetting"]; ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell -- modified at 8:56 Wednesday 18th January, 2006 -
the app.config file is just an XML file. You can actually do some fairly funky stuff with .NET 2.0 with regard to config files. The basics are that you have:
<appSettings>
<add key="mySetting" value="someValue" />
</appSettings>Which you can read with the
ConfigurationSettings
class in theSystem.Configuration
namespace ConfigurationSettings.AppSettings["mySetting"]; ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell -- modified at 8:56 Wednesday 18th January, 2006Thanks for the prompt & precise answer. I have to perform both read as well as write operation also AS i have to write some settings as well as read some settings Then what is the baest approach To create a simple XML file & perform Reda write operation Or something else is the better approach Thanks for this kind support Hema Chaudhry
-
Thanks for the prompt & precise answer. I have to perform both read as well as write operation also AS i have to write some settings as well as read some settings Then what is the baest approach To create a simple XML file & perform Reda write operation Or something else is the better approach Thanks for this kind support Hema Chaudhry
The System.Configuration[^] has a number of classes that help you do this. As you are using .NET 2.0, if you look at the documentation for ConfigurationManager[^] it will show some example code that that will help (also, the examples for the related classes) ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
-
The System.Configuration[^] has a number of classes that help you do this. As you are using .NET 2.0, if you look at the documentation for ConfigurationManager[^] it will show some example code that that will help (also, the examples for the related classes) ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Thanks for this Useful direction I ahve seen the Configuration Manger Class I think It will fit to my requirement Thanks a lot To give this Link I more thing I want to ask That is there is any thing new feature In 2.0 or Visual Studio 2005 To have the Multi COlumn Combo Box in the DatagridView Or if there is any other way to do that If make a custome control then how to add etc. So plz give me the direction for this also AS i m stuck with this problem since last 3 months Thanks a lot again. Thanks & Regards Hema Chaudhry
-
Thanks for this Useful direction I ahve seen the Configuration Manger Class I think It will fit to my requirement Thanks a lot To give this Link I more thing I want to ask That is there is any thing new feature In 2.0 or Visual Studio 2005 To have the Multi COlumn Combo Box in the DatagridView Or if there is any other way to do that If make a custome control then how to add etc. So plz give me the direction for this also AS i m stuck with this problem since last 3 months Thanks a lot again. Thanks & Regards Hema Chaudhry
HemaRawat wrote:
I more thing I want to ask That is there is any thing new feature In 2.0 or Visual Studio 2005 To have the Multi COlumn Combo Box in the DatagridView Or if there is any other way to do that
Don't know. Also, this is a new question on a different topic - you should start a new thread. ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell