<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title><%="頁面標題"%></title> </head> <body> <%="多條件判斷"%> <% response.Write("<br />") response.Write("利用response對象的Write方法輸出地內容!") %> <br /> <% dim a,b a=200 b=300 response.Write("兩數之和為:") response.Write(a+b) response.Write("<br />") if a=100 then response.Write("a=100,第一個條件滿足。") elseif a=200 then response.Write("a=200,第二個條件滿足。") elseif a=300 then response.Write("a=300,第三個條件滿足。") else response.Write("三個條件都不滿足。") end if %> <% response.Write("<br />") dim textnumber textnumber=200 select case textnumber case 100 response.Write("數值為100, 條件滿足!") case 200 response.Write("數值為200,條件滿足 !") case 300 response.Write("數值為300 ,條件滿足!") case else response.Write("以上條件,條件都不滿足!") end select %> <% response.Write("<br />") dim i,sum i=0 sum=0 while i<=100 sum=sum+i i=i+1 wend response.Write("100以內所有整數的和為:") response.Write(sum) %> <% response.Write("<br />") dim w,s w=0 s=0 do s=s+w w=w+1 loop while w<=100 response.Write("100之內的所有整數之和為:") response.Write(s) response.Write("<br/>") response.Write("w的值是:") response.Write(w) %> </body> </html>
具體的介紹就不多說了,大家看下實例就可以了