专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > VB Dotnet

两个项目之间session怎么传递?待!高分!

发布时间:2011-06-23 15:55:20 文章来源:www.iduyao.cn 采编人员:星星草
两个项目之间session如何传递?在线等待!高分!!!!!
小弟初学,为公司写办公系统,由于有多个模块,每个模块都是一个项目,共用一个登录界面,而登录界面也为一单独项目,在IIS中都各为一应用,现在我想通过登录界面传递session参数至其他各模块,但是却传不了,想问问有什么办法?

------解决方案--------------------
不同的Web Applicatin不能传递Session
相同域名请用Cookie,不同域名SSO-单点登陆
------解决方案--------------------
还是使用 cookie通过Domain限定吧

非要那么做看看下面

http://dev.csdn.net/article/21/21714.shtm

http://topic.csdn.net/t/20040914/09/3369688.html
------解决方案--------------------
别人写的,我没用过,你自己看看什么意思吧
string suppliername=ds.Tables[ "table "].Rows[0][ "suppliername "].ToString();
string w_orderstartday=ds.Tables[ "table "].Rows[0][ "w_orderstartday "].ToString();
string w_deaddate=ds.Tables[ "table "].Rows[0][ "w_deaddate "].ToString();
string w_deadtime=ds.Tables[ "table "].Rows[0][ "w_deadtime "].ToString();
string w_orderplandeaddatedif=ds.Tables[ "table "].Rows[0][ "w_orderplandeaddatedif "].ToString();
string w_orderplandeadtime=ds.Tables[ "table "].Rows[0][ "w_orderplandeadtime "].ToString();
string w_orderamenddeaddatedif=ds.Tables[ "table "].Rows[0][ "w_orderamenddeaddatedif "].ToString();
string w_orderamenddeadtime=ds.Tables[ "table "].Rows[0][ "w_orderamenddeadtime "].ToString();
string d_deaddatediff=ds.Tables[ "table "].Rows[0][ "d_deaddatediff "].ToString();
string d_deadtime=ds.Tables[ "table "].Rows[0][ "d_deadtime "].ToString();
string pdcostrate=ds.Tables[ "table "].Rows[0][ "pdcostrate "].ToString();
string d_orderdeaddatedif=ds.Tables[ "table "].Rows[0][ "d_orderdeaddatedif "].ToString();
string d_orderdeadtime=ds.Tables[ "table "].Rows[0][ "d_orderdeadtime "].ToString();
string flg=ds.Tables[ "table "].Rows[0][ "flg "].ToString();
string decimalkbn=ds.Tables[ "table "].Rows[0][ "decimalkbn "].ToString();
HttpCookie cookie=new HttpCookie( "BenInfo ");
cookie.Values.Add( "suppliername ",suppliername);
cookie.Values.Add( "suppliercd ",txtUsercd.Text);
cookie.Values.Add( "w_orderstartday ",w_orderstartday);
cookie.Values.Add( "w_deaddate ",w_deaddate);
cookie.Values.Add( "w_deadtime ",w_deadtime);
cookie.Values.Add( "w_orderplandeaddatedif ",w_orderplandeaddatedif);
cookie.Values.Add( "w_orderplandeadtime ",w_orderplandeadtime);
cookie.Values.Add( "w_orderamenddeaddatedif ",w_orderamenddeaddatedif);
cookie.Values.Add( "w_orderamenddeadtime ",w_orderamenddeadtime);
cookie.Values.Add( "d_deaddatediff ",d_deaddatediff);
cookie.Values.Add( "d_deadtime ",d_deadtime);
cookie.Values.Add( "d_orderdeaddatedif ",d_orderdeaddatedif);
cookie.Values.Add( "d_orderdeadtime ",d_orderdeadtime);
cookie.Values.Add( "pdcostrate ",pdcostrate);
cookie.Values.Add( "flg ",flg);
cookie.Values.Add( "decimalkbn ",decimalkbn);
cookie.Values.Add( "role ",role);
cookie.Expires = DateTime.Now.AddYears(1);
Response.Cookies.Add(cookie);
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: