Created
January 9, 2013 07:29
-
-
Save friskfly/4491335 to your computer and use it in GitHub Desktop.
asp 异常机制
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
Dim myVar | |
On Error Resume Next | |
'下面一行代码会在MSXML 4.0没有被安装或者已经损坏的情况下产生错误 | |
Set myVar = Server.CreateObject("MSXML2.DOMDocument.4.0") | |
If Err.Number <> 0 Then | |
' 在这里处理错误 | |
' 结束错误处理,避免以后发生的错误无法被发现 | |
On Error GoTo 0 | |
Else | |
' myVar 现在指向 MSXML 4.0 DOMDocument的一个实例 | |
' 结束错误处理,避免以后发生的错误无法被发现 | |
On Error GoTo 0 | |
End If | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment