咖啡虫之家

我的日历
友情链接
访问计数
最新评论
获取RSS
我的 Blog:
kafeichong 最新的 20 条日志
[javascript]
[asp]
[常识]
[SQL]
[文学]
[Dreamweaver]
[网页设计]
[flash]
[片言碎语]
[php]
[web standard]
全站 Blog:
全站最新的 20 条日志

我的asp学习笔记-Variables

Author:咖啡虫 PublishTime:2004-6-14
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>

分类于:asp

 

Powered by 5DBlog.com