记住应用程序重新启动时不使用WPF中的数据库的值 [英] Remember a value on application restart without using database in WPF

查看:104
本文介绍了记住应用程序重新启动时不使用WPF中的数据库的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我正在开发一个系统应用程序。我要求在不使用数据库的情况下重新启动应用程序时记住的布尔值。



是否可以记住任何值而不将其保存/保存到数据库中?



如果是,请详细说明步骤吗?



在此先感谢..!

Hello,

I am developing a system application. I have a requirement that a boolean value to be remembered on application restart without the usage of database.

Is it possible to remember any value without storing/saving it into database?

If YES, Could you please elaborate the steps?

Thanks in Advance..!

推荐答案

你必须将它保存在某个地方,但我同意使用数据库对于单个布尔值似乎有点多。您可以查看应用程序配置文件或注册表。 了解区域处理程序 - App.config文件 [ ^ ]可以帮助您做出决定。
Well you will have to save it somewhere, but I agree using a database seems a bit much for a single boolean value. You could look at the application configuration file or the registry. Understanding Section Handlers - App.config File[^] may help you decide.


您必须创建一个文本文件/ xml文件/ .Net配置文件来存储所需信息并将其保存在app目录中。然后你必须在应用启动时阅读它并在任何需要的地方使用它。



请让我知道它有帮助吗?
You have to create a text file/ xml file/ .Net config file to store required information and save it in app directory. Then you have to read it on app startup and use it wherever you need it.

please let me know it helped or not?


这篇关于记住应用程序重新启动时不使用WPF中的数据库的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