oa的login.aspx文件中,需要通过Request.ServerVariables来检测Request.ServerVariables("Http_User_Agent")是否含有helloworld这个标识。具体的login.aspx如下:
<%@ Page Language="vb" AutoEventWireup="false" Inherits="iOffice.Unilogin" CodeBehind="Login.aspx.vb" %>
<html>
<head runat="server">
<link href="App_Themes/Login/Styles.css" type="text/css" rel="stylesheet">
</head>
<script language="javascript">
window.status = '<%=WinStatus%>'
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher
{
for (var i = 0; i < document.images.length; i++) {
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
var imgAttribs = img.attributes;
for (var j = 0; j < imgAttribs.length; j++) {
var imgAttrib = imgAttribs[j];
if (imgAttrib.nodeName == "align") {
if (imgAttrib.nodeValue == "left") imgStyle = "float:left;" + imgStyle
if (imgAttrib.nodeValue == "right") imgStyle = "float:right;" + imgStyle
break
}
}
var strNewHTML = "<span " + imgID + imgClass + imgTitle
strNewHTML += " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
strNewHTML += "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i - 1
}
}
}
window.attachEvent("onload", correctPNG);
window.attachEvent("onload", aps);
</script>
<body style="overflow: hidden;">
<form id="frm" runat="server" defaultfocus="txtpwd" defaultbutton="ok">
<div id="main">
<div id="div_box">
<div id="login_box">
<ul>
<li class="login_T">
<asp:Label ID="lblLogin" runat="server"></asp:Label></li>
<li>
<table width="430" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" scope="col">
<table width="447" border="0" cellspacing="0" cellpadding="0" style="padding: 35px 0px 22px 0px;">
<tr>
<td align="left" valign="middle" scope="col">
<img id="imgLogo" alt="" src="img/logo3.png" width="105" height="48" runat="server">
</td>
<td align="left" valign="middle" scope="col">
<img id="logo" alt="" src="img/ioffice_logo.png" runat="server">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" scope="col">
<table width="447" border="0" cellspacing="3" cellpadding="0">
<tr>
<td scope="col" nowrap>
<asp:Label ID="lblLoginID" runat="server" CssClass="td">用户名(U):</asp:Label>
</td>
<td width="363" scope="col">
<asp:TextBox ID="txtloginid" runat="server" EnableTheming="False" EnableViewState="False"
MaxLength="50" AutoCompleteType="Disabled" CssClass="login_I"></asp:TextBox><asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtloginid" Display="Static"
InitialValue="" ErrorMessage="[用户名]">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td nowrap>
<asp:Label ID="lblPwd" runat="server" CssClass="td">密码(P):</asp:Label>
</td>
<td>
<asp:TextBox ID="txtpwd" runat="server" TextMode="Password" EnableViewState="False"
EnableTheming="False" MaxLength="20" CssClass="login_I"></asp:TextBox><asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server" ErrorMessage="[密码输入非法]" Display="Static"
ControlToValidate="txtpwd" ValidationExpression="[\x00-\xff]+">*</asp:RegularExpressionValidator>
<asp:TextBox ID="txtSam" runat="server" Height="1px" Width="1px" Style="display: none"></asp:TextBox>
</td>
</tr>
<tr height="18">
<td nowrap>
<asp:Label ID="lblBranch" runat="server" CssClass="td">单位简称:</asp:Label>
</td>
<td>
<asp:DropDownList ID="drpBranch" runat="server" DataValueField="branchid" DataTextField="simcode"
CssClass="login_S">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:CheckBox ID="chkLoginInWindow" runat="server" Text="本窗口打开" ToolTip="使用此选项系统会在当前页面显示iOffice.net,而不使用弹出窗口的模式!"
CssClass="td" />
</td>
<td>
<asp:CheckBox ID="chkSavePwd" runat="server" Text="记住我的密码" ToolTip="使用此选项可以在下次登录时不用再次输入密码,系统能自动登录!"
CssClass="td" />
</td>
</tr>
</table>
</td>
</tr>
<tr height="75px;">
<td colspan="2" align="right" style="padding-right: 60px;">
<asp:Button ID="ok" runat="server" CausesValidation="False" CssClass="btn" Text="确 认">
</asp:Button>
<asp:Button ID="cancel" runat="server" CausesValidation="False" CssClass="btn" Text="取 消">
</asp:Button>
</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
</ul>
</div>
</div>
</div>
<asp:ValidationSummary ID="valSum" runat="server" Width="146px" HeaderText="你必须输入如下数据:"
ShowMessageBox="True" ShowSummary="False" Height="94px"></asp:ValidationSummary>
</form>
</body>
</html>
<%@ Page Language="vb" AutoEventWireup="false" Inherits="iOffice.Unilogin" CodeBehind="Login.aspx.vb" %>
<html>
<head runat="server">
<link href="App_Themes/Login/Styles.css" type="text/css" rel="stylesheet">
</head>
<script language="javascript">
window.status = '<%=WinStatus%>'
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher
{
for (var i = 0; i < document.images.length; i++) {
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
var imgAttribs = img.attributes;
for (var j = 0; j < imgAttribs.length; j++) {
var imgAttrib = imgAttribs[j];
if (imgAttrib.nodeName == "align") {
if (imgAttrib.nodeValue == "left") imgStyle = "float:left;" + imgStyle
if (imgAttrib.nodeValue == "right") imgStyle = "float:right;" + imgStyle
break
}
}
var strNewHTML = "<span " + imgID + imgClass + imgTitle
strNewHTML += " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
strNewHTML += "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i - 1
}
}
}
window.attachEvent("onload", correctPNG);
window.attachEvent("onload", aps);
</script>
<body style="overflow: hidden;">
<form id="frm" runat="server" defaultfocus="txtpwd" defaultbutton="ok">
<div id="main">
<div id="div_box">
<div id="login_box">
<ul>
<li class="login_T">
<asp:Label ID="lblLogin" runat="server"></asp:Label></li>
<li>
<table width="430" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" scope="col">
<table width="447" border="0" cellspacing="0" cellpadding="0" style="padding: 35px 0px 22px 0px;">
<tr>
<td align="left" valign="middle" scope="col">
<img id="imgLogo" alt="" src="img/logo3.png" width="105" height="48" runat="server">
</td>
<td align="left" valign="middle" scope="col">
<img id="logo" alt="" src="img/ioffice_logo.png" runat="server">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" scope="col">
<table width="447" border="0" cellspacing="3" cellpadding="0">
<tr>
<td scope="col" nowrap>
<asp:Label ID="lblLoginID" runat="server" CssClass="td">用户名(U):</asp:Label>
</td>
<td width="363" scope="col">
<asp:TextBox ID="txtloginid" runat="server" EnableTheming="False" EnableViewState="False"
MaxLength="50" AutoCompleteType="Disabled" CssClass="login_I"></asp:TextBox><asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtloginid" Display="Static"
InitialValue="" ErrorMessage="[用户名]">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td nowrap>
<asp:Label ID="lblPwd" runat="server" CssClass="td">密码(P):</asp:Label>
</td>
<td>
<asp:TextBox ID="txtpwd" runat="server" TextMode="Password" EnableViewState="False"
EnableTheming="False" MaxLength="20" CssClass="login_I"></asp:TextBox><asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server" ErrorMessage="[密码输入非法]" Display="Static"
ControlToValidate="txtpwd" ValidationExpression="[\x00-\xff]+">*</asp:RegularExpressionValidator>
<asp:TextBox ID="txtSam" runat="server" Height="1px" Width="1px" Style="display: none"></asp:TextBox>
</td>
</tr>
<tr height="18">
<td nowrap>
<asp:Label ID="lblBranch" runat="server" CssClass="td">单位简称:</asp:Label>
</td>
<td>
<asp:DropDownList ID="drpBranch" runat="server" DataValueField="branchid" DataTextField="simcode"
CssClass="login_S">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:CheckBox ID="chkLoginInWindow" runat="server" Text="本窗口打开" ToolTip="使用此选项系统会在当前页面显示iOffice.net,而不使用弹出窗口的模式!"
CssClass="td" />
</td>
<td>
<asp:CheckBox ID="chkSavePwd" runat="server" Text="记住我的密码" ToolTip="使用此选项可以在下次登录时不用再次输入密码,系统能自动登录!"
CssClass="td" />
</td>
</tr>
</table>
</td>
</tr>
<tr height="75px;">
<td colspan="2" align="right" style="padding-right: 60px;">
<asp:Button ID="ok" runat="server" CausesValidation="False" CssClass="btn" Text="确 认">
</asp:Button>
<asp:Button ID="cancel" runat="server" CausesValidation="False" CssClass="btn" Text="取 消">
</asp:Button>
</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
</ul>
</div>
</div>
</div>
<asp:ValidationSummary ID="valSum" runat="server" Width="146px" HeaderText="你必须输入如下数据:"
ShowMessageBox="True" ShowSummary="False" Height="94px"></asp:ValidationSummary>
</form>
</body>
</html>


