473,396 Members | 1,996 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,396 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 2118
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....
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.