清华大学出版社 TSINGHUA UNIVERSITY PRESS <body> <%fname=request querystring("Firstname") Iname=request querystring ("Lastname") fname="George and Iname=Washington then %> Hi. You must be the first president! < else % Hi! Nice to meet you %end if%> </body> </htmI>
<body> <% fname=request.querystring("Firstname") lname=request.querystring("Lastname") If fname="George" and lname="Washington“ then %> Hi.You must be the first president! <% else %> Hi! Nice to Meet You <%end if%> </body> </html>
清华大学出版社 TSINGHUA UNIVERSITY PRESS 例96 <html> <bod FONT COLOREGreen"> <% F Time<#12:00:00# And time>=#00:00:00# Then % 早上好,今天天气不赖啊! < ElseIf Time #19: 00: 00# And time > #12:00:00#Then%> 下午好! < Else % 哈喽!今晚你有没有去IRC聊天! < End if % </body> </html>
例9.6 <html> <body> <FONT COLOR="Green"> <% If Time < #12:00:00# And Time >= #00:00:00# Then %> 早上好,今天天气不赖啊 ! <% ElseIf Time < #19:00:00# And Time >= #12:00:00# Then %> 下午好 ! <% Else %> 哈喽 ! 今晚你有没有去 IRC 聊天 ! <% End If %> </body> </html>
清华大学出版社 TSINGHUA UNIVERSITY PRESS 2) Select case语句 例97 < fname =request querystring("Firstname") Iname=request querystring (" Lastname") name=fname+iname Select case name case georgewashington response. write Hi. You must be the first president!<p>
(2)Select Case语句 例9.7 <% fname=request.querystring("Firstname") lname=request.querystring("Lastname") name=fname+lname Select case name case "georgewashington" response.write "Hi.You must be the first president!<p>
清华大学出版社 TSINGHUA UNIVERSITY PRESS case"ronaldreagan response. write" Hi. You must be the actor resident!<p> case Jimmycarter response. write Hi. You must be the peanut farmer president <p> case else response. write Hi! Nice to Meet You End select %>
case "ronaldreagan" response.write "Hi.You must be the actor president!<p>" case "jimmycarter" response.write "Hi.You must be the peanut farmer president!<p> case else response.write "Hi!Nice to Meet You" End Select %>
清华大学出版社 TSINGHUA UNIVERSITY PRESS 2循环结构 (1) Do Until….Loop (2)Do. Loop Until 例98 <html> <head> <title> DoLoop asp</title> </head> <body> <p>请将今年到本月为止的每个月份的销售结 算记录填写在本页之上。<P < counter=1
2.循环结构 (1)Do Until ... Loop (2)Do... Loop Until 例9.8 <html> <head> <title>DoLoop.asp</title> </head> <body> <p> 请将今年到本月为止的每个月份的销售结 算记录填写在本页之上。<P> <% counter=1