第14章JAVA分类专业文献行业资料计算机.docx

上传人:b****5 文档编号:6105396 上传时间:2023-01-03 格式:DOCX 页数:16 大小:17.67KB
下载 相关 举报
第14章JAVA分类专业文献行业资料计算机.docx_第1页
第1页 / 共16页
第14章JAVA分类专业文献行业资料计算机.docx_第2页
第2页 / 共16页
第14章JAVA分类专业文献行业资料计算机.docx_第3页
第3页 / 共16页
第14章JAVA分类专业文献行业资料计算机.docx_第4页
第4页 / 共16页
第14章JAVA分类专业文献行业资料计算机.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

第14章JAVA分类专业文献行业资料计算机.docx

《第14章JAVA分类专业文献行业资料计算机.docx》由会员分享,可在线阅读,更多相关《第14章JAVA分类专业文献行业资料计算机.docx(16页珍藏版)》请在冰豆网上搜索。

第14章JAVA分类专业文献行业资料计算机.docx

第14章JAVA分类专业文献行业资料计算机

Application示例

<%

Application("msg")="这是Application对象的例子"

%>

<%=Application("msg")%>

</p><p>另外一页</p><p>

<%=Application("msg")%>

<%

Application("Visitor_num")=Application("Visitor_num")+1

%>

<%Application("Myaddress")="北京市">

<%Application.Contents("Myaddress")="北京市">

<%

ForEachthingInApplication.Contents

