User "sticky" profile

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

This question is one of "theory" rather than a search for the specifics of a
solution. I need some pointers as to how to proceed with my project.

Here goes.

My application allows the user to select from menu options. Some of the
menus allow the user, via an options form, to select parameters for the
display of reports. Those parameters will include things like the date range,
the report type (detail or summary) and several others. All of this is
already coded and works exactly as required and designed.

To develop the application further I want to introduce what I call "sticky"
profiles.

A user logs in ......
That user access the menus and option forms and makes selections for his/her
report requirements.
That user logs out.

When that user logs in again (irrespective of how much later and how many
other users have logged in in the interim) I would like the application to be
able to set the various option form objects (list boxes, date/time pickers,
combo boxes etc.) to the last value selected by that user. And, in the same
way, the application should set those options to the users last choice, at
any time a new instance of the option form is invoked during any session.

I think, perhaps I'm wrong, that this is quite a wide-open question, but I'm
looking for guidance on methodology rather than a specific "do this or do
that" response.

Hoping someone out there may already have such a solution in use and can
suggest a way forward.

Regards

Michael Bond
 
mabond said:
Hi all

A user logs in ......
That user access the menus and option forms and makes selections for his/her
report requirements.
That user logs out.

When that user logs in again (irrespective of how much later and how many
other users have logged in in the interim) I would like the application to be
able to set the various option form objects (list boxes, date/time pickers,
combo boxes etc.) to the last value selected by that user. And, in the same
way, the application should set those options to the users last choice, at
any time a new instance of the option form is invoked during any session.

Michael Bond

Assuming the 'user logs on' means logging into windows, you could
concider storing the settings in the registry since all users have their
own registry (hkey_current_user) (not Win9x AFAIK). This is the way I do
it for one of our applications to store some per user settings.

If you mean logging into your application you'll probably have to use
some kind of database/XML to store the settings in. Be it a table in an
existing database (of your app) or a seperate new one is your decision.

You'll just need to remember to store the settings when the user closes
the form.
 
mabond,

I am using a class that I wrote to store user settings in an XML file.

You may read about this class here:
http://www.storyitc.com/cursite/default.htm

I have since updated it. The updated code can be found by going to

http://www.storyitc.com/codesamples

and clicking on clsPropertyManager (this is a text file, you need to copy
it into a file with a .vb extension and add it to your project as an
existing class.

To do per user I am storing it using
System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
& "\ApplicationName\SettingsFileName.xml"

on XP this stores it in

c:\documents and settings\<curuser>\Application
Data\ApplicationName\SettingsFileName.xml

Hope this helps you,

Shane
 
Shane

Thanks for that. Points me in the right direction. Appreciate the help

Regards

Michael Bond
 
You're welcome.

The other issue that my class solved was the ability to just give it a
filename, that way if you had two exe's or a dll and exe in your solution
and wanted them to use one setting file, it is easy.

-Shane
 
Back
Top