×

asp程序

什么是ASP什么作用?“ASP“是指什么意思

admin admin 发表于2022-09-03 17:41:22 浏览120 评论0

抢沙发发表评论

本文目录

什么是ASP什么作用


  ASP是动态服务器页面(Active Server Page)的英文缩写。是微软公司开发的代替CGI脚本程序的一种应用,它可以与数据库和其它程序进行交互,是一种简单、方便的编程工具。ASP的网页文件的格式是 .asp。现在常用于各种动态网站中。
  ASP的特点:
  1、任何开发工具皆可发展ASP
  只要使用一般的文书编辑程序,如Windows记事本,就可以编辑。当然,其他网页发展工具,例如,FrontPage Express、 FrontPage等也都可以;不过还是建议你用记事本来写,既省钱又方便,若是使用那些所见即所得的网页编辑来写ASP,可能会发生一些意想不到的离奇状态。
  2、通吃各家浏览器
  由于ASP程序是在网络服务器端中执行,执行结果所产生的HTML文件适用于不同的浏览器。
  3、语言相容性高
  ASP与所有的ActiveX Script语言都相容,除了可结合HTML,VBScript、Java Script、Active X服务器组件来设计外,并可经由“plug-In(外挂组件模组)的方式,使用其他厂商(Third Party)所提供的语言。
  4、隐密安全性高
  如果我们在浏览器中直接查看网页的原始代码,就只能看到HTML文件,原始的ASP程序代码是看不到的!这是因为ASP程序先于网站服务(Web Server)端执行后,将结果转换成标准HTML文件,再传送到客户端(Client)的浏览器上,因此,我们所辛苦撰写的ASP程序并不会轻易地被看见进而被盗用。
  5、易于操控数据库
  ASP可以轻易地通过ODBC(Open Database Connectivity)驱动程序连接各种不同的数据库,例如:Acess、Foxpro、dBase、Oracle等等,另外,ASP亦可将“文本文件”或是”Excel” 文件当成数据库用。

“ASP“是指什么意思


ASP是一种网站格式,动态网站格式,一般用在论坛上,容量大,稳定性好。

ASP使用了Microsoft的ActiveX技术。ActiveX(COM)技术是现在Microsoft软件的重要基础。它采用封装对象,程序调用对象的技术,简化编程,加强程序间合作。

ASP本身封装了一些基本组件和常用组件,有很多公司也开发了很多实用组件。只要可以在服务器上安装这些组件,通过访问组件,就可以快速、简易地建立自己的WEB应用。

语言特点

1、用VBScript、JavaScript等简单容易的脚本语言。结合HTML代码,即可快速完成网站的应用程序,实现动态网页技术。

2、ASP文件是包含在HTML代码所组成的文件中的,易于修改和测试,无须编译或链接就可以解释执行。

3、ASP所使用的脚本语言均在Web服务器端执行,服务器上的ASP解释程序会在服务器端执行ASP程序,并将结果以HTML格式传送到客户端浏览器上。

4、ASP提供了一些内置对象,使用这些对象可以使服务器端脚本功能更强。

以上内容参考:百度百科-asp


asp和aspx的区别


asp和aspx的区别为:编写不同、安全性不同、文件类型写不同。

一、编写不同

1、asp:asp支持visual studio 编写,编写效率更低。

2、aspx:aspx支持visual studio .net编写,编写效率更高。

二、安全性不同

1、asp:asp的安全性较低,程序可在客户端运行,也可服务器端运行。

2、aspx:aspx的安全性较高,程序必须都在服务器端运行。

三、文件类型不同

1、asp:asp是属于asp文件类型的文件后缀名。

2、aspx:aspx是属于asp.net文件类型的文件后缀名。


请简述ASP工作原理


ASP是动态服务器页面(Active Server Page)的英文缩写,是一种简单、方便的编程工具,ASP的网页文件的格式是 .asp,现在常用于各种动态网站中。

ASP工作原理如下:

1.访问Html页面:

  输入HTML文件的URL地址,向网络发送一个网页请求;

  根据URL找到相应的Web服务器;

  Web服务器收到请求,通过扩展名.htm或.html判断是否为HTML文件的请求;

  Web服务器将对应的HTML文件从磁盘或存储器中取出并送回浏览器;

  HTML文件由用户的浏览器解释,结果在浏览器窗口中显示出来;