Response.Write("
"&thing&Application.Contents(thing))

Next

%>

SubApplication_onStart

'下面是主页的计数:

当前用户数

Application("currentSessionscount")=0

EndSub

SubSession_onStart

'用来计数

'锁住Application的权限

Application.Lock

ii=Application("currentSessionscount")+1

'给计数器加一

Application("currentSessionscount")=ii

'释放权限

Application.UnLock

EndSub

SubSession_onEnd

Application.Lock

jj=Application("currentSessionscount")-1

'给计数器减一

Application("currentSessionscount")=jj

Application.UnLock

EndSub

<%

SetConn=Server.CreateObject("ADODB.Connection")

SetApplication("Connection")=Conn

%>

<%

SetApplication("componet")=Server.CreateObject("component")

%>

<%

Application("componet").property

Application("componet").method()

%>

 

<%

SetLocal_Obj=Application("component")

Local_Obj.Method()

Local_Obj.property

%>

<%

SetApplication("Obj1")=Server

SetApplication("Obj2")=Application

SetApplication("Obj3")=Session

SetApplication("Obj4")=Request

SetApplication("Obj5")=Response

%>

%

Dimnew_Array()

ReDimnew_Array(5)

new_Array(0)="youarewelcom!

"

new_Array

(1)="hello,world!

"

new_Array

(2)="howareyou?

"

%>

 

<%

Application.Lock

Application("new_Array")=new_Array

Application.Unlock

%>

<%

Response.Redirect("modify.asp")

'引导到modify.asp

%>

 

<%

'将该Application数据组复制给一个临时的数组

temp_Array=Application("new_Array")

'修改临时数组元素的值

temp_Array

(1)="world,hello!

"

'输出字符串"world.hello!

"

Reponse.Write(temp_Array(0)&temp_Array

(1))

'对Application对象加锁。

Application.Lock

'将临时数组传回Application的数组

Application("My_Array")=temp_Array

'对Application对象解锁

Application.Unlock

%>

 

<%

Application("new_Array")="ma:

qiu:

liu:

"

%>

 

<%

temp_array=split(Application("new_Array"),";")

%>

temp_array(0)="majian;"

temp_array

(1)="qiuyu:

"

temp_array

(2)="liucun:

"

 

<%

Application("new_Array")=temp_array

%>

 

<%

Application("new_Array")="majian:

qiuyu:

liucun:

"

%>

</p><p>用户登录系统</p><p>

<%

DimUNM

DimPWD

UNM=Request.QueryString("nm")

PWD=Request.QueryString("pwd")

'判断用户登录信息

IfUNM="xiaoyur"Then

IfPWD="970000"Then

Response.Write"登录成功"

Else

Response.Write"密码有误"

EndIf

Else

Response.Write"禁止登录"

EndIf

%>

pleaseinputallthecitiesyouhavelived:


 

GEThttp:

//localhost/hometown.asp?

city=shaghai&citybeijing&city=guangzhou

 

<%

ForEachitemInRequest.QueryString("hometown")

Response.Writeitem

Next

%>

</p><p>请您登录</p><p>

您的账号:


您的电话:


电子邮件:


</p><p>验证用户信息</p><p>

<%

tempuser=Request.Form("username")

temptel=Request.Form("usertel")

tempmail=Request.Form("usermail")

Response.Write("热烈欢迎"&tempuser&"的到来")

Response.Write("
")

Response.Write("您的电话是:

"&temptel)

Response.Write("
")

Response.Write("您的邮件是:

"&tempmail)

Response.Write("
")

%>

</p><p>服务器端变量</p><p>

<%

ForEachitemInRequest.ServerVariables

Response.Write("

"&item&":

")

Response.Write(Request.ServerVariables(item))

Next

%>

<%

ForEachKeyInRequest.ClientCertificate

Response.Writekey&“:

”&Request.ClientCertificate(key)&“

Next

%>

buffer示例

<%

Fori=1To500

Response.Write(i&"
")

Next

%>

<%

Response.Buffer=True

%>

buffer示例

<%

Fori=1To500

Response.write(i&"

Next

%>

<%

Response.ContentType="text/plain"

%>

TEXT/PLAIN

HELLO,WORLD!

IsClientConnected示例

<%

Dimi

i=1

Whilei=1

Response.Write("Hello!

worle!

")

IfNotResponse.IsClientConnectedThenResponse.End

Wend

%>

<%

Response.Buffer=True

OnErrorResumeNext

Err.Clear

%>

<%

IfErr.numbet<>0Then

Response.Clear

Response.End

EndIf

%>

 

<%

Response.Buffer=True

%>

PAGE.COUNT<TITLE></p><p></HEAD></p><p><BODY></p><p>THISISTHEFIRSTPAGE!</p><p></BODY></p><p></HTML></p><p><%</p><p>Randomize</p><p>IfInt(2*rnd)=1ThenResponse.End</p><p>Response.Clear</p><p>%></p><p><HTML></p><p><HEAD></p><p><TITLE>THESECONDPAGE

THISISTHESECONDPAGE!

<%

Response.Write""

Response.Write"输入姓名"

Response.Write""

Response.Write""

Tempstring="LearningASP"

Response.Write"

"&Tempstring

%>

<%

IfBrowserType="MicrosoftInternetExplorer5.0"Then

Response.Redicet"newtype.asp"

Else

Response.Redirect"oldtype.asp"

EndIf

<%

name=Request.Cookie("usename")

Response.AppendToLogname

%>

<%

Who=Session.Myname

CurrentPage=Request.Servariables("SCRIPT_NAME")

Response.ApplendToLogWho&":

"&CurentPage

%>

</p><p>SessionID属性</p><p>


自动编号为:

<%=Session.SessionID%>

<%

ForEachitemInSession.Contents

Reponse.Write("
"&item&Session.Contents(item))

Next

%>

<%

SetLocal_Obj=Session("component")

Local_Obj.Method

Local_Obj.Property

%>

 

<%

SetSession("Obj1")=Session

SetSession("Obj2")=Request

SetSession("Obj3")=Response

SetSession("Obj4")=Server

SetSession("Obj5")=Application

%>

<%

Dimnew_Array()

ReDimnew_Array(15)

new_Array(0)="youarewelcome!

"

new_Array

(1)="hello,world!

"

new_Array

(2)="howareyou?

"

'将数组new_Array复制成一个Application数组new_Array

Session("new_Array")=new_Array

Response.Redirect("modify_asp")

'引导到modify.asp

%>

 

<%

'将该Session数组复制给一个临时的数组

temp_Array=Session("new_Array")

'修改临时数组元素的值

temp_Array

(1)="world,hello!

"

'输出字符串"world,hello!

"

Response.Write(temp_Array(0)&temp_Array

(1)&temp_Array

(2))

'将临时数组传回Session数组

Session("My_Array"=temp_Array)

%>

<%

Session.Abandon

Session("name")="Tommy"

Response.Write(Session("name"))

%>

<%

Session("yourname")=Response.Form("youname")

Session("yourage")=Response.Form("yourage")

Session("yoursex")=Response.Form("yoursex")

%>

<%

IfSession("yourname")<>""Then

Response.Redirect"main.asp"

Else

Response.Redirect"login.asp"

EndIf

%>

SubSession_OnStart

Session("UID")="Bill"

Session("PWD")="password"

EndSub

 

SubSession_OnStart

Homepage=

Response.RedirectHomePage

EndIf

EndSub

SubSession_OnStart

Response.AppendToLogSession.SessionID&time()

EndSub

SubSession_OnEnd

Response.AppendToLogSession.SessionID&time()

EndSub

<%

‘方法一、使用一般的变量建立文件存取组件

’建立文件存取组件

Setfs=Server.CreateObject(“Scripting.FileSystemObject”)

‘释放文件存取组件实例

Setfs=Nothing

‘方法二、使用Session变量建立文件存取组件,可供多个网页使用

‘建立文件存取组件

SetSession(“fs”)=Server.CreateObject(“Scripting.FileSystemObject”)

‘释放文件存取实例

SetSession(“fs”)=Nothing

%>

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 工学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1