Asp基本知识
1.Asp是Active Server Pages的简称,是解释型的脚本语言环境;
2.Asp的运行需要Windows操作系统,9x下需要安装PWS;而NT/2000/XP则需要安装Internet Information Server(简称IIS);
3.Asp和JSP的脚本标签是“<%%>”,PHP的则可以设定为多种;
4.Asp的注释符号是“'”;
5.使用附加组件,可以扩展Asp的功能。
例子:
HelloWorld_1.asp
<%="Hello,world"%>
效果:
Hello,world
HelloWorld_2.asp
<%
for i=1 to 10
response.write "Hello,world"
next
%>
效果:
Hello,world
Hello,world
Hello,world
Hello,world
Hello,world
Hello,world
Hello,world
Hello,world
Hello,world
Hello,world
注意:Asp不区分大小写;变量无需定义也可使用,转换方便;语法检查很松。
相关文档:
<% '--------------------------------------------------------------------------------------------------
Set rs9 = Server.CreateObject("ADODB.RecordSet")
sqlstr="select * from 客户资料库 order by id desc"
rs9.open sqlstr,conn,1,3
%>
<%Set fs = server.CreateObject( ......
2.1 ASP.net 入门
通常谈一个学科,我们老是说,它入门很简单的嘛,ASP.net也是。ASP.net提出一个概念,就是认为WEB页面,也是一个窗体,所以,学习过面向对象编程的VB VC BC Dephi的朋友,学起来就简单多了。
一个ASP.net页面的后缀名是".aspx",所以,IIS在你安装完ASP.net时,也会把Default.aspx作为你的默认 ......
使地址欄URL固定,隱藏參數:
<head>
</head>
<frameset>
<frame name="" src="Login.aspx" target="Login.aspx" scrolling="auto" noresize></frame>
<nofr ......
conndb.asp
<%
Session.CodePage=65001
response.Charset="utf-8"
%>
<%
'数据库连接文件
dim conn
dim connstr
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+server.mappath("../date/#heihuhuhuajian.mdb")+";Jet OLEDB:Database Pass ......
fix是bmp的一种衍生格式,可用于asp生成验证码图形。
一个例子:
1 图象绘制完成后,将文件存为24位位图格式的BMP图象文件。
2 去除前54Byte内容.
3 改名为BODY+数字.FIX
4 修改CHECKCODE.ASP,调用你新做的这个文件.
(checkcode.asp 负责生成和输出验证码 1309 byte,head.fix 是54byte的BMP头,body.fix 数字0~9 10 ......