Windows应用程序中的会话状态 [英] session state in windows based application

查看:98
本文介绍了Windows应用程序中的会话状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在.net

推荐答案

中的基于窗口的应用程序中使用会话管理会话是在Windows中将应用程序中的状态存储在服务器上的Web方法Forms/wpf应用程序状态由各个表单本身维护,并且应用程序作为单个实例运行,因此在客户端没有意义.

但是,如果您的某些逻辑在服务器上并且客户端用于UI,则可以在服务器端代码上创建会话.
Session are the web way of storing state within your application on your server, in windows forms/wpf applications state is maintained by the individual forms themselves and the application is running as a single instance so it doesn''t make sense on the client side.

However if some of your logic is on a server and the client is used for UI then you can create sessions on your server side code.


在Winforms中不存在会话.创建自己的内部类或静态变量.检查此线程.
如何在Winforms中维护用户登录详细信息应用程序? [
Sessions don''t exist in Winforms. Create your own internal class or static variables. Check this thread.
How do I maintain user login details in a Winforms application?[^]


在Windows中使用Session有点困惑,因为Windows中没有对Session的任何支持.您可能必须在应用程序中创建一个全局变量,该变量可以通过您的Project进行访问.
尝试并返回特定问题.
Its little bit confusing to use Session in Windows because there is no any kind of support for Sessions in Windows. You might have to create a Global Variables in your application that can be accessed through out your Project.
Have a try and revert back with specific question.


这篇关于Windows应用程序中的会话状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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