使用Httpcontext对象在应用程序之间进行通信.

编程入门 行业动态 更新时间:2024-10-24 16:24:10
本文介绍了使用Httpcontext对象在应用程序之间进行通信.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在IIS中配置了两个应用程序.我需要使用HttpContext对象将一些值从一个应用程序传递到另一个应用程序. 我已经尝试过使用 FormsAuthentication.SetAuthCookie("Hello",false) 在Httpcontext对象中设置一个值,通过 HttpContext.Current.User.Identity.Name 属性从其他应用程序检索. 到目前为止,一切正常,但我需要使用Httpcontext传递更多用户数据对象并在其他应用程序中检索它. 我该怎么做?是否可以使用HttpConext对象传递更多的用户数据.... 请帮助我:(

I have two applications configured in IIS. I need to Pass some values from one application to other using HttpContext object. I have tried out using FormsAuthentication.SetAuthCookie("Hello", false) which sets one value in the Httpcontext object which i m retrieving from other application through HttpContext.Current.User.Identity.Name property.Upto this all works fine but i need to pass more user data using Httpcontext object and retrive it in other application.How can i do that?Is it possible to pass more user data Using HttpConext Object or not....Please help me out :(

推荐答案

实际上,实际上只是在客户端上设置了一个cookie.SetAuthCookie建立了用户身份验证cookie,它允许HttpContext.当前用户可用. 如果您想让应用程序#2读取应用程序#1数据,则可以让应用程序#1设置一个cookie,然后应用程序#2可以读取它. Actually, what is happening is simply a cookie being set on the client. SetAuthCookie establishes the user authentication cookie, which allows HttpContext.Current.User to be available.If you want to application #2 to read application #1 data, you could have app#1 set a cookie that app#2 can then read.

更多推荐

使用Httpcontext对象在应用程序之间进行通信.

本文发布于:2023-11-09 15:53:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1572786.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   对象   通信   Httpcontext

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!