90 likes | 221 Views
การพัฒนาโปรแกรมประยุกต์บนเว็บ. ASP Structure Programming. มหาวิทยาลัยโยนก จังหวัดลำปาง ศูนย์กลางความรู้และภูมิปัญญาแผ่นดิน http://www.yonok.ac.th. อ.บุรินทร์ รุจจนพันธุ์ . ปรับปรุง 23 มิถุนายน 2550. ASP History. ASP (Active Server Page)
E N D
การพัฒนาโปรแกรมประยุกต์บนเว็บการพัฒนาโปรแกรมประยุกต์บนเว็บ ASP Structure Programming มหาวิทยาลัยโยนก จังหวัดลำปาง ศูนย์กลางความรู้และภูมิปัญญาแผ่นดิน http://www.yonok.ac.th อ.บุรินทร์ รุจจนพันธุ์ . ปรับปรุง 23 มิถุนายน 2550
ASP History ASP (Active Server Page) ภาษา ASP เป็นโปรแกรมที่มากับ Internet Information Server (IIS) บริษัทไมโครซอฟท์เริ่มโครงการ ASP ช่วงธันวาคม 2540 ภาษานี้ถูกมองว่ามาล่าช้าเมื่อเทียบกับภาษาในกลุ่มเดียวกัน ในธันวาคม 2541 ได้เปิดตัว ASP 2.0 ใน WindowsNT4 และ ASP 3.0 ใน Windows 2000
GET & POST http://localhost/x.asp?a=5 <form action=y.asp method=post> <input name=b><input type=submit></form> <% a = request.querystring("a") b = request.form("b") response.write(a & b) %>
การทำงานแบบตามลำดับ (Sequence) <body bgcolor=yellow> <font color="#ddffdd"> <% response.write(5) response.write("abc") %> <hr> welcome to my webpage
การทำงานตามเงื่อนไข (Decision) <% a = "" if(len(request.form("a")) > 0)then a = request.form("a") end if if (a = "2") then response.write(a & a) else response.write(a) end if %>
การทำซ้ำ (Loop) ด้วยคำสั่ง for <% for each Item in request.servervariables response.write Item & " = " response.write request.servervariables(Item) response.write "<br>" next %> <%for n=1 to 5%> <%=n%> <br> <%next%> <% for n=1 to 5 response.write( n & "<br>") next %>
การทำซ้ำ (Loop) ด้วยคำสั่ง while <% n = 1 while n <= 5 response.write( n & "<br>") n = n + 1 wend %>
คำสั่ง while กับอาร์เรย์ <% dim a(10) a(0) = 5 a(1) = 10 a(2) = 9 i = 0 while i < Ubound(a) response.write(a(i)) i = i + 1 wend %>
คำสั่ง for กับ อาร์เรย์ <% dim a(10) a(0) = 5 a(1) = 10 a(2) = 9 for i = 0 to (Ubound(a) - 1) response.write(a(i)) next %>