诡异的asp.net系统登录问题,紧急求助

stop__ 2009-12-07 06:48:34
该系统部署在移动的服务器上。

1.在公司的任何一台电脑用IE,FF,Chrome打开系统的登录界面。
输入用户名和密码(用户名和密码输入绝对没有错误),可是死活登录不进去(也就是说输入正确的用户名和密码以后老是跳到登录界面)。
2.在网吧,可以正常登录系统。我还叫朋友帮忙,他们也可以登录系统。
3.我以为是浏览器无法发送客户端的SessionId,但是我把SessionId放到Url中(在Web.config中配置cookieless="true"),也没有用。
4.服务器端的状态时保存到StateServer中,后来改为保存到Sqlserver中,本公司的所有电脑还是登录不上。
5.另外公司以前开发的一套其它系统以前一直可以登录,现在也出现相同问题(该系统部署在电信的服务器上)。
6.公司网络为电信的。
请问这是怎么回事(会不会移动在限制,还是公司的路由器方面有问题?)?


下面是登录界面的代码:




 
namespace Logistics.Web
{
/// <summary>
/// Logon 的摘要说明。
/// </summary>
public partial class Logon : System.Web.UI.Page
{
private ILog log = LogManager.GetLogger(typeof(Logon));
protected void Page_Load(object sender, System.EventArgs e)
{

if(!IsPostBack)
{

GlobalSetMgr globalSetMgr = new GlobalSetMgr();
GlobalSetEntity entity=globalSetMgr.GetEntity();
this.chkSupportAgent.Visible = false;// entity.SupportAgent == YesNoType.YesInt;

}
}




protected void btnSubmit_Click1(object sender, ImageClickEventArgs e)
{

UserMgr userMgr = new UserMgr();
CityMgr cityMgr=new CityMgr();
UserEntity userData = new UserEntity();
if (userMgr.Logon(txtUserID.Text, txtPassword.Text, ref userData,Request))
{
//如果已经在线的用户大于等于4.那么不能登陆
List<UserEntity> onlineUsers = userMgr.GetOnlineUser();
if (onlineUsers.Count >= 5)
{
divTip.InnerText = "不能登陆,当前在线用户数为:" + onlineUsers.Count + ".已经超过了最大的在线用户数量.";
return;
}

SessionUser sessionUser = new SessionUser();
sessionUser.Password = txtPassword.Text.Trim();
sessionUser.UserName = txtUserID.Text.Trim();
sessionUser.PKID = userData.PKID;


//查询职员的信息
long employeeID = userData.EmployeeID;

EmployeeMgr employee = new EmployeeMgr();
EmployeeEntity employeeData = employee.GetEmployeeByID(employeeID);
if (employeeData != null)
{
sessionUser.Birthday = employeeData.BirthDay;
sessionUser.DepartmentID = employeeData.DepartmentID;
sessionUser.EmployeePKID = employeeID;
sessionUser.EmployeeCode = employeeData.PersonCode;
sessionUser.EmployeeName = employeeData.Name;
sessionUser.JobID = employeeData.PostID;
sessionUser.Sex = employeeData.Sex;
sessionUser.CityID = employeeData.CityID;
//查询部门名称,职位名称
DepartmentMgr deptMgr = new DepartmentMgr();
DepartmentEntity deptEntity = deptMgr.GetByPKID(employeeData.DepartmentID);
if (deptEntity != null)
{
sessionUser.DepartmentName = deptEntity.Name;
}
//查询城市名称
CityEntity cityEntity = cityMgr.GetByPKID(employeeData.CityID);
sessionUser.CityName = cityEntity != null ? cityEntity.Name : "";

}
else
{
sessionUser.EmployeeName = sessionUser.UserName;
sessionUser.EmployeeCode = sessionUser.UserName;
sessionUser.DepartmentID = -1;
sessionUser.JobID = -1;

}



if (!this.chkSupportAgent.Checked)//没有开启代理功能
{
sessionUser.WeiTuoUserName = sessionUser.UserName;
Session[Constants.SessionUser] = sessionUser;
Session["nihao"] = "nihaoSesson";
Session.Add("111","111");
FormsAuthentication.SetAuthCookie(txtUserID.Text.Trim(), false);

FormsAuthentication.SetAuthCookie(Constants.SessionUser, false);

log.Debug(Session[Constants.SessionUser]+"+++++++++++++++");
);//把这个修改成Response.Redirect("Index3.aspx");
//Server.Transfer("Index3.aspx")也不行。
Response.Redirect("Index3.aspx",false

}
else
{
Session[Constants.SessionUser] = sessionUser;
FormsAuthentication.SetAuthCookie(txtUserID.Text.Trim(), false);
Response.Redirect("LogonTwo.aspx", false);
}
}
else {
this.divTip.InnerText = "用户名或者密码错误!";
}
}



}
}
...全文
138 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
ljsheng 2009-12-08
  • 打赏
  • 举报
