2013年10月25日 星期五

ASP(vbscript) Querystring 判斷

記錄一下 ASP(vbscript) Querystring 的判斷結果
<%
   if IsEmpty(Request("a")) then
      ' http://localhost/TestQueryString.asp
      response.write "Empty"
   end if

   if IsNull(Request("a")) then
      response.write "Null"
   end if

   if Request("a") = "" then
      ' http://localhost/TestQueryString.asp
      ' http://localhost/TestQueryString.asp?a
      ' http://localhost/TestQueryString.asp?a=
      response.write "Blank"
   end if

   if IsNumeric(Request("a")) then
      ' http://localhost/TestQueryString.asp
      ' http://localhost/TestQueryString.asp?a=123
      ' http://localhost/TestQueryString.asp?a=-123
      ' http://localhost/TestQueryString.asp?a=0.123
      ' http://localhost/TestQueryString.asp?a=-0.123
      response.write "Numeric"
   end if

   if Request("a") is nothing then
      response.write "Nothing"
   end if
%>

沒有留言:

張貼留言