471,594 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 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 1911
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Joshua Beall | last post: by
reply views Thread by Anonieko Ramos | last post: by
5 posts views Thread by Norsoft | last post: by
reply views Thread by leo001 | last post: by

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.