PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Best way to store user configuation

 
 
gordon
Guest
Posts: n/a
 
      6th Jan 2007
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.



 
Reply With Quote
 
 
 
 
Netmonster
Guest
Posts: n/a
 
      6th Jan 2007
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.


 
Reply With Quote
 
Netmonster
Guest
Posts: n/a
 
      6th Jan 2007

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.


 
Reply With Quote
 
Netmonster
Guest
Posts: n/a
 
      6th Jan 2007
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard Configuation =?Utf-8?B?UmVlZ3M3Mw==?= Windows XP Help 2 22nd May 2007 05:08 PM
Where are IE6 Configuation files? Cricket Windows XP Internet Explorer 1 30th May 2006 04:28 AM
How to store user settings in custom/user XML file - not app.confi =?Utf-8?B?VG9kZCBCZWF1bGlldQ==?= Microsoft Dot NET 7 4th Nov 2004 11:25 PM
Configuation of OE for MSN mail Robert Windows XP General 5 3rd Nov 2003 03:18 AM
Need docs on use of the .Net Framework Configuation 1.1 n_o_s_p_a__m Microsoft C# .NET 1 2nd Oct 2003 10:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 AM.