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

C#.net object persistence

3
I am trying to create a simple application.
I would like the users of this application to be able to set there user preferences and these settings to be permanently stored.
For example the location of various folders (C:\test1

I was thinking of creating an object/class which stores settings/path etc.

How do I achieve this permanent storage of the settings?
If a user shutdown there computer will the information be lost that is stored in an object?
Do you have any examples of what I could do?
Jan 23 '08 #1
2 1758
nateraaaa
663 Expert 512MB
You could store these settings in an xml file within your project. Another alternative would be to store these settings in a database table.

Nathan
Jan 23 '08 #2
Plater
7,872 Expert 4TB
.NET applications (at least 2.0+ does) have a built-in feature for this.
If you go to your solution explorer, there is a section called "Properties". Contained underneath it is the "Settings" (settings.settings) section. Double click that will give you a nice place to enter in some objects and their default values. If you set the scope to user (and not application), each user will be able to have different values for the objects.
You will have to add some code to your project to allow them to change/save their own values, but that is trivial.
Jan 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Paolo Losi | last post by:
Hi all, I'm pretty new to the python language so please excuse me if this is FAQ... I'm very glad to be part of the list! :-) I'm looking into a way to implement a generic workflow framework...
2
by: object-relational persistence mapping | last post by:
Someone can tell me where I find a good Object-Relational Mapping library.
4
by: Marcel Balcarek | last post by:
Hello, I have a page (page1.aspx) that builds some complex .NET objects. I successfully pass these objects to another different window (page2.aspx). How can I persist these objects on a POST...
3
by: Jo Inferis | last post by:
So, I'm using a 3rd party com object via interop (already I can hear screams of anguish). This object was originally written to be used as the backend for multiple screens of a VB application. Now...
5
by: Chris Spencer | last post by:
Before I get too carried away with something that's probably unnecessary, please allow me to throw around some ideas. I've been looking for a method of transparent, scalable, and human-readable...
3
by: Robert | last post by:
I am trying to persist an instance specific object without using a session object. Is this possible? For example: Class object: Car Properties: Make, Model Car.Make = Ford Car.Model = F150
6
by: Peter Richardson | last post by:
Hi, I'm wondering if someone can help me with some design questions I have. I'm trying to create a class in C# to represent my customers. I know how to create teh Customer class and all, but my...
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
0
by: Bill McCormick | last post by:
I'm looking for the best (easiest, cheapest, fastest, most flexible) way to implement object persistence in .NET 3.5. The object data is native XML, so serialization is a good option as well as...
0
myusernotyours
by: myusernotyours | last post by:
Hi all, Am trying to create a Java Desktop App that uses Java Persistence in Netbeans. The database is MS Access but I tried with Mysql and got the same error. When I run the app( Create the...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.