?
Solved

Store Value before Application.Restart()

Posted on 2010-08-16
6
Medium Priority
?
635 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

 
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

Major Serverless Shift

Comparison of major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

765 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