您现在的位置:
发布时间:2022-07-12 19:34:34
【导语】ASP.NET又称为ASP+,不仅仅是ASP的简单升级,而是微软公司推出的新一代脚本语言。无忧考网准备了《ASP.NET教程:ASP.Net写的浏览器间谍》,供大家参考!
程序执行的例子在 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();
&data-filtered="filtered"> <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>