2.访问ASP页面:

  当用户请求一个*.asp页面时,该请求通过网络被发送到相应的Web服务器;

  Web服务器响应该HTTP请求,并根据扩展名.asp识别出ASP文件,从硬盘或内存中获取相应的ASP文件;

  Web服务器将ASP文件发送到脚本引擎(asp.dll)文件中,脚本引擎将ASP文件从头到尾进行解释处理,并根据ASP文件中的脚本命令生成相应的HTML网页;

  若ASP文件中含有访问数据库的请求,就通过数据库连接组件与后台数据库相连。ASP脚本是在服务器端解释执行的,他依据访问数据库的结果集自动生成符合HTML语言的页面,以响应用户的请求。所有相关的工作由Web服务器负责。-asp程序


asp是什么概念


ASP有两个含义:一是英文Application Service Provider的缩写,意思是网络应用服务供应商;另一个是英文Active Server Page的缩写,是微软推出的一种动态网页技术。
Microsoft Active Server Pages 即我们所称的 ASP
,其实是一套微软开发的服务器端脚本环境, ASP 内含于 IIS 3.0 和 4.0
之中 , 通过 ASP 我们可以结合 HTML 网页、 ASP 指令和 ActiveX
元件建立动态、交互且高效的 WEB 服务器应用程序。有了 ASP
你就不必担心客户的浏览器是否能运行你所编写的代码,因为所有的程序都将在服务器端执行,包括所有嵌在普通
HTML
中的脚本程序。当程序执行完毕后,服务器仅将执行的结果返回给客户浏览器,这样也就减轻了客户端浏览器的负担,大大提高了交互的速度。
以下罗列了 Active Server Pages 所独具的一些特点:
1. 使用 VBScript 、 Jscript 等简单易懂的脚本语言,结合 HTML
代码,即可快速地完成网站的应用程序。
2. 无须 compile 编译,容易编写,可在服务器端直接执行。
3. 使用普通的文本编辑器,如 Windows
的记事本,即可进行编辑设计。
4. 与浏览器无关 (Browser Independence), 用户端只要使用可执行 HTML
码的浏览器,即可浏览 Active Server Pages 所设计的网页内容。 Active
Server Pages 所使用的脚本语言 (VBScript 、 Jscript) 均在 WEB
服务器端执行,用户端的浏览器不需要能够执行这些脚本语言。
5.Active Server Pages 能与任何 ActiveX scripting 语言相容。除了可使用
VBScript 或 Jscript 语言来设计外,还通过 plug-in
的方式,使用由第三方所提供的其他脚本语言,譬如 REXX 、 Perl 、
Tcl 等。脚本引擎是处理脚本程序的 COM(Component Object Model) 物件。
6.Active Server Pages
的源程序,不会被传到客户浏览器,因而可以避免所写的源程序被他人剽窃,也提高了程序的安全性。
7. 可使用服务器端的脚本来产生客户端的脚本。
8. 物件导向( Object-oriented )。
9.ActiveX Server Components(ActiveX 服务器元件 )
具有无限可扩充性。可以使用 Visual Basic 、 Java 、 Visual C++ 、 COBOL
等编程语言来编写你所需要的 ActiveX Server Component 。 《/p》
《p》 ASP
的奇妙之处真是不胜枚举,下面就请各位系好安全带,我将带领大家进入
ASP 的梦幻世界。 《/p》
《p》 首先,让我们来看看运行 ASP 所需的环境: 《ul》
《li》Microsoft Internet Information Server version 3.0/4.0 on Windows NT Server 《/li》
《li》Microsoft Peer Web Services Version 3.0 on Windows NT Workstation 《/li》
《li》Microsoft Personal Web Server on Windows 95/98 《/li》
《/ul》
《p》 正如前文所述,与一般的程序不同, .asp 程序无须编译, ASP
程序的控制部份,是使用 VBScript 、 Jscript
等脚本语言来设计的,当执行 ASP
程序时,脚本程序将一整套命令发送给脚本解释器 ( 即脚本引擎 )
,由脚本解释器进行翻译并将其转换成服务器所能执行的命令。当然,同其他编程语言一样,
ASP
程序的编写也遵循一定的规则,如果你想使用你所喜爱的脚本语言编写
ASP
程序,那么你的服务器上必须要有能解释这种脚本语言的脚本解释器。当你安装
ASP 时,系统提供了两种脚本语言: Vbsrcipt 和 Jscript ,而 Vbscript
则被作为系统默认的脚本语言。你也可以根据自己的喜好改变系统默认的脚本语言,关于如何改变系统默认的脚本语言请看《
《a href=“asp1-1.htm“》《font color=“#026BAA“》在 ASP 中使用脚本语言《/font》《/a》》一文。
ASP 本身并不是一种脚本语言,它只是提供了一种使镶嵌在 HTML
页面中的脚本程序得以运行的环境。但是,要学好 ASP
又必须掌握它的语法和规则。现在就让我们开始一步一步地认识并学习
Active Server Pages 。
ASP 程序其实是以扩展名为 .asp 的纯文本形式存在于 WEB
服务器上的,你可以用任何文本编辑器打开它, ASP
程序中可以包含纯文本、 HTML 标记以及脚本命令。你只需将 .asp
程序放在 WEB
服务器的虚拟目录下(该目录必须要有可执行权限),就可以通过
WWW 的方式访问 ASP 程序了。要学好 ASP
程序的设计,必须掌握脚本的编写,那么究竟什么是脚本呢?其实脚本是由一系列的脚本命令所组成的,如同一般的程序,脚本可以将一个值赋给一个变量,可以命令
WEB
服务器发送一个值到客户浏览器,还可以将一系列命令定义成一个过程。要编写脚本,你必须要熟悉至少一门脚本语言,如
VBScript 。脚本语言是一种介乎于 HTML 和诸如 JAVA 、 Visual Basic 、 C++
等编程语言之间的一种特殊的语言,尽管它更接近后者,但它却不具有编程语言复杂、严谨的语法和规则。如前所述
ASP 所提供的脚本运行环境可支持多种脚本语言,譬如: Jscript 、 REXX
、 PERL 等等,这无疑给 ASP 程序设计者提供了广泛的发挥余地。 ASP
的出现使得广大 WEB
设计者不必在为客户浏览器是否支持而担心,实际上就算你
在同一个 .asp
文件中使用不同的脚本语言,你都无须为此担忧,因为所有的一切都将在服务器端进行,客户浏览器得到的只是一个程序执行的结果,而你也只需在
.asp 中声明使用不同的脚本语言即可
-asp程序

