《ASP网络编程》学习笔记之二
来源:互联网 发布:产品介绍动画制作软件 编辑:程序博客网 时间:2024/04/30 13:37
1、使用Response对象在网页上输出内容
<HTML>
<HEAD>
<TITLE>一个简单的ASP程序</TITLE>
</HEAD>
<BODY>
<%
if hour(now) = 0 then
response.write "现在是午夜。 "
end if
if hour(now) = 12 then
response.write "现在是中午。"
end if
if (hour(now) >=1) and (hour(now) <= 11) then
response.write "上午" & hour(now) & "点。"
end if
if (hour(now) >= 13) and (hour(now) <=23) then
response.write "下午" & hour(now) -12 & "点。"
end if
%>
</BODY>
</HTML>
2、For循环
<HTML>
<HEAD>
<TITLE>创建一个10*10的表格 </TITLE>
</HEAD>
<BODY>
<P align=center>创建10*10的表格</P>
<table aligh=center cellspacing=0 cellpadding=10 border=1>
<%
For intRow = 1 to 10
Response.write "<tr>"
For intCol = 1 to 10
Response.write "<td>" & (intRow - 1) * 10 + intCol & "</td>"
Next
Response.write "</tr>"
Next
%>
</table>
</Body>
</HTML>
3、CSS文件
<style type="text/css">
<!--
body,table,tr,td {color:#888888;font-size: 9pt; text-decoration: none}
A:link {color:#333333; text-decoration:none}
A:visited {color: #333333; text-decoration:none}
A:active {color: #CC0001; text-decoration:none}
A:hover { color: #CC0001; text-decoration: underline}
-->
</style>
3、Do loop循环
<HTML>
<HEAD>
<TITLE>倒三角形图案</TITLE>
<link href="../css.css" rel=stylesheet" type="text/css">
</HEAD>
<BODY>
<table align=center>
<tr><td>
<%
intRow=15
intCol=1
Do while
4、过程
<%
function tranStr(oldStr) '转换字符串函数
dim newStr
newStr = trim(oldStrr)
newStr = replace(newStr," ' "," ' ' ")
tranStr = newStr
end function
%>
5、Err对象无错误显示
<html>
<head><title>没有设置 Option Explicit 语句</title></head>
<body>
<%
Dim intYourSalary
intYourSalary = 100000
Response.write ("您的薪水是 $" & CCur (intYorSalary) & "。<BR>")
%>
</body>
</html>
6、Err对象有错误显示
<%option explicit %>
<html>
<head><title>错误处理 </title></head>
<body>
<%
On Error Resume Next
dim intYourSalary
intYourSalary = 100000
Response.write ("您的薪水是 $" & CCur (intYorSalary) & ".<BR>")
IF Err.number <>0 THEN
response.write "错误号是: " & Err.number & "<br>"
response.write "错误号是" " & Err.Description
end if
%>
</body>
</html>
- 《ASP网络编程》学习笔记之二
- 《ASP网络编程》学习笔记之三
- 《ASP网络编程》学习笔记之四
- 学习笔记之SOCKET网络编程之二
- Boost asio学习笔记之二—— 网络编程
- Java学习笔记之网络编程(二):TCP
- 《ASP网络编程》学习笔记之一
- asp.net网络编程学习笔记
- asp.net2.0网络编程学习笔记
- 《UNIX网络编程 》学习笔记 (二)
- 黑马程序员-学习笔记/网络编程二
- windows网络编程学习笔记二
- java_网络编程学习笔记(二)
- 网络编程学习笔记整理(二)
- python网络编程学习笔记(二)
- 网络编程之SOCKET编程学习笔记
- 【网络编程】之二、socket API学习
- 【网络编程】之二、socket API学习
- Linux FAQ 之三——系统设置篇
- oracle-检查对象存在与否,并建立相应对象--plsql中使用DDL语句如Create 等
- [08-01] 再斩灰鸽子Backdoor.Gpigeon.uql新变种(第3版)
- JavaScript中类的实现
- Hibernate 访问多个数据库
- 《ASP网络编程》学习笔记之二
- search花絮之索引压缩
- 为什么要使用EJB?
- 终于决定动手了
- 3.5毫米转2-RCA音频线能否解决我的问题?
- Using Binary Heaps in A* Pathfinding
- 冒险岛无敌外挂代码诠释
- 单例模式的经典代码——线程池集合
- sqlserver中个表的作用