473,524 Members | 3,036 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

App.config file

Rob
It's easy enough to read from a VB.net configuration file...

variable = ConfigurationSettings.AppSettings("key")

However, how do you write to one ?

Thanks !
Nov 23 '05 #1
5 15886
Rob wrote:
It's easy enough to read from a VB.net configuration file...

variable = ConfigurationSettings.AppSettings("key")

However, how do you write to one ?

Thanks !


Don't don't have access from inside a vb.net class to write to an
app.config file. If you want to save user settings and such use a
different file.

Chris
Nov 23 '05 #2
Note that if you are using VS2005, you can take advantage of the My.Settings feature to read and write such properties, such as (after adding "Foo" in the Settings designer):

My.Settings.Foo = Me.SomeValue ' write
Me.SomeValue = My.Settings.Foo 'read

Such settings are persisted per-user in the appropriate "Documents and Settings" application data folder.

--Matt Gertz--*
VB Compiler Dev Lead

-----Original Message-----
From: Chris
Posted At: Monday, November 14, 2005 1:25 PM
Posted To: microsoft.public.dotnet.languages.vb
Conversation: App.config file
Subject: Re: App.config file
Rob wrote:
It's easy enough to read from a VB.net configuration file...

variable = ConfigurationSettings.AppSettings("key")

However, how do you write to one ?

Thanks !


Don't don't have access from inside a vb.net class to write to an
app.config file. If you want to save user settings and such use a
different file.

Chris
Nov 23 '05 #3
Ma***********@feedback.microsoft.com wrote:
Note that if you are using VS2005, you can take advantage of the My.Settings feature to read and write such properties, such as (after adding "Foo" in the Settings designer):

My.Settings.Foo = Me.SomeValue ' write
Me.SomeValue = My.Settings.Foo 'read

Such settings are persisted per-user in the appropriate "Documents and Settings" application data folder.

--Matt Gertz--*
VB Compiler Dev Lead

-----Original Message-----
From: Chris
Posted At: Monday, November 14, 2005 1:25 PM
Posted To: microsoft.public.dotnet.languages.vb
Conversation: App.config file
Subject: Re: App.config file
Rob wrote:
It's easy enough to read from a VB.net configuration file...

variable = ConfigurationSettings.AppSettings("key")

However, how do you write to one ?

Thanks !

Don't don't have access from inside a vb.net class to write to an
app.config file. If you want to save user settings and such use a
different file.

Chris


oooo, interesting... I did not know this...

Thank.
Chris
Nov 23 '05 #4
Rob
What about using the xml DOM ?

Why wouldn't you want to do that ?

- Rob
"Chris" <no@spam.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Rob wrote:
It's easy enough to read from a VB.net configuration file...

variable = ConfigurationSettings.AppSettings("key")

However, how do you write to one ?

Thanks !


Don't don't have access from inside a vb.net class to write to an
app.config file. If you want to save user settings and such use a
different file.

Chris

Nov 23 '05 #5
It's probally important to note that an Application scoped setting is
read-only. Where as a User scoped setting is capable of being written to.
-------------------------------------
Life would be easier if i had the source code
"Ma***********@feedback.microsoft.com" wrote:
Note that if you are using VS2005, you can take advantage of the My.Settings feature to read and write such properties, such as (after adding "Foo" in the Settings designer):

My.Settings.Foo = Me.SomeValue ' write
Me.SomeValue = My.Settings.Foo 'read

Such settings are persisted per-user in the appropriate "Documents and Settings" application data folder.

--Matt Gertz--*
VB Compiler Dev Lead

-----Original Message-----
From: Chris
Posted At: Monday, November 14, 2005 1:25 PM
Posted To: microsoft.public.dotnet.languages.vb
Conversation: App.config file
Subject: Re: App.config file
Rob wrote:
It's easy enough to read from a VB.net configuration file...

variable = ConfigurationSettings.AppSettings("key")

However, how do you write to one ?

Thanks !


Don't don't have access from inside a vb.net class to write to an
app.config file. If you want to save user settings and such use a
different file.

Chris

Dec 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2981
by: Maxim Khesin | last post by:
I want to have a config file with my python proggie, satisfying the following requirements: 1) support key->(value, default) 2) simple and intuitive to read and edit 3) easyly readable into a python datastructure (a dictionary?) 4) not requiring any heavy libraries needed (I am distributing my proggie as a py2exe executable and do not want...
4
3809
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply* access config files. This is version 3, which is a big overhaul. It extends ConfigObj to reading config files with sections and various other...
2
933
by: Suresh Gladstone | last post by:
Hi, This is a bit with versioning and installation of the .NET dlls. I want to perform the following, 1. A third party application will be invoking my .NET dll through COM interop . For this I have used Regasm and registered the assembly in the registry with CODEBASE option. eg: regasm myDll.dll /tlb:myDll.tlb /codebase
4
7859
by: grs | last post by:
Can a class library have a app.config file. Reason for asking is that the microsoft application blocks all read from myApp.exe.config. How can you use the application blocks if you do not have an app.config file. Wish someone from microsoft would answer this, I am at a loss. thanks grs
22
2977
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text files, which in turn could be simply and easily maintained with notepad. I understand the benefits of XML, really, but in the case of configuration...
6
2266
by: Rich | last post by:
Hello, I picked up this example on using the Reflection namespace for loading forms/classes on the fly at msdn http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dnadvnet/html/vbnet10082002.asp which uses a config file named "yourAppName.exe.config" which is an xml based config file that references dlls in
13
507
by: Khodr | last post by:
Hello, I am using VS.NET 2003 and vb. I build my application MyApp and it generates MyApp.exe.config. So now MyApp.exe reads parameters from MyApp.exe.config. Great and no problem! I need to run the same program but with different configuration data. So I made a copy of MyApp.exe and MyApp.exe.config to put them in another folder and...
3
10583
by: Blasting Cap | last post by:
I am working on a web app that I want to be able to use a separate config file on, in addition to the web.config file that's already working in the application. If I put the following in the web.config file (VS 2005, Framework 2.0), I can retrieve the values fine: <appSettings> <add key="fileInputFolder" value="C:\National City...
12
13408
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD file was built by draging tables from the Data Sources pane. Auto-generated code created the files associated wtih the XSD file (xss,
5
7818
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based setting is of course stored in the app.exe.config file located in the same directory as the exe. Upon closing the form, I save the user setting which...
0
7327
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7248
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7636
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7220
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5772
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5167
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3308
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
537
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.