如何在运行时将用户名从一个asp.net应用程序传递到另一个 [英] How to pass username from one asp.net application to another at run time

查看:66
本文介绍了如何在运行时将用户名从一个asp.net应用程序传递到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的Web服务器上运行了8个asp.net应用程序,所有应用程序都有自己的登录名.
我创建了另一个asp.net应用程序,该应用程序将为这8个应用程序提供一个通用接口,并且还将具有登录名以输入该系统.
但是,如果用户从任何内部应用程序注销,我想要其外部登录名吗?

预先感谢.

Hi
I have 8 asp.net applications running on our web server, and all applications have their own login.
I have created another asp.net application that will provide a common interface to those 8 applications and also will have a login to enter to this system.
But if the user logout from any internal application, i want its username of outer login?

Thanks in advance.

推荐答案

1.在外部应用程序中有一个通用的注销屏幕.通过该操作,您可以将用户重定向到外部应用程序的登录屏幕.
2.会话是一个沉重的对象.明智地使用它.内部的8个asp.net应用程序可能已经在使用Session来管理每个应用程序中的数据.
3.将登录的用户信息(从外部应用程序)存储在xml文件中.同时存储会话ID.
1. Have a common logout screen in outer app. From that you redirect the user to outer app''s login screen.
2. Session is a heavy object. Use it wisely. The inner 8 asp.net applications might be already using Session to manage data within each application.
3. Store the logged in users info (from outside app) in an xml file. Also store the Session ID.
<logininfo>
      <login username="EncryptedString" password="EncryptedString" sessionid="EncryptedString" rememberpassword="true/false" targetappid="2" logintime="DateTime.Now" />
      <login ...="" />
      <login ...="" />
       .....
</logininfo>



这样,您可以管理很多事情.

1.您可以从应用程序外部终止会话.
2.注销后,您只需要清除SessionId,或者只需删除该< login>条目.
3.您可以跟踪
- 不.登录用户到服务器的数量.
- 不.已登录用户访问任何内部应用程序的情况.
4.如果用户愿意,您可以在应用程序之间轻松切换.您只需要更新''TargetAppId''



By doing this, you can manage a lot of things.

1. You can kill the session from outside the app.
2. On logout, you just have to clear the SessionId, or you can just remove that <login> entry.
3. You can keep track of
-- no. of logged-in users to the server.
-- no. of logged-in users to any inner app.
4. If the user wishes, you can easily switch between the apps. You just have to update the ''TargetAppId''


这篇关于如何在运行时将用户名从一个asp.net应用程序传递到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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