本文介绍了在第4和第5行发生长度不能小于零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
1 string userIP = Request.UserHostAddress;
2 string serverIP = Request.ServerVariables [LOCAL_ADDR];
3
4 userIP = userIP.Substring(0,userIP.LastIndexOf(。));
5 serverIP = serverIP.Substring(1,serverIP.LastIndexOf(。));
1 string userIP = Request.UserHostAddress;
2 string serverIP = Request.ServerVariables["LOCAL_ADDR"];
3
4 userIP = userIP.Substring(0, userIP.LastIndexOf("."));
5 serverIP = serverIP.Substring(1, serverIP.LastIndexOf("."));
// only redirect to WinLogin.aspx if user is internal & IE
if (userIP.Equals(serverIP) && Request.Browser.IsBrowser("ie"))
{
Server.Transfer("SecondLogin.aspx"");
}
else
{
Server.Transfer("ThirdLogin.aspx"");
}
推荐答案
这篇关于在第4和第5行发生长度不能小于零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!