问题描述
我想在我的桌面应用程序项目中创建会话以进行用户登录,例如web维护会话。
I want to create session in my desktop application project for user login like web maintain the session.
推荐答案
使用桌面应用程序 - 我认为它是Windows应用程序,我们没有可用的会话变量。会话变量仅在Web应用程序上可用,除非您导入不推荐的System.Web命名空间。
With a Desktop Application - I assume it is a Windows App, we do not have a Session Variable available. The Session variables are available only on Web applications unless you import System.Web namespace which is not recommended.
会话的替代方法是应用程序级变量,当存储时会存储一些信息。用户正在运行应用程序,并且全局可用于所有屏幕。
The alternative to session would be a application level variables that would have some information stored when the user is running the application and available globally to all screens.
存储在应用程序变量中的常见内容包括用户ID,用户权限详细信息,首选语言。
the usual things that are stored in app variables include userid's, user rights details, preferred language.
谢谢,
Param
这篇关于如何在c#win应用程序中创建会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!