📄 6.htm
字号:
</b></font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px">Set BrowserType = Server.CreateObject ("MSWC.BrowserType")</pre>
</font>
</div>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">参数<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> BrowserType </b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">指定由<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> Server.CreateObject </b></font>建立的<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> BrowserType </b></font>物件的名称。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">范例<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
下面的范例使用BrowserType物件将目前浏览器的效能列为一张表,并显示出来:</font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px"><% Set bc = Server.CreateObject ("MSWC.BrowserType") %>
< TABLE BORDER=1 >
< TR >< TD > Browser </ TD >< TD ><%= bc.browser %>
< TR >< TD > Version </ TD >< TD ><%= bc.version %></ TD ></ TR >
< TR >< TD > Frames </ TD >< TD >
<% if (bc.frames = TRUE ) then %> TRUE
<% else %> FALSE
<% end if %> </ TD ></ TR >
< TR >< TD > Tables </ TD >< TD >
<% if (bc.tables = TRUE ) then %> TRUE
<% else %> FALSE
<% end if %></ TD ></ TR >
< TR >< TD > BackgroundSounds </ TD >< TD >
<% if (bc. BackgroundSounds = TRUE ) then %> TRUE
<% else %> FALSE
<% end if %> </ TD ></ TR >
< TR >< TD > VBScript </ TD >< TD >
<% if (bc.vbscript = TRUE ) then %> TRUE
<% else %> FALSE
<% end if %> </ TD ></ TR >
< TR >< TD > JScript </ TD >< TD >
<% if (bc.javascript = TRUE ) then %> TRUE
<% else %> FALSE
<% end if %> </ TD ></ TR >
</ TABLE ></pre>
</font>
</div>
<p><font face="arial" color="#3e72d7" size="4" style="line-height: 25px">
<b style="line-height: 25px">Browscap.ini档案<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">您可以在Browscap.ini档案中为任何数目的浏览器宣告属性定义,也可以设定用户端浏览器在清单中没有定义时应该使用的预设值。对於每一个浏览器定义,您都必须提供一个HTTP
User Agent标题以及希望与其关联的属性和值。有关HTTP User Agent标题格式的更多资讯,请参阅 </font></a><font face="arial" color="#000000" size="2" style="line-height: 25px"><a target="_new" href="http://www.w3.org" style="line-height: 25px">http://www.w3.org</a> 之World
Wide Web Consortium上的HTTP说明。</font></p>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">语法<br style="line-height: 25px">
</b></font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px">[; comments]
[HTTPUserAgentHeader]
[parent = browser Definition]
[property1 = value1]
...
[property N = valueN]
[Default Browser Capability Settings]
[default Property1 = defaultValue1]
...
[default PropertyN = defaultValueN]</pre>
</font>
</div>
<p><font face="arial" color="#3e76d7" size="2" style="line-height: 25px">
<b style="line-height: 25px">参数<br style="line-height: 25px">
</b></font></p>
<p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> comments </b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
任何以一个分号(;)开始的行。被BrowserType物件忽略掉的注解可以出现在Browscap.ini档案中任何地方。</font></p>
<p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> HTTPUserAgentHeader </b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">指定
HTTP User Agent标题,以使它和<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> property
N </b></font>中指定的浏览器属性相关联。Browscap.ini档案可以包含多个浏览器定义,每个都以一个唯一的HTTPUserAgentHeade值开始。</font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
您可以使用星号(*)来替代零个或多个字元;用(?)来替代单个字元。</font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
例如,如果为HTTPUserAgentHeade指定了下面的字串:</font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px">[Mozilla/4.0 (compatible; MSIE 5.0;* Windows NT )]</pre>
</font>
</div>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
那麽它会将以下所有的User Agent标题对应起来:</font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px">[Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)]
[Mozilla/4.0 (compatible; MSIE 5.0; AK; Windows NT)]
[Mozilla/4.0 (compatible; MSIE 5.0; SK; Windows NT)]</pre>
</font>
</div>
<hr style="line-height: 25px">
<p>
<font face="Arial" color="#3e77d7" size="3" Black style="line-height: 25px">
<b style="line-height: 25px">说明</b></font> </p>
<p><font face="arial" color="black" size="2" style="line-height: 25px"></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> BrowserType </b></font>物件首先尝试寻找一个和HTTPUserAgent
Header值完全一致的相同项目。如果不成功,它才会使用符号来寻找相同项目。</font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
如果使用符号後,有不止一个浏览器定义和User Agent标题符合,那麽<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> BrowserType </b></font>物件会传回一个和User
Agent标题最接近的相同项目。最接近的相同项目是指替代字元数最少的项目。</font></p>
</font>
<p> </p>
<hr style="line-height: 25px">
<p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> browser Definition </b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
一个选择性的参数,它定义是否使用某个浏览器的HTTP User
Agent标题作为父浏览器。目前的浏览器定义将会继承父浏览器的所有属性。这有助於为一个新版本的浏览器定义属性,因为新版本通常会保留先前版本的大多数属性。您可以透过为属性明确设定新值来改写这些继承属性的值,其语法为property
N=valueN。</font></p>
<p><font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> property N </b></font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
一个选择性的参数,它指定要设定之浏览器的属性名称。此参数必须以英文字母开头,长度不能超过255个字元。Browscap.ini档案中的每一个浏览器定义可以包含足够的属性宣告。例如,如果应用程式只需知道使用者浏览器是否支援VBScript,那麽只要为每个浏览器定义增加一个属性即可。</font></p>
<p><font face="arial" color="#000000" size="2" style="line-height: 25px">
下表列出了一些可能的属性:</font></p>
<center style="line-height: 25px">
<table border="1" style="line-height: 25px">
<tbody style="line-height: 25px">
<tr style="line-height: 25px">
<th style="line-height: 25px"><font size="2" style="line-height: 25px">
属性</font> </th>
<th style="line-height: 25px"><font size="2" style="line-height: 25px">
说明</font></th>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
ActiveXControls</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否支援ActiveX控制项。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Backgroundsounds</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否支援背景声音。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Beta</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否是测试软体。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Browser</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器的名称。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Cdf</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否支援Webcasting的Channel Definition Format。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Cookies</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否支援cookies。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Frames</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否支援框架。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Javaapplets</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否支援Java applet。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Javascript</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否支援JScript。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Platform</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器的执行平台。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Tables</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否支援表格。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Vbscript</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器是否支援VBScript。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
Version</font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指定浏览器的版本编号。</font></td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -