473,380 Members | 1,108 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,380 software developers and data experts.

Best way to store user configuation

Hi

I am looking to store some details about a user's configuration choices, in
particular the place where they have installed some data files, the OS that
they use, and their Windows user name. This information is used in a
windows C#.net application.

I would like to capture this info the first time that the user opens the
app, but each subsequent time to make sure that the location is current when
they open the application. This is because the users may move items around
on their system and this may cause some oledb sql statements to fail.

Could you please suggest a design that you have used for this - i am
reluctant to write to the system registry as many users dont have local
admin rights to their PCs. I am thinking of the following pattern - but not
sure if it is the best one:

1. as part of the deployment, copy a config file to the same directory as
the application.
2. in that config file - set counter =0; user name =" ", OS="";
3. when the application is opened check to see if counter =0;
4. if counter is =0 then get the file location (from the OpenFileDialog and
the OS and user name and write to the config file;
5. populate the variables that require this information.
6. increment the counter;
7. close the file.
8. if counter >0 read the data in the config file and populate the variables
that need this information
9. increment the counter;
10 .close the file

If you see any major flaws in my logic or if you can suggest an alternative
(including the best way to store the information about the location, os and
username) please let me know.

Doug

What is the best way to store this information.

Jan 6 '07 #1
3 2116
Is this a web form or win app?
KC

gordon wrote:
Hi

I am looking to store some details about a user's configuration choices, in
particular the place where they have installed some data files, the OS that
they use, and their Windows user name. This information is used in a
windows C#.net application.

I would like to capture this info the first time that the user opens the
app, but each subsequent time to make sure that the location is current when
they open the application. This is because the users may move items around
on their system and this may cause some oledb sql statements to fail.

Could you please suggest a design that you have used for this - i am
reluctant to write to the system registry as many users dont have local
admin rights to their PCs. I am thinking of the following pattern - but not
sure if it is the best one:

1. as part of the deployment, copy a config file to the same directory as
the application.
2. in that config file - set counter =0; user name =" ", OS="";
3. when the application is opened check to see if counter =0;
4. if counter is =0 then get the file location (from the OpenFileDialog and
the OS and user name and write to the config file;
5. populate the variables that require this information.
6. increment the counter;
7. close the file.
8. if counter >0 read the data in the config file and populate the variables
that need this information
9. increment the counter;
10 .close the file

If you see any major flaws in my logic or if you can suggest an alternative
(including the best way to store the information about the location, os and
username) please let me know.

Doug

What is the best way to store this information.
Jan 6 '07 #2

lol didn't read it all :)

Netmonster wrote:
Is this a web form or win app?
KC

gordon wrote:
Hi

I am looking to store some details about a user's configuration choices, in
particular the place where they have installed some data files, the OS that
they use, and their Windows user name. This information is used in a
windows C#.net application.

I would like to capture this info the first time that the user opens the
app, but each subsequent time to make sure that the location is current when
they open the application. This is because the users may move items around
on their system and this may cause some oledb sql statements to fail.

Could you please suggest a design that you have used for this - i am
reluctant to write to the system registry as many users dont have local
admin rights to their PCs. I am thinking of the following pattern - but not
sure if it is the best one:

1. as part of the deployment, copy a config file to the same directory as
the application.
2. in that config file - set counter =0; user name =" ", OS="";
3. when the application is opened check to see if counter =0;
4. if counter is =0 then get the file location (from the OpenFileDialog and
the OS and user name and write to the config file;
5. populate the variables that require this information.
6. increment the counter;
7. close the file.
8. if counter >0 read the data in the config file and populate the variables
that need this information
9. increment the counter;
10 .close the file

If you see any major flaws in my logic or if you can suggest an alternative
(including the best way to store the information about the location, os and
username) please let me know.

Doug

What is the best way to store this information.
Jan 6 '07 #3
you could use Profiles.

http://www.theproblemsolver.nl/using...inwinforms.htm
http://fredrik.nsquared2.com/viewpos...wfeedback=true
KC
Netmonster wrote:
lol didn't read it all :)

Netmonster wrote:
Is this a web form or win app?
KC

gordon wrote:
Hi
>
I am looking to store some details about a user's configuration choices, in
particular the place where they have installed some data files, the OS that
they use, and their Windows user name. This information is used in a
windows C#.net application.
>
I would like to capture this info the first time that the user opens the
app, but each subsequent time to make sure that the location is current when
they open the application. This is because the users may move items around
on their system and this may cause some oledb sql statements to fail.
>
Could you please suggest a design that you have used for this - i am
reluctant to write to the system registry as many users dont have local
admin rights to their PCs. I am thinking of the following pattern - but not
sure if it is the best one:
>
1. as part of the deployment, copy a config file to the same directory as
the application.
2. in that config file - set counter =0; user name =" ", OS="";
3. when the application is opened check to see if counter =0;
4. if counter is =0 then get the file location (from the OpenFileDialog and
the OS and user name and write to the config file;
5. populate the variables that require this information.
6. increment the counter;
7. close the file.
8. if counter >0 read the data in the config file and populate the variables
that need this information
9. increment the counter;
10 .close the file
>
If you see any major flaws in my logic or if you can suggest an alternative
(including the best way to store the information about the location, os and
username) please let me know.
>
Doug
>
What is the best way to store this information.
Jan 6 '07 #4

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

Similar topics

15
by: Joshua Beall | last post by:
Hi All, What is the best way to use a cookie to remember a logged in user? Would you store the username and password in two separate cookies? Should the password be plain text? Hashed? Not...
1
by: nzanella | last post by:
Hello, I am currently upgrading a database of products to include pictures to be displayed online. I would like to know whether it would be best to store the pictures themselves in a database as...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
5
by: Norsoft | last post by:
I have a .Net 1.1 application which is downloaded into an aspx page. It is a dll which inherits from System.Windows.Forms.UserControl. It works fine on a PC with only the 1.1 Framework. However,...
17
by: | last post by:
I have an app that retrieves data from an Access database. At the moment I have the SQL string as a Const in my app. I understand this is not best practice. I don't want the user to have access to...
4
by: Marco | last post by:
Hi to All, I'm developing an application in VB .NET. I have a question: what is the best place to save personal settings of my users? I mean, when a user uses my application, it can create a...
11
by: Tom | last post by:
I am planning on adding a Preferences form to my application and using the Property Grid to display the preferences to the user. What do you think would be the best way to save these preferences...
3
by: Robin Tucker | last post by:
I'm a bit confused about where to put my program settings. Firstly, I can choose (I suppose) between .ini, .xml or the registry. Which one is best? Secondly, *where* do I place any files I...
0
by: M.-A. Lemburg | last post by:
On 2008-05-01 13:37, Lance Gamet wrote: I don't think this is a Python question, but more a platform question. Users on different platforms will expect configuration data in different places....
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.