时间:2021-07-01 10:21:17 帮助过:52人阅读
Class Con_Error
Private blnError
private strMessage
private strJSMessage
Private Sub Class_initialize()
blnError = false
strMessage = ""
End Sub
Private Sub Class_Terminate()
End Sub
' ==================================================================================
' Property
' ==================================================================================
' Message :
Public Property Let Message(ByVal value)
strMessage = value
End Property
Public Property Get Message()
Message = strMessage
End Property
' Error number
Public Property Get Error()
Error = blnError
End Property
' JSMessage : show in messagebox
Private Property Get JSMessage()
strJSMessage = Replace(strMessage , "<br>" , "\n")
strJSMessage = Replace(strJSMessage , vbCrLf , "")
JSMessage = strJSMessage
End Property
' ==================================================================================
' Method
' ==================================================================================
' Add : add an Error message
Public Sub Add(ByVal vMessage)
blnError = true
strMessage = strMessage & vMessage & "<br>"
End Sub
Public Sub Clear
blnError = false
strMessage = ""
End Sub
' Alert
Public Sub Alert(ByVal vMessage)
strJSMessage = JSMessage & vMessage
%>
<script language="javascript" >
<!--//
alert("<%=strJSMessage %>");
//-->
</script>
<%
End Sub
' Alert_Back : alert and back
Public Sub Alert_Back(ByVal vMessage)
strJSMessage = JSMessage & vMessage
%>
<script language="javascript" >
<!--//
alert("<%=strJSMessage %>");
history.back();
//-->
</script>
<%
response.end
End Sub
' Alert_Close : alert and close
Public Sub Alert_Close(ByVal vMessage)
strJSMessage = JSMessage & vMessage
%>
<script language="javascript" >
<!--//
alert("<%=strJSMessage %>");
window.opener = null;
window.close();
//-->
</script>
<%
response.end
End Sub
'*********************************************
'Debug : response.write ,use it to delete debug message easily,just seach "e.Debug" from files
'*********************************************
Public Sub OK_Go(ByVal vMessage,ByVal vURL)
strJSMessage = JSMessage & vMessage
%>
<script language="javascript" >
<!--//
alert("<%=strJSMessage %>");
location.href = '<%=vURL %>';
//-->
</script>
<%
response.end
End Sub
Public Sub Go(ByVal vURL)
response.Redirect vURL
response.end
End Sub
'*********************************************
'Debug : response.write ,use it to delete debug message easily,just seach "e.Debug" from files
'*********************************************
Public Sub Debug (ByVal vMessage)
response.Write vMessage
response.flush
End Sub
' ****** W : write
Public Sub W(ByVal vMessage)
response.Write vMessage
End Sub
' ****** BR : write <br>
Public Sub Br
response.Write "<BR />"
End Sub
'*********************************************
'Pause : response.end , mark debug info clearly
'*********************************************
Public Sub Pause
response.end
End Sub
Public Sub P
response.end
End Sub
Public Sub [Stop]
response.end
End Sub
Public Sub [end]
response.end
End Sub
End Class