ASP程序是什么


asp是一个技术框架,于1996年出世于美国微软,用于实现动态网站功能(如常见的留言板,新闻系统,在线商城等),支持JAVASCRIPt和VBSCRIPT来编写,特点是简单,但对底层访问能力不强。

如何在本地运行ASP程序


首先安装IIS,安装好以后,开始-控制面板-管理工具-Int信息服务
在左边的对话框找到默认站点,右键-新建-虚拟目录
下一步-别名为a下一步-选者你的*.asp文件所在的目录,下一步-下一步-完成.在默认站点里多出一个a,点右键-属性
选上面的第二项“文档“-点添加输入你完整的*.asp名称.确定-确定.
然后点a右键-浏览,在右边的窗口就可以看到网页.
只要照我说的做就一定可以看见,如果不行,那就是你的*.asp文件有问题不能打开.如果可以打开了.你在IE地址栏输入http://你的计算机名/a
这样就可以了.
如果按我说的步骤还不行,给我留消息.
-asp程序

asp程序实现简单的注册,登录网页的源代码


1,(index.asp 用户登陆页面)
《!-- #include file=“conn.asp“ --》
《!-- blog.soowooo.cn 悠悠长假期 --》
《html》
《head》
《meta http-equiv=“Content-Type“ content=“text/html; charset=gb2312“》
《title》会员《/title》
《style type=“text/css“》
《!--
body,td,th {
font-family: 宋体;
font-size: 14px;
}
--》
《/style》
《/head》
《body》
《center》
《p》会员注册系统《/p》
《form name=“form1“ method=“post“ action=“login.asp“》
《table width=“34%“ border=“0“》
《tr》
《td width=“33%“ height=“30“》用户名:《/td》
《td width=“67%“ height=“30“》《input name=“username“ type=“text“ id=“username“ size=“15“》《/td》
《/tr》
《tr》
《td height=“30“》密 码:《/td》
《td height=“30“》《input name=“password“ type=“password“ id=“password“ size=“15“》《/td》
《/tr》
《tr》
《td colspan=“2“ align=“center“》《input type=“submit“ name=“Submit“ value=“确定“》
《input type=“reset“ name=“Submit“ value=“重置“》《/td》
《/tr》
《tr》
《td colspan=“2“》《a href=“reg.asp“ target=“_self“》注册《/a》《/td》
《/tr》
《/table》
《/form》
《/center》
《/body》
《/html》
2,(login.asp 用户数据处理文件)
《!-- #include file=“conn.asp“ --》
《%
’打开数据库判断用户是否存在,info为表名,username为字段名
set rsc=server.createobject(“adodb.recordset“)
sqlc=“select * from info where username=’“&request.Form(“username“)&“’ and password=’“&request.Form(“password“)&“’“
rsc.open sqlc,conn,1,1
session(“username“)=rsc(“username“)
session(“password“)=rsc(“password“)
session.Timeout=30
set rsc=nothing
response.Redirect(“change.asp“)
’如果用户不存在,session(“username“)为空
%》
3,(change.asp 用户信息修改页面)
《!-- #include file=“conn.asp“ --》
《html》
《head》
《meta http-equiv=“Content-Type“ content=“text/html; charset=gb2312“》
《title》修改《/title》
《style type=“text/css“》
《!--
body,td,th {
font-size: 14px;
}
--》
《/style》《/head》
《center》
《body》
《br》
《%
set rsc=server.createobject(“adodb.recordset“)
sqlc=“select * from info where username=’“&session(“username“)&“’ and password=’“&session(“password“)&“’“
rsc.open sqlc,conn,1,1
nr=rsc(“password“)
username=rsc(“username“)
password=rsc(“password“)
sex=rsc(“sex“)
qq=rsc(“qq“)
mail=rsc(“mail“)
add=rsc(“add“)
personalinfo=rsc(“personalinfo“)
vv=rsc(“ntime“)
set rsc=nothing
if nr=““ then
response.Redirect(“index.asp“)
end if
if strcomp(nr,request.Form(“password“))=0 then
response.Write(“欢迎你!“&request.Form(“username“))
response.Write(“你是在“&vv&“注册的“)
session(“username“)=request.Form(“username“)
end if
if session(“username“)=““ then
response.Redirect(“index.asp“)
end if
%》
《form name=“form1“ method=“post“ action=“change.asp?ac=ch“》
《table width=“39%“ height=“105“ border=“0“ 》
《tr》
《td width=“27%“ height=“30“》用户名:《/td》
《td width=“73%“ height=“30“》《input name=“username“ type=“text“ id=“username“ value=“《%=username%》“》
*《/td》
《/tr》
《tr》
《td height=“30“》密 码:《/td》
《td height=“30“》《input name=“password“ type=“text“ id=“password“ value=“《%=password%》“》
*《/td》
《/tr》
《tr》
《td height=“30“》性 别:《/td》
《td height=“30“》《input name=“sex“ type=“text“ id=“sex“ value=“《%=sex%》“》《/td》
《/tr》
《tr》
《td height=“30“》QQ:《/td》
《td height=“30“》《input name=“qq“ type=“text“ id=“qq“ value=“《%=qq%》“》《/td》
《/tr》
《tr》
《td height=“30“》Mail:《/td》
《td height=“30“》《input name=“mail“ type=“text“ id=“mail“ value=“《%=mail%》“》《/td》
《/tr》
《tr》
《td height=“30“》地 址:《/td》
《td height=“30“》《input name=“add“ type=“text“ id=“add“ value=“《%=add%》“》《/td》
《/tr》
《tr》
《td》介绍《/td》
《td》《textarea name=“personalinfo“ cols=“30“ rows=“6“ id=“personalinfo“》《%=personalinfo%》《/textarea》《/td》
《/tr》
《tr》
《td》 《/td》
《td》《input type=“submit“ name=“Submit“ value=“修改“》
《a href=“change.asp?se=y“ target=“_self“》退出系统《/a》《/td》
《% if strcomp(request.QueryString(“se“),“y“)=0 then
session(“username“)=““
response.Redirect(“index.asp“)
end if
%》
《/tr》
《/table》
《/form》
《%
if strcomp(request.QueryString(“ac“),“ch“)=0 then
set rs=server.createobject(“adodb.recordset“)
sql=“select * from info where username=’“&session(“username“)&“’“
rs.open sql,conn,1,3
rs(“username“)=request.Form(“username“)
rs(“password“)=request.Form(“password“)
rs(“mail“)=request.Form(“mail“)
rs(“sex“)=request.Form(“sex“)
rs(“qq“)=request.Form(“qq“)
rs(“add“)=request.Form(“add“)
rs(“personalinfo“)=request.Form(“personalinfo“)
rs.update
set rs=nothing
response.Write(“修改完成!“)
end if
%》
《/body》
《/center》
《/html》
4,(reg.asp 新用户注册页面)
《html》
《head》
《meta http-equiv=“Content-Type“ content=“text/html; charset=gb2312“》
《title》用户注册《/title》
《style type=“text/css“》
《!--
body,td,th {
font-family: 宋体;
font-size: 14px;
}
--》
《/style》
《/head》
《body》
《center》
用户注册《br》
《%
=request.QueryString(“msg“)
%》
《form name=“form1“ method=“post“ action=“addnewdata.asp?ac=adduser“》
《table width=“39%“ height=“105“ border=“0“ 》
《tr》
《td width=“27%“ height=“30“》用户名:《/td》
《td width=“73%“ height=“30“》《input name=“username“ type=“text“ id=“username“》
*《/td》
《/tr》
《tr》
《td height=“30“》密码:《/td》
《td height=“30“》《input name=“password“ type=“password“ id=“password“》
*《/td》
《/tr》
《tr》
《td height=“30“》确定密码:《/td》
《td height=“30“》《input name=“password2“ type=“password“ id=“password2“》
*《/td》
《/tr》
《tr》
《td height=“30“》性别:《/td》
《td height=“30“》《input name=“sex“ type=“text“ id=“sex“》《/td》
《/tr》
《tr》
《td height=“30“》QQ:《/td》
《td height=“30“》《input name=“qq“ type=“text“ id=“qq“》《/td》
《/tr》
《tr》
《td height=“30“》Mail:《/td》
《td height=“30“》《input name=“mail“ type=“text“ id=“mail“》《/td》
《/tr》
《tr》
《td height=“30“》地址:《/td》
《td height=“30“》《input name=“add“ type=“text“ id=“add“》《/td》
《/tr》
《tr》
《td》个人介绍《/td》
《td》《textarea name=“personalinfo“ cols=“30“ rows=“6“ id=“personalinfo“》《/textarea》《/td》
《/tr》
《tr》
《td》 《/td》
《td》《input type=“submit“ name=“Submit“ value=“提交“》《/td》
《/tr》
《/table》
《/form》
《/center》
《/body》
《/html》
5,(addnewdata.asp 新用户注册数据处理文件)
《!-- #include file=“conn.asp“ --》
《html》
《head》
《meta http-equiv=“Content-Type“ content=“text/html; charset=gb2312“》
《title》成功《/title》
《/head》
《body》
《%
ac=request.QueryString(“ac“)
msg=“注册错误信息“
if request.Form(“username“)=““ then
msg=msg&“《br》“&“用户名不能为空“
end if
if strcomp(cstr(request.Form(“password“)),cstr(request.Form(“password2“)))《》0 then
msg=msg&“《br》“&“两次密码输入不同“
end if
if len(request.Form(“password“))《6 then
msg=msg&“《br》“&“密码太简单“
end if
if strcomp(msg,“注册错误信息“)》0 then
response.Redirect(“reg.asp?msg=“&msg)
end if
if ac=“adduser“ then
set rsc=server.createobject(“adodb.recordset“)
sql=“select * from info where username=’“&request.Form(“username“)&“’“
rsc.open sql,conn,1,1
ck=rsc(“username“)
set rsc=nothing
if ck《》““ then
msg=msg&“《br》“&“用户名被人注册“
response.Redirect(“reg.asp?msg=“&msg)
end if
dsql=“select * from info where id is null“
set rs=server.createobject(“adodb.recordset“)
rs.open dsql,conn,1,3
rs.addnew
rs(“username“)=request.Form(“username“)
rs(“password“)=request.Form(“password“)
rs(“mail“)=request.Form(“mail“)
rs(“sex“)=request.Form(“sex“)
rs(“qq“)=request.Form(“qq“)
rs(“add“)=request.Form(“add“)
rs(“personalinfo“)=request.Form(“personalinfo“)
rs(“ntime“)=now
rs.update
set rs=nothing
%》
《center》
《a href=“index.asp“ target=“_self“》注册成功,点击登陆《/a》
《/center》
《%
end if
%》
《/body》
《/html》
6,(conn.asp 数据库连接文件)
《%
’连接数据库开始
dim conn,rs,sql
on error resume next
dbpath=server.mappath(“userinfo.mdb“)
set conn=server.createobject(“adodb.connection“)
conn.open “PROVIDER=Microsoft.jet.OLEDB.4.0;data source=“
’创建记录对象
set rs=server.createobject(“adodb.recordset“)
%》
7,(userinfo.mdb ACCESS 数据库)
在ACCESS中建一个表,然后在这个表中建立字段名称
表名:info
字段名称 数据类型
id 自动编号
username 文本
password 文本
sex 文本
quest 文本
qq 文本
mail 文本
personalinfo 文本
ntime 文本
-asp程序

