论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > asp教程
Tag:入门,文摘,实例,技巧,iis,表单,对象,上传,数据库,记录集,session,cookies,存储过程,注入,分页,安全,优化,xmlhttp,fso,jmail,application,防盗链,stream,组件,md5,乱码,缓存,加密,验证码,算法,ubb,正则表达式,水印,,日志,压缩,url重写,控件,函数,破解,触发器,socket,ADO,初学,聊天室,留言本,视频教程

ASP.Net写的浏览器间谍

文章类别:asp | 发表日期:2008-10-5 20:41:29

下面是我写的一个关于HttpBrowserCapabilities组件的应用例子。

程序执行的例子在 http://aspx1.brinkster.com/feidao/code/BrowserSpy.aspx

下面是源程序:

<html>
<head>
  <script runat="server" language="c#">
    public void Page_Load(Object Source, EventArgs E)
    {
      HttpBrowserCapabilities bc= Request.Browser;

      Welcome.Text = "您好,您正在使用 " + bc.Browser + " v." + bc.Version + ",你的运行平台是 " + bc.Platform ;


      ActiveXControls.Text = bc.ActiveXControls.ToString();
      AOL.Text = bc.AOL.ToString();
      BackgroundSounds.Text = bc.BackgroundSounds.ToString();
      Beta.Text = bc.Beta.ToString();
      Browser.Text = bc.Browser.ToString();
      CDF.Text = bc.CDF.ToString();
      Cookies.Text = bc.Cookies.ToString();
      Crawler.Text = bc.Crawler.ToString();
      Frames.Text = bc.Frames.ToString();
      JavaApplets.Text = bc.JavaApplets.ToString();
      JavaScript.Text = bc.JavaScript.ToString();
      MajorVersion.Text = bc.MajorVersion.ToString();
      MinorVersion.Text = bc.MinorVersion.ToString();
      Platform.Text = bc.Platform.ToString();
      Tables.Text = bc.Tables.ToString();
      Type.Text = bc.Type.ToString();
      VBScript.Text = bc.VBScript.ToString();
      Version.Text = bc.Version.ToString();
      Win16.Text = bc.Win16.ToString();
      Win32.Text = bc.Win32.ToString();
    }
  </script>
<asp:Label id="css1" runat="server" />
</head>
<body>
<form runat="server" method="post">
您的浏览器信息已经完全在我们的掌握中了^&^:<br>
<p><asp:Label runat="server" id="Welcome" Font-Bold="True" /></p>
<table border="1" width="400" bordercolor="black" cellpadding="4" cellspacing="0">
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>浏览器属性</b></td>
  <td width="50%"><b>测试结果</b></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>ActiveXControls:</b></td>
  <td width="50%"><asp:Label runat="server" id="ActiveXControls" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>AOL:</b></td>
  <td width="50%"><asp:Label runat="server" id="AOL" /></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>BackgroundSounds:</b></td>
  <td width="50%"><asp:Label runat="server" id="BackgroundSounds" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>Beta:</b></td>
  <td width="50%"><asp:Label runat="server" id="Beta" /></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>Browser:</b></td>
  <td width="50%"><asp:Label runat="server" id="Browser" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>CDF:</b></td>
  <td width="50%"><asp:Label runat="server" id="CDF" /></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>Cookies:</b></td>
  <td width="50%"><asp:Label runat="server" id="Cookies" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>Crawler:</b></td>
  <td width="50%"><asp:Label runat="server" id="Crawler" /></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>Frames:</b></td>
  <td width="50%"><asp:Label runat="server" id="Frames" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>JavaApplets:</b></td>
  <td width="50%"><asp:Label runat="server" id="JavaApplets" /></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>JavaScript:</b></td>
  <td width="50%"><asp:Label runat="server" id="JavaScript" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>MajorVersion:</b></td>
  <td width="50%"><asp:Label runat="server" id="MajorVersion" /></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>MinorVersion:</b></td>
  <td width="50%"><asp:Label runat="server" id="MinorVersion" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>Platform:</b></td>
  <td width="50%"><asp:Label runat="server" id="Platform" /></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>Tables:</b></td>
  <td width="50%"><asp:Label runat="server" id="Tables" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>Type:</b></td>
  <td width="50%"><asp:Label runat="server" id="Type" /></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>VBScript:</b></td>
  <td width="50%"><asp:Label runat="server" id="VBScript" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>Version:</b></td>
  <td width="50%"><asp:Label runat="server" id="Version" /></td>
</tr>
<tr class="OddRow">
  <td width="50%"><b>Win16:</b></td>
  <td width="50%"><asp:Label runat="server" id="Win16" /></td>
</tr>
<tr class="EvenRow" bgcolor="skyblue">
  <td width="50%"><b>Win32:</b></td>
  <td width="50%"><asp:Label runat="server" id="Win32" /></td>
</tr>
</table>
</form>
</body>
</html>

视频教程列表
文章教程搜索
 
Asp推荐教程
Asp热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058