先向各位拜个年!!!问题如下:有两个程序,(.net,c#,b/s)都需要登录后进入主界面,登录时记录登录用户的ID在Session里。现在登录了A程序后,想不用再次登录,直接进入B程序,两个程序都用Session[user_id]记录当前登录用户现在如何才能在A程序中通过点一个按钮就直接进入B程序的主界面?比较面,如果方法麻烦的话请尽可能介绍的详细点,谢谢了!
调试欢乐多
^
程序A ----------------|
比如程序B中Login.aspxbtnLogin_Click()
{
string username = txtUsername.Text;
string password = txtPassword.Text;
Response.Redirect ("hiddenLogMeIn.aspx?username=" + username + "&password=" + password);
}说白了, 就是在程序B中, 将登录的界面和权限验证给分开就可以了
就是下面这个路径:
Response.Redirect ("http://server/Application_B/hiddenLogMeIn.aspx?username=username&password=somepasssword");
Response.Redirect ("http://server/Application_B/hiddenLogMeIn.aspx?username=username&password=somepasssword"); to redirect to B. Normally we put the text indicate where Application_B (the folder which holds B application) is in the config file.
肯定要一个判断的.
这就结贴。顺便再问最后一个问题,Response.Redirect ("http://server/Application_B/hiddenLogMeIn.aspx?username=username&password=somepasssword"); 这样在转到B程序时需要A系统的登录密码。在A系统登录时把密码保存在Session里,以便传递,这样做安全吗?