特色栏目

ASP源码

PHP源码

.NET源码

JSP源码

游戏频道
专题合集
关闭菜单
首页> ASP教程> 将ASP的Debug变得简单的两个函数

将ASP的Debug变得简单的两个函数

时间:2009-06-24 17:04:03 作者:互联网

<%
'---------------------------------------------------------------------------
'                   程序作用:打印re***st.form输入的所有值
'---------------------------------------------------------------------------
Re***nse.Write FormData()
    function FormData()
     Dim llngMaxFieldIndex
     Dim llngFieldIndex
     Dim llngMaxValueIndex
     Dim llngValueIndex
     Dim lstrDebug
     ' Count Form
     llngMaxFieldIndex = Re***st.Form.Count
    
     ' Let user know if Form Do Not exist
     if llngMaxFieldIndex = 0 Then
      FormData = "Form data is empty."
      Exit function
     End if
    
     ' Begin building a list of all Form
     lstrDebug = "

    "
        
         ' Loop through Each Form
         For llngFieldIndex = 1 To llngMaxFieldIndex
          lstrDebug = lstrDebug & "
  1. " & Se***r.HTMLEncode(Re***st.Form.Key(llngFieldIndex))
         
          ' Count the values
          llngMaxValueIndex = Re***st.Form(llngFieldIndex).Count
         
          ' if the Field doesn't have multiple values ...
          if llngMaxValueIndex = 1 Then
           lstrDebug = lstrDebug & " = "
           lstrDebug = lstrDebug & Se***r.HTMLEncode(Re***st.Form.Item(llngFieldIndex))
          ' Else Loop through Each value
          Else
           lstrDebug = lstrDebug & "
      "
             For llngValueIndex = 1 To llngMaxValueIndex
              lstrDebug = lstrDebug & "
    1. "
              lstrDebug = lstrDebug & Se***r.HTMLEncode(Re***st.Form(llngFieldIndex)(llngValueIndex))
              lstrDebug = lstrDebug & "
    2. "
             Next
             lstrDebug = lstrDebug & "
    "
          End if
          lstrDebug = lstrDebug & "
  2. "
         Next
         lstrDebug = lstrDebug & "
"
     ' Return the data
     FormData = lstrDebug
    
    End function

%>

<%
'-------------------------------------------------------------------------
'           函数功能:输出所有输入re***st.querystring值,用于调试!
'-------------------------------------------------------------------------

   Re***nse.Write QueryStringData()
    function QueryStringData()
     Dim llngMaxFieldIndex
     Dim llngFieldIndex
     Dim llngMaxValueIndex
     Dim llngValueIndex
     Dim lstrDebug
     ' Count QueryString
     llngMaxFieldIndex = Re***st.QueryString.Count
    
     ' Let user know if QueryString Do Not exist
     if llngMaxFieldIndex = 0 Then
      QueryStringData = "QueryString data is empty."
      Exit function
     End if
    
     ' Begin building a list of all QueryString
     lstrDebug = "

    "
        
         ' Loop through Each QueryString
         For llngFieldIndex = 1 To llngMaxFieldIndex
          lstrDebug = lstrDebug & "
  1. " & Se***r.HTMLEncode(Re***st.QueryString.Key(llngFieldIndex))
         
          ' Count the values
          llngMaxValueIndex = Re***st.QueryString(llngFieldIndex).Count
         
          ' if the Field doesn't have multiple values ...
          if llngMaxValueIndex = 1 Then
           lstrDebug = lstrDebug & " = "
           lstrDebug = lstrDebug & Se***r.HTMLEncode(Re***st.QueryString.Item(llngFieldIndex))
          ' Else Loop through Each value
          Else
           lstrDebug = lstrDebug & "
      "
             For llngValueIndex = 1 To llngMaxValueIndex
              lstrDebug = lstrDebug & "
    1. "
              lstrDebug = lstrDebug & Se***r.HTMLEncode(Re***st.QueryString(llngFieldIndex)(llngValueIndex))
              lstrDebug = lstrDebug & "
    2. "
             Next
             lstrDebug = lstrDebug & "
    "
          End if
          lstrDebug = lstrDebug & "
  2. "
         Next
         lstrDebug = lstrDebug & "
"
     ' Return the data
     QueryStringData = lstrDebug
    
    End function

%>

相关文章 最新文章

相关应用

热门文章

猜你喜欢

返回顶部