怎样修改转变了数据库后的asp程序


剩下代码(1):
《BODY》
《script》
function CheckAll(form) {
for (var i=0;i《form.elements.length;i++) {
var e = form.elements[i];
if (e.name != ’chkall’) e.checked = form.chkall.checked;
}
}
《/script》
《%
if fla2=“0“ and request.Cookies(“shiwei_id“)《》“1“ then
%》
《br》《center》《img src=“../images/note.gif“ align=“absmiddle“》 《font color=“#FF0000“》你不具备此权限,请与管理员联系!《/font》《/center》
《%
response.end
end if
if request(“isok“)《》““ then
conn.execute(“update buy set isok=“&request(“isok“)&“ where bianhao=’“&request(“bianhao“)&“’“)
end if
’取得当前页码
currentpage=request(“page“)
’response.write currentpage
’response.end
if currentpage《1 or currentpage=““ then
currentpage=“1“
end if
’取得搜索关键字
nowstartdate=request(“startdate“)
if nowstartdate=““ then
nowstartdate=date()-day(date()-1)
end if
nowenddate=request(“enddate“)
if nowenddate=““ then
nowenddate=date()
end if
nowku=request(“ku“)
nowkeyword=request(“keyword“)
%》
《table width=“100%“ border=“0“ cellpadding=“0“ cellspacing=“2“ align=“center“》
《form name=“form2“》
《tr》
《td width=“5%“ height=“21“》 《img src=“../images/print.jpg“ align=“absmiddle“ style=“cursor:hand;“ onClick=“preview();window.close()“》《/td》
《td width=“95%“ align=“right“》
开始日期:
《input name=“startdate“ value=“《%=nowstartdate%》“ readonly style=“width:100px“》
《img src=“../images/date.gif“ align=“absmiddle“ style=“cursor:pointer;“ onClick=“JavaScript:window.open(’day.asp?form=form2&field=startdate&oldDate=’+startdate.value,’’,’directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=170,top=150,left=590’);“》
结束日期:
《input name=“enddate“ value=“《%=nowenddate%》“ readonly style=“width:100px“》
《img src=“../images/date.gif“ align=“absmiddle“ style=“cursor:pointer;“ onClick=“JavaScript:window.open(’day.asp?form=form2&field=enddate&oldDate=’+enddate.value,’’,’directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=170,top=150,left=740’);“》
《%
if request.Cookies(“shiwei_id“)=“1“ or fla88=“1“ then
sql=“select * from ku order by id“
set rs_ku=conn.execute(sql)
else
sql=“select * from ku where instr(login,’,“&request.Cookies(“shiwei_id“)&“,’)》0 order by id“
set rs_ku=conn.execute(sql)
if rs_ku.eof then
nowku=“0“
elseif request(“ku“)=““ then
nowku=rs_ku(“id“)
end if
end if
%》
《select name=“ku“ onChange=“form2.submit()“》
《%if request.Cookies(“shiwei_id“)=“1“ or fla88=“1“ then%》
《option value=““》所有仓库《/option》
《%elseif rs_ku.eof then%》
《option value=“0“》没有你管理的仓库《/option》
《%end if%》
《%
do while rs_ku.eof=false
%》
《option value=“《%=rs_ku(“id“)%》“《%if trim(cstr(rs_ku(“id“)))=nowku then%》 selected=“selected“《%end if%》》《%=rs_ku(“ku“)%》《/option》
《%
rs_ku.movenext
loop
%》
《/select》
《input type=“text“ name=“keyword“ size=“20“ value=“《%=nowkeyword%》“》
《input type=“hidden“ name=“hid“ value=“ok“》
《input type=“submit“ value=“ 查询 “ class=“button“》 
《/td》
《/tr》
《/form》
《/table》
《table width=“100%“ border=“0“ cellpadding=“0“ cellspacing=“0“ bgcolor=“#C4D8ED“》
《tr》
《td》《img src=“../images/r_1.gif“ alt=““ /》《/td》
《td width=“100%“ background=“../images/r_0.gif“》
《table cellpadding=“0“ cellspacing=“0“ width=“100%“》
《tr》
《td》 入库记录查询《/td》
《td align=“right“》 《/td》
《/tr》
《/table》
《/td》
《td》《img src=“../images/r_2.gif“ alt=““ /》《/td》
《/tr》
《tr》
《td》《/td》
《td》
《!--startprint--》
《table align=“center“ cellpadding=“4“ cellspacing=“1“ class=“toptable grid“ border=“1“》
《form name=“form1“ action=“buy_del.asp“》
《input type=“hidden“ name=“startdate“ value=“《%=nowstartdate%》“》
《input type=“hidden“ name=“enddate“ value=“《%=nowenddate%》“》
《input type=“hidden“ name=“ku“ value=“《%=nowku%》“》
《input type=“hidden“ name=“keyword“ value=“《%=nowkeyword%》“》
《input type=“hidden“ name=“order1“ value=“《%=request(“order1“)%》“》
《input type=“hidden“ name=“order2“ value=“《%=request(“order2“)%》“》
《input type=“hidden“ name=“order3“ value=“《%=request(“order3“)%》“》
《input type=“hidden“ name=“order4“ value=“《%=request(“order4“)%》“》
《input type=“hidden“ name=“order5“ value=“《%=request(“order5“)%》“》
《input type=“hidden“ name=“order6“ value=“《%=request(“order6“)%》“》
《input type=“hidden“ name=“order7“ value=“《%=request(“order7“)%》“》
《input type=“hidden“ name=“order8“ value=“《%=request(“order8“)%》“》
《input type=“hidden“ name=“order9“ value=“《%=request(“order9“)%》“》
《input type=“hidden“ name=“order10“ value=“《%=request(“order10“)%》“》
《input type=“hidden“ name=“order11“ value=“《%=request(“order11“)%》“》
《input type=“hidden“ name=“order12“ value=“《%=request(“order12“)%》“》
《input type=“hidden“ name=“order13“ value=“《%=request(“order13“)%》“》
《input type=“hidden“ name=“order14“ value=“《%=request(“order14“)%》“》
《input type=“hidden“ name=“order15“ value=“《%=request(“order15“)%》“》
《tr align=“center“》
《td class=“category“ width=“10“》《img src=“../images/folder_close.gif“ style=“cursor:hand“ onClick=“collapseall(this)“ /》《/td》
《td class=“category“ height=“30“》
《a href=“?order1=《%if request(“order1“)=“asc“ then%》desc《%else%》asc《%end if%》&page=《%=currentpage%》&startdate=《%=nowstartdate%》&enddate=《%=nowenddate%》&ku=《%=nowku%》&keyword=《%=nowkeyword%》“ class=“title“》编号《%if request(“order1“)=“asc“ then%》《img src=“../images/up2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%else%》《img src=“../images/down2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%end if%》《/a》
《/td》
《td class=“category“》
《a href=“?order4=《%if request(“order4“)=“asc“ then%》desc《%else%》asc《%end if%》&page=《%=currentpage%》&startdate=《%=nowstartdate%》&enddate=《%=nowenddate%》&ku=《%=nowku%》&keyword=《%=nowkeyword%》“ class=“title“》入库时间《%if request(“order4“)=“asc“ then%》《img src=“../images/up2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%else%》《img src=“../images/down2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%end if%》《/a》
《/td》
《td class=“category“》
《a href=“?order5=《%if request(“order5“)=“asc“ then%》desc《%else%》asc《%end if%》&page=《%=currentpage%》&startdate=《%=nowstartdate%》&enddate=《%=nowenddate%》&ku=《%=nowku%》&keyword=《%=nowkeyword%》“ class=“title“》经办人《%if request(“order5“)=“asc“ then%》《img src=“../images/up2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%else%》《img src=“../images/down2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%end if%》《/a》
《/td》
《td class=“category“》
《a href=“?order6=《%if request(“order6“)=“asc“ then%》desc《%else%》asc《%end if%》&page=《%=currentpage%》&startdate=《%=nowstartdate%》&enddate=《%=nowenddate%》&ku=《%=nowku%》&keyword=《%=nowkeyword%》“ class=“title“》供应商《%if request(“order6“)=“asc“ then%》《img src=“../images/up2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%else%》《img src=“../images/down2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%end if%》《/a》《/td》
《td class=“category“》
《a href=“?order7=《%if request(“order7“)=“asc“ then%》desc《%else%》asc《%end if%》&page=《%=currentpage%》&startdate=《%=nowstartdate%》&enddate=《%=nowenddate%》&ku=《%=nowku%》&keyword=《%=nowkeyword%》“ class=“title“》数量《%if request(“order7“)=“asc“ then%》《img src=“../images/up2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%else%》《img src=“../images/down2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%end if%》《/a》
《/td》
《%if request.Cookies(“shiwei_id“)=“1“ or fla87=“1“ then%》
《td class=“category“》
《a href=“?order9=《%if request(“order9“)=“asc“ then%》desc《%else%》asc《%end if%》&page=《%=currentpage%》&startdate=《%=nowstartdate%》&enddate=《%=nowenddate%》&ku=《%=nowku%》&keyword=《%=nowkeyword%》“ class=“title“》金额《%if request(“order9“)=“asc“ then%》《img src=“../images/up2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%else%》《img src=“../images/down2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%end if%》《/a》
《/td》
《%end if%》
《td class=“category“》
《a href=“?order10=《%if request(“order10“)=“asc“ then%》desc《%else%》asc《%end if%》&page=《%=currentpage%》&startdate=《%=nowstartdate%》&enddate=《%=nowenddate%》&ku=《%=nowku%》&keyword=《%=nowkeyword%》“ class=“title“》完成《%if request(“order10“)=“asc“ then%》《img src=“../images/up2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%else%》《img src=“../images/down2.gif“ border=“0“ hspace=“2“ align=“absmiddle“》《%end if%》《/a》
《/td》
《%if fla1=“1“ or request.Cookies(“shiwei_id“)=“1“ then%》
《td class=“category“》修改《/td》
《%end if%》
《%if fla4=“1“ or request.Cookies(“shiwei_id“)=“1“ then%》
《td class=“category“》删除《/td》
《%end if%》
《/tr》
《%
set rs_buy =server.createobject(“ADODB.RecordSet“)
sql=“select * from buy where type=0 and zu“
if request.Cookies(“shiwei_id“)《》1 and lookbuysell=“yes“ and fla89=“0“ then
sql=sql&“ and id_login=“&request.Cookies(“shiwei_id“)
end if
if nowstartdate《》““ then
sql=sql&“ and selldate-#“&nowstartdate&“#》=0“
end if
if nowenddate《》““ then
sql=sql&“ and selldate-#“&nowenddate&“#《=0“
end if
if nowku《》““ then
sql=sql&“ and bianhao in (select bianhao from buy where type=0 and id_ku=“&nowku&“ and zu=false)“
end if
if nowkeyword《》““ then
sql=sql&“ and (bianhao = ’“&nowkeyword&“’ or id_gys in (select id from gys where company like ’%“&nowkeyword&“%’) or id_login in (select id from login where username like ’%“&nowkeyword&“%’) or bianhao in (select bianhao from buy where type=0 and (title like ’%“&nowkeyword&“%’ or huohao like ’%“&nowkeyword&“%’)))“
end if
if request(“order1“)《》““ then
sql=sql&“ order by bianhao “&request(“order1“)
elseif request(“order2“)《》““ then
sql=sql&“ order by huohao “&request(“order2“)
elseif request(“order3“)《》““ then
sql=sql&“ order by title “&request(“order3“)
elseif request(“order4“)《》““ then
sql=sql&“ order by selldate “&request(“order4“)
elseif request(“order5“)《》““ then
sql=sql&“ order by id_login “&request(“order5“)
elseif request(“order6“)《》““ then
sql=sql&“ order by id_gys “&request(“order6“)
elseif request(“order7“)《》““ then
sql=sql&“ order by shulian “&request(“order7“)
elseif request(“order8“)《》““ then
sql=sql&“ order by price2 “&request(“order8“)
elseif request(“order9“)《》““ then
sql=sql&“ order by price2 “&request(“order9“)
elseif request(“order10“)《》““ then
sql=sql&“ order by isok “&request(“order10“)
else
sql=sql&“ order by selldate desc“
end if
rs_buy.open sql,conn,1,3(这就是错误的那行代码)
’set rs_buy=conn.execute(sql)(换了一种方式也是同样的错误)
if not rs_buy.eof then
rs_buy.pagesize=maxrecord
rs_buy.absolutepage=currentpage
for currentrec=1 to rs_buy.pagesize
if rs_buy.eof then
exit for
end if
%》
《tr onMouseOver=“this.className=’highlight’“ onMouseOut=“this.className=’’“ onDblClick=“javascript:var win=window.open(’print_buy.asp?bianhao=《%=rs_buy(“bianhao“)%》’,’详细信息’,’width=853,height=470,top=176,left=161,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes’); win.focus()“》
《td align=“center“》《img src=“../images/folder_close.gif“ style=“cursor:hand“ onClick=“collapse(this, ’buy《%=currentrec%》’)“ /》《/td》
《td align=“center“ height=“25“》《%=rs_buy(“bianhao“)%》《/td》
《td align=“center“》《%=rs_buy(“selldate“)%》《/td》
《td align=“center“》
《%
sql=“select * from login where id=“&rs_buy(“id_login“)
set rs_login=conn.execute(sql)
%》
《%if rs_login.eof then%》《%=rs_buy(“login“)%》《%else%》《%=rs_login(“username“)%》 (《%=rs_login(“bianhao“)%》)《%end if%》
《/td》
《td align=“center“》
《%
sql=“select * from gys where id=“&rs_buy(“id_gys“)
set rs_gys=conn.execute(sql)
%》
-asp程序

asp程序代码


1、html脚本语言+javascript脚本语言。
javascript是从 《script language=“JavaScript“》 到 《/script》结束。
2、clearTimeout()函数的作用是清除定时器。当程序开始运行的时候这个函数起到重新启动的作用。和setTimeout() 对应的,setTimeout()的作用是建立计时器,程序中 timerID = setTimeout(“showtime()“,1000); 的作用是每隔1000毫秒也就是一秒,执行一次showtime()函数; 而这句话又包含在showtime()函数中,这种自身调用自身的调用的方法叫做递归。
3、timeValue += ((hours 》12) ? hours -12 :hours) hours是从当前时间里取出来的小时数,是24小时制的。这条语句的功能是:如果小时数大于12(就表示是下午,如13-24点)就减去12(如13点-12=下午1点)。否则显示当前小时数(如8点,就显示上午8点)。
上一条语句是显示上午或者下午的,这一条语句是显示几点的。加在一起的作用就是显示上午几点或者下午几点。
4、这段代码的作用是打开网页后每1秒钟显示一次当前时间。
-asp程序