📄 5.htm
字号:
Application.Unlock
%>
This application page has been visited
<%= Application ("NumVisits") % > times!</pre>
</font>
</div>
<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"> Unlock </b></font>方法释放了锁定的物件以便下个用户端可以增加NumVisits变数。</font></p>
<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">应用程式的<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> lock </b></font>方法是累积的,也就是如果同样的指令档使用了<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> lock </b></font>好几次,那麽它也必须使用<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> Unlock </b></font>同样的次数来释放<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> Application </b></font>物件中的变数。如果不这样做,<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> Application </b></font>物件中对变数的锁定会持续到指令档执行完後。</font></p>
<hr style="line-height: 25px">
<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">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Application </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">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> lock </b></font>。</font></p>
<a name="205002" style="line-height: 25px">
<p><font face="arial" color="#3e70d7" size="5" style="line-height: 25px">
<b style="line-height: 25px">ASPError物件<br style="line-height: 25px">
</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"> ASPError </b></font>物件来得到ASP网页的指令档中产生的错误状态资讯。<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> ASPError </b></font>物件是由<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> Server.
GetLastError </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>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px">ASPError.property</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>
<center style="line-height: 25px">
<table border="1" style="line-height: 25px">
<tbody style="line-height: 25px">
<tr style="line-height: 25px">
<td style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> ASPCode </b></font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
传回一个IIS 5.0产生的错误代码。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Number </b></font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
传回标准的COM错误代码。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Source </b></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 face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Category </b></font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指出是否错误的来源是ASP内建的,或是指令档语言或物件。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> File </b></font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指出错误发生时正在执行 .asp的档案名称。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Line </b></font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指出错误发生时 .asp档案所在的行。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Column </b></font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
指出错误发生时 .asp档案所在的列。</font></td>
</tr>
<tr style="line-height: 25px">
<td style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Description </b></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 face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> ASP Description </b></font></td>
<td style="line-height: 25px"><font size="2" style="line-height: 25px">
如果是关於ASP的错误,传回一个更详细的描述。</font></td>
</tr>
</table>
</center>
<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">当IIS
5.0遇到一个在编译或执行
.asp档案时产生的错误时,它就会产生一个500;100错误。在预设的状态下,所有的网站和应用程式都会把这个500;100错误传送到预设的
.asp档案中。在这个500;100错误产生之後,IIS也会产生描述错误状态的一个<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> ASPError </b></font>物件的例项。若需如何使用IIS嵌入式管理单元来改变
.asp档案,进而处理500;100这类错误的资讯,请参阅《Microsoft Internet Information Services
5.0超级管理手册—网站管理篇》第3章〈伺服器基础管理〉中的〈启用ASP错误处理〉 。</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">
下面从500-100.asp档案中摘录出的例子说明了<font face="arial" color="#3e80d7" size="2" style="line-height: 25px"><b style="line-height: 25px"> ASPError </b></font>物件所使用的资讯:</font></p>
<div style="line-height: 25px; background-color: #d7d7d7">
<font face="Arial" size="3" style="line-height: 25px">
<pre style="line-height: 25px"><%
Response.Write objASPError.Category
If objASPError.ASPCode > "" Then Response.Write ", " & objASPError.ASPCode
Response.Write " (0x" & Hex (objASPError.Number ) & ")" & "<br>"
Response.Write "<b>" & objASPError.Description & "</b><br>"
If objASPError.ASPDescription > "" Then Response.Write
objASPError.ASPDescription & "<br>"
blnErrorWritten = False
'Only show the Source if it is available and the request is from the
same machine as IIS
If objASPError.Source > "" Then
strServername = LCase ( Request.ServerVariables ("SERVER_NAME") )
strServerIP = Request.ServerVariables ( "LOCAL_ADDR")
strRemoteIP = Request.ServerVariables ("REMOTE_ADDR")
If (strServername = "localhost" Or strServerIP = strRemoteIP ) And
objASPError.File <> "?" Then
Response.Write objASPError.File
If objASPError.Line > 0 Then Response.Write ", line " &
objASPError.Line
If objASPError.Column > 0 Then Response.Write ", column " &
objASPError.Column
Response.Write "<br>"
Response.Write "<font style=""COLOR:000000; FONT:8pt/11pt courier
new""><b>"
Response.Write Server.HTMLEncode (obj ASPError.Source ) & "<br>"
If objASPError.Column > 0 Then Response.Write
String ((objASPError.Column - 1 ), "-" )& "^<br>"
Response.Write"</b></font>"
blnErrorWritten = True
End If
End If
If Not blnErrorWritten And objASPError.File <> "?" Then
Response.Write "<b>"& objASPError.File
If objASPError.Line > 0 Then Response.Write ", line "&
obj ASPError.Line
If objASPError.Column > 0 Then Response.Write",column "&
objASPError.Column
Response.Write "</b><br>"
End If
%></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="#000000" size="2" style="line-height: 25px">
<font face="arial" color="#3e80d7" size="2" style="line-height: 25px">
<b style="line-height: 25px"> Server.GetLastError </b></font>。</font></p>
<p><font face="arial" color="#3e72d7" size="4" style="line-height: 25px">
<b style="line-height: 25px">ASPCode<br style="line-height: 25px">
</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"> ASPCode </b></font>属性会传回一个由IIS 5.0产生,包含错误代码的字串。</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">ASPError.ASPCode ()</pre>
</font>
</div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -