473,324 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

config file - How to ?

Hi,

I would like to create a config file to store some basic user data like
default path, and some other options ...

Does anyone know which is the best solution ? Using an xml-file ? Or using a
basic txt-file ? Or are there other solutions to remember user settings ?

thanx

John
Feb 5 '07 #1
5 904
"John Devlon" <jo********@hotmail.comwrote in message
news:1h**********************@phobos.telenet-ops.be...
Hi,

I would like to create a config file to store some basic user data like
default path, and some other options ...

Does anyone know which is the best solution ? Using an xml-file ? Or using
a basic txt-file ? Or are there other solutions to remember user settings
?

thanx

John
Yep. Use Application Settings. Choose Settings from your Project's
Properties. Select User for the Scope. All your User preferences can be
added here. You can even update them via code etc.

Cheers.
Feb 5 '07 #2
I am not saying this is the best solution but I am using the registry
to store the info. It is actually pretty easy and you don't have to
worry about having a seperate config file around.

Just a possibility. : )

-Josh

On Mon, 05 Feb 2007 00:56:29 GMT, "John Devlon"
<jo********@hotmail.comwrote:
>Hi,

I would like to create a config file to store some basic user data like
default path, and some other options ...

Does anyone know which is the best solution ? Using an xml-file ? Or using a
basic txt-file ? Or are there other solutions to remember user settings ?

thanx

John
Feb 5 '07 #3
I would not use the registry as Vista does not seems to like that.

Feb 5 '07 #4

Hi Greg,

Thanx for the great advice...

Do you know where I can find a good manuel on the web on how to read and
write to the user preferences ?

Many Thanx

John
Feb 6 '07 #5
"John Devlon" <jo********@hotmail.comwrote in message
news:Wz**********************@phobos.telenet-ops.be...
>
Hi Greg,

Thanx for the great advice...

Do you know where I can find a good manuel on the web on how to read and
write to the user preferences ?

Many Thanx

John
It's very basic. Add in your user preferences (I change their Roaming
property from False to True).

To read a value: eg,
sAppVers = My.Settings.AppVers
sDatabaseDir = My.Settings.DatabaseDirectory
sInputDir = My.Settings.InputDirectory

To save a new value: eg,
My.Settings.AppVers = "1.1"
My.Settings.DBName = "northwind.mdb"
My.Settings.Save()

Very easy. Cheers.
Feb 7 '07 #6

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

Similar topics

13
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...
4
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*...
2
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...
4
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...
22
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...
6
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?...
13
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...
3
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...
12
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...
5
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.