当关闭申请和再次打开申请时,我想回到我的最后一份申请表 [英] when close application and open application again ı wanna get back my last application form

查看:46
本文介绍了当关闭申请和再次打开申请时,我想回到我的最后一份申请表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在窗体中关闭应用程序并再次打开应用程序时,我想回到我的上一个申请表。例如;当ı在形式b和ı关闭应用程序时,ı想要以相同的形式b当ı将登录时。我可以制作吗?

when close application in the form and open application again ı wanna get back my last application form.For example; when ı was in form b and ı close application ,ı wanna be in the same form b when ı will be login.how can ı make?

推荐答案

它没有听起来像是一个很好的UI设计,我的意思是,你的所有多种形式,但保留应用程序的导航点并在以后恢复它的整个想法是非常好的。显然,你需要某种持久性来实现:。 https:// en。 wikipedia.org/wiki/Persistence_%28computer_science%29 [ ^ ]。



这就是.NET应用程序设置架构的设计目标:https://msdn.microsoft.com/en-us/library/8eyb2ct1%28v=vs.110%29.aspx [ ^ ]。



与此同时,我通常更喜欢使用更灵活和自定义的方法,这种方法由微软公司稍后开发,然后是针对WCF的Setttings。请参阅: https://msdn.microsoft.com/en-us /library/ms733127%28v=vs.110%29.aspx [ ^ ]。



在这种方法中,您可以以任意形式存储一些数据模型对象图,它不需要是树。 序列化技术稍后将从流中恢复内存中的数据图。要为每个用户存储数据,您必须使用特殊文件夹。请查看我过去的答案:

如何找到我的程序目录 [ ^ ],

哪个更好:使用注册表来存储设置或使用设置类 [ ^ ]。



为了存储每个当前用户的应用程序数据,您可以使用 System.SpecialFolder.ApplicationData

https://msdn.microsoft.com /en-us/library/system.env ironment.specialfolder%28v = vs.110%29.aspx [ ^ ]。



-SA
It does not sound like a good UI design, I mean, all your multiple forms, but the whole idea to preserve navigation point of your application and restore it later is very good. Apparently, you need some kind of persistence to achieve that: .https://en.wikipedia.org/wiki/Persistence_%28computer_science%29[^].

This is what .NET Application Settings Architecture is designed for: https://msdn.microsoft.com/en-us/library/8eyb2ct1%28v=vs.110%29.aspx[^].

At the same time, I usually prefer using more flexible and custom approach which was developed by Microsoft later then Setttings, for WCF. Please see: https://msdn.microsoft.com/en-us/library/ms733127%28v=vs.110%29.aspx[^].

In this approach you store some data model in the form of arbitrary object graph, which does not need to be a tree. The serialization technology restores the data graph in memory later, from a stream. To store the data per user, you have to use a special folder. Please see my past answers:
How to find my programs directory[^],
which is better : use of registery in order to store setting or use of Settings class[^].

For storing application data per current user, which should be your case, you can use System.SpecialFolder.ApplicationData:
https://msdn.microsoft.com/en-us/library/system.environment.specialfolder%28v=vs.110%29.aspx[^].

—SA


您的应用只需在退出时将其状态保存在配置文件中。

加载时,只需读取相同的配置文件即可知道要显示的内容。 br />


配置文件必须包含与状态相关的所有信息才能恢复正在加载。
Your app simply have to save its status in a configuration file when quitting.
And when loading, just read the same configuration file to know what to display.

The configuration file have to contain all information related to the status in order to restore is on loading.


这篇关于当关闭申请和再次打开申请时,我想回到我的最后一份申请表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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