回复
灵异事件
jshi123 2009-12-08
  • 打赏
  • 举报
回复
楼主可以把网址贴出来吗?
最好有个测试用户/密码
stop__ 2009-12-08
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 gongsun 的回复:]
我靠,下断点 单步调试啊...

这还能调试不出来???

断点就下在 EmployeeEntity employeeData = employee.GetEmployeeByID(employeeID);

这个方法体里的 数据层中,看看返回值...

调试调试就明白了...
[/Quote]
系统部署在移动的服务器上,没法单步

但是我在开发机器上 直接连接 移动服务器上的数据库,在VS208按F5 运行系统可以登录
如果在IE中输入 移动服务器上的系统地址,依然无法登陆
stop__ 2009-12-08
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 mzmxchenweij 的回复:]
是不是你公司的网络禁止了外网的访问
[/Quote]
没有禁止
Joetao 2009-12-07
  • 打赏
  • 举报
回复
楼主单步调试下,或在发布之前加上个日志!看看出问题在那个地方撒!
gongsun 2009-12-07
  • 打赏
  • 举报
回复
我靠,下断点 单步调试啊...

这还能调试不出来???

断点就下在 EmployeeEntity employeeData = employee.GetEmployeeByID(employeeID);

这个方法体里的 数据层中,看看返回值...

调试调试就明白了...
Adechen 2009-12-07
  • 打赏
  • 举报
回复
是不是你公司的网络禁止了外网的访问
yaoworld 2009-12-07
  • 打赏
  • 举报
回复
来学习先了
wuyq11 2009-12-07
  • 打赏
  • 举报
回复
能登录就应该不是程序问题
可能与环境有关。使用角色和session控制
szldk 2009-12-07
  • 打赏
  • 举报
回复
帮顶,
关注,
yanghuijun 2009-12-07
  • 打赏
  • 举报
回复

但是在网吧可以登录啊,客户那边也可以登录。

再试试把你的IE配置全部重置试试
--------------------------
呵呵。奇怪了。如果还不行俺也没办法了

解决了之后再贴个解决方案
yanghuijun 2009-12-07
  • 打赏
  • 举报
回复
我晕。你index3.aspx存不存在啊?
如果存在的话。直接访问可以不?如果存在还不可以。把这个页面的验证逻辑去掉可以不?
如果有重写的话,检查webconfig中url重写有没有配置错误。

stop__ 2009-12-07
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 yanghuijun 的回复:]
检查index3.aspx中的session key和value是否与当前页一致。,然扣redirect中的bool参数去掉看看
[/Quote]

问题是进入不到index3.aspx

//redirect中的bool参数去掉看看
去掉了
用Server.Transfer也没有用,但是在网吧可以登录啊,客户那边也可以登录。
yanghuijun 2009-12-07
  • 打赏
  • 举报
回复
检查index3.aspx中的session key和value是否与当前页一致。,然扣redirect中的bool参数去掉看看
stop__ 2009-12-07
  • 打赏
  • 举报
回复
其实代码并没有其他功能,就是一个登录。
stop__ 2009-12-07
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 yanghuijun 的回复:]
你这段代码没有注释。全是BLL代码。咋 理解?
看了半天也没看明白
[/Quote]
核心的为:
if (!this.chkSupportAgent.Checked)//没有开启代理功能
{
sessionUser.WeiTuoUserName = sessionUser.UserName;
Session[Constants.SessionUser] = sessionUser;
Session["nihao"] = "nihaoSesson";
Session.Add("111","111");
FormsAuthentication.SetAuthCookie(txtUserID.Text.Trim(), false);

FormsAuthentication.SetAuthCookie(Constants.SessionUser, false);

log.Debug(Session[Constants.SessionUser]+"+++++++++++++++");
);//把这个修改成Response.Redirect("Index3.aspx");
//Server.Transfer("Index3.aspx")也不行。
Response.Redirect("Index3.aspx",false

}
else
{
Session[Constants.SessionUser] = sessionUser;
FormsAuthentication.SetAuthCookie(txtUserID.Text.Trim(), false);
Response.Redirect("LogonTwo.aspx", false);
}
yanghuijun 2009-12-07
  • 打赏
  • 举报
回复
你这段代码没有注释。全是BLL代码。咋 理解?
看了半天也没看明白

62,254

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