2004/06/14 | 我的asp学习笔记-Variables
类别(asp) | 评论(0) | 阅读(101) | 发表于 23:49
1.Create a variable
<html>
<body>

<%
dim name
name="Donald Duck"
response.write("My name is: " & name)
%>

</body>
</html>
2.Create an array
<html>
<body>

<%
Dim famname(6),i
famname(1) = "Jan Egil"
famname(2) = "Tove"
famname(3) = "Hege"
famname(4) = "Stale"
famname(5) = "Kai Jim"
famname(6) = "Borge"

For i = 1 to 6
      response.write(famname(i) & "<br />")
Next
%>

</body>
</html>
3.Looping through HTML headers
<html>
<body>

<%
dim i 
for i=1 to 6
   response.write("<h" & i & ">Header " & i & "</h" & i & ">")
next
%>

</body>
</html>

4.Time-based greeting using VBScript
<html>
<body>
<%
dim h
h=hour(now())

response.write("
" & now())
response.write(" (Norwegian Time) 
")
If h<12 then
   response.write("Good Morning!")
else
   response.write("Good day!")
end if
%>
</body>
</html>
5.Time-based greeting using &#106avascript 
  <html>
<body>
<%
var d=new Date()
var h=d.getHours()

Response.Write("
")
Response.Write(d + " (Norwegian Time)")
Response.Write("
")
if (h<12)
   {
   Response.Write("Good Morning!")
   }
else
   {
   Response.Write("Good day!")
   }
%>
</body>
</html>

0
这条日志目前没有评论.

发表留言post

用 户Name:
密 码Password:
内 容Comment:
http://www.5d.cn/images/size_down.gif http://www.5d.cn/images/size_up.gif
验 证Verify:
日志分类
首页[223]
javascript[29]
asp[62]
常识[12]
SQL[8]
文学[2]
Dreamweaver[22]
网页设计[25]
flash[20]
片言碎语[21]
php[6]
web standard[16]