日期:2014-05-18 浏览次数:20411 次
if (Request.IsAuthenticated) { FormsIdentity identity = (FormsIdentity)User.Identity; FormsAuthenticationTicket ticket = identity.Ticket; string strUserID = User.Identity.Name; string strCompany = ticket.UserData.Split("|".ToCharArray())[0]; } else { lal_text.Value= "游客!"; }
web.config <authentication mode="Forms"> <forms name="webUserKey" loginUrl="login.aspx" defaultUrl="index.html" protection = "All" timeout="5"></forms> </authentication>