[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Store Value before Application.Restart()

Posted on 2010-08-16
6
Medium Priority
?
637 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
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…

649 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