Lo más problemático en ASP es que es inconveniente depurar el programa. Creo que muchos amigos pueden usar este método "Response.Write" y luego emitir declaraciones relevantes para ver si es correcto. Hace unos días, escribí una página de 1,000 líneas, que contiene aproximadamente siete u ocho sub/funciones. Usé más de 30 respuestas. Escribe al depurar. Oh, después de la depuración, eliminé estos 30 uno por uno. ¡Estaba cansado!
Hoy vi una clase de depuración (VBS) en ASP. Lo probé, ¡fue increíble!
Cómo usar es muy simple:
test.asp
<!-#includeFile = "debuggingconsole.asp"->
<%
output = "xxxx"
SetDebugStr = newDebuggingConsole
debugstr.enabled = True
DebugStr.print "Valor de la salida de parámetros", salida
'' ...
debugstr.draw
SetDebugStr = nada
%>
================================================================================
depurgingconsole.asp
<%
Classdebuggingconsole
privateBG_Enabled
privateBG_SHOW
privatebg_requesttime
privatebg_finishtime
privateBG_DATA
privateBG_DB_DATA
privatebg_allvars
privatebg_show_default
PRIVEDIVSETS (2)
'' Construktor => setTheDefaultValues
Privatesubclass_initialize ()
dbg_requesttime = ahora ()
dbg_allvars = falso
Setdbg_data = server.createObject ("scripting.dictionary")
Divsets (0) = "<tr> <tdstyle = '' cursor: hand; '' onClick =" "javascript: if (document.getElementById ('' Data#sectname#''). Style.display == '' 'Ninguno' ') {Document.getget.get.get.get.get. ElementById ('' Data#sectname#'' '). Style.display =' 'block' ';} else {document.getElementById (' 'Data#sectname#' '). Style.display =' '' Ninguno '';} "> <Divid = Sect#S Sect#S Sect ectname#style = "" Font-Weight: Bold; Cursor: Hand; Background:#7EA5D7; Color: White; Padding-Left: 4; Right-Right: 4; Padding-Bottom: 2; ""> |#Título#| <Dividid = Data#sectname#style = "" cursor: text; visual
Divsets (1) = "<tr> <td> <divid = sect#sectname#style =" "Font-Weight: Bold; Cursor: Hand; Fondo:#7ea5d7; color: blanco; almohadilla: 4; Right-Right: 4; P; P Addent-Bottom: 2; "" onClick = "" javaScript: if (document.getElementById ('' data#sectname#''). style.display == '' none '') {document.getElementById ('' data data #sectName#''). style.display = '' block '';} else {document.getElementById ('' data#sectname#''). style.display = '' none '';} ""> |#Title#| <Divid = data#s#s 's ectname#style = "" cursor: text; visualización: bloque; fondo: #fffff; padding-left: 8; "" onClick = "" window.event.cancelbubble = true; ""> |#datos#| </div> | "
Divsets (2) = "<tr> <td> <divid = sect#sectname#style =" "fondo:#7ea5d7; color: lightheelblue; relleno-izquierda: 4; almohadilla: 4; padd Ing-Bottom: 2; "> |#Título#| <divid = data#sectname#style =" "Pantalla: Ninguno; Background: LightSteelBlue; Padding-Left: 8" "> |#Data#| </div> |"