网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
02月27日漏签0天
c#吧 关注:188,816贴子:824,724
  • 看贴

  • 图片

  • 吧主推荐

  • 视频

  • 游戏

  • 1回复贴,共1页
<<返回c#吧
>0< 加载中...

求救在aspx文件添加Request.ServerVariables检测

  • 只看楼主
  • 收藏

  • 回复
  • i是路过de
  • c#爱好者
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
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>


  • i是路过de
  • c#爱好者
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
需要添加的检测代码想按照以下的方式:
if InStr(request.ServerVariables("HTTP_USER_AGENT"),"helloworld")>0 then
response.write("have hello")
else
response.write("not have helloworld")
response.redirect("web.html")
end if


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 1回复贴,共1页
<<返回c#吧
分享到:
©2026 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示