如何使用C#从服务器程序访问客户端的会话状态 [英] How to access the session state of client from server program using C#

查看:100
本文介绍了如何使用C#从服务器程序访问客户端的会话状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取或使用什么机制,以便可以使用c#在服务器程序中访问客户端请求的会话状态,即我们在asp页面中使用session [anyName]来获取身份但是将会是什么用于服务器控制台应用程序,以便可以处理多个客户端请求。请告诉我用于执行任务的机制?



我尝试过:



无意执行任务

How to get or what mechanism to be used so that the session state of client request can be accessed in server program using c#, that is we use session["anyName"] in asp page to get the identity but what will be used in server console application so that multiple client request can be handled. Please give me the mechanism to be used to perform the task?

What I have tried:

Not got any idea to perform the task

推荐答案

在服务器程序中,我们将为客户端生成唯一ID并将该唯一ID作为cookie传递响应。
In server program we will generate unique id for the client and pass that unique id as cookie to the response.


不知道为什么这是必要的,但为了提高问题,必须以某种方式使用改善问题网页控件,以反映其浏览器能力的本质将信息发送回CP服务器......
Don't know why this is necessary but in order to IMPROVE QUESTION one must use the "Improve Question" webpage control in some manner which reflects the nature of their browser's ability to send information back to the CP server ...


这篇关于如何使用C#从服务器程序访问客户端的会话状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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