?
Solved

Store Value before Application.Restart()

Posted on 2010-08-16
6
Medium Priority
?
638 Views
Last Modified: 2013-12-17
Hi,

I need to restart my application without losing some values the user had set before.
For some reasons I can't write a config file or use the registry.

So maybe one way would be to add the needed parameter to the command line but I don't like this way and have not checked this out.
Maybe it's possible to use an embbeded resX for and just changing the values and after the restart the app can get the changed values?

If this is possible how can I change values and read them from an embedded resX?
Other solutions are welcome ...

Thanks

Andre
0
Comment
Question by:andre72
  • 4
6 Comments
 

Accepted Solution

by:
njgroup earned 1332 total points
ID: 33444474
hmmm, I did this before in my application, but I was using xml file to store the configuration that has been set by the user, for he example, user A of the software is a french man, so went to settings tab, and has changed the language from english to french, internally, I change the value of language parameter for user A  in my xml file to french, so next time if user A access the software he will find it french not english anymore
0
 

Expert Comment

by:njgroup
ID: 33444487
so why dont you use xml parsing for storing user settings and defaults?
it's really powerful....
0
 

Author Comment

by:andre72
ID: 33444552
The reason for is that there's just temporary use for a fistfull of parameters.
E.g. the app should do an update check at the next restart but than no more when it will be startet.
In worst case if there's no other way for I think there'll be no other way than using a xml file but if it willl be possible in any way I prefer to don't use that.

The reason for is that we got some problems with Windows 7 user settings some time before where the application don't work anymore as the user had no write access to the xml file ...
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 14

Assisted Solution

by:systan
systan earned 668 total points
ID: 33445297
0
 

Assisted Solution

by:njgroup
njgroup earned 1332 total points
ID: 33448310
>>The reason for is that we got some problems with Windows 7 user settings  some time before where the application don't work anymore as the user  had no write access to the xml file ...


that why there is in windows 7 something called "Run as administrator", or when you create file, you need to give it permissions of the user logged in already, if the user is limited and does not have rights to writes in your application folders, then not only xml will not work, but also write to any file is not gonna be,
anyway, my softwares was working perfectly in windows xp, however, about 2 month ago, I had new reqiurments that it should work under windows 7, I was having these issues like in windows xp the user folder is documents and settings in windows 7 its c:/ user/
and the permissions issue..... but all solve easily

I advice u to give it a try and I am sure you will use it everywhere:

here is samples:
http://www.c-sharpcorner.com/uploadfile/shehperu/simplexmlparser11292005004801am/simplexmlparser.aspx

http://www.codeproject.com/KB/cpp/parsefilecode.aspx
0
 

Expert Comment

by:njgroup
ID: 33448401
by the way, I advice you to use xml rather than text file, because its really pretty organized, hierarchy enabled (you can use features of root and children), really more faster in rendering than the text file, markup language enabled, attributes, and so on,.....
see http://en.wikipedia.org/wiki/XML
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question