+ -
当前位置:首页 → 问答吧 → 考试题帮忙做下

考试题帮忙做下

时间:2011-06-20

来源:互联网

4、试简述SUB子程序和FUNCATION函数的区别。
5、试写出下面程序的输出结果
<html>
<body>
<%
Dim Sum,I,N
Sum=0 
N=100  
For I=1 to N 
Sum=Sum+I
Next
Response.write "1+2+3+…+" & Cstr(N) & "=" & Cstr(Sum)
%>
</body> 
</html>

四、综合题
1、设存在文件:C:\ test \text.txt,现欲在其中追加文字“我成功啦!”。试写出程序代码。
提示:set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")


set file=MyfileObject.opentxtfile(' C:\ test \text.txt ',8) file.write("我成功了") 
2、编写ASP程序,要求根据系统的时间来判断是上午、中午、下午还是晚上。假定7:00—11:00为上午,11:00—14:00为中午,14:00—18:00为下午,18:00—7:00为晚上。


3、阅读下面的程序,回答后面的问题。
<script language="vbscript" runat="server">
Sub Application_OnStart
Application.Lock
Application("user_online")=0
Application.Unlock
End Sub
Sub Session_OnStart
Application.Lock
Application("user_online")= Application("user_online")+1
Application.Unlock
end sub
Sub Session_OnEnd
Application.Lock
Application("user_online")= Application("user_online")-1
Application.Unlock
End Sub
</script>
1)写出该程序所存放的文件名称(包括后缀名);
2)说明该文件存放的位置;
3)试分析该程序的主要功能。


作者: cjf970228   发布时间: 2011-06-20

4、试简述SUB子程序和FUNCATION函数的区别:sun子函数是没有返回值的 FUNCTION函数是可以有返回值的
5、试写出下面程序的输出结果:1+2+3+......+100 = 5050
四、
1.VBScript code

set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
set MyTextFile =  MyFileObject.OpenTextFile("C\test\text.txt",8)
 MyTextFile .WriteLine("我成功了")


2.VBScript code

dim MyTime
MyTime = Hour(Time())
if MyTime >=7 and MyTime<11 then
response.write("早上")
elseif Mytime >=11 and MyTime<14 then
response.write("中午")
elseif Mytime >=14 and MyTime<18 then
response.write("下午")
else
response.write("晚上")
end if


3.后缀名 .asa
  网站根目录
  浏览页面次数

PS :这些都是基础的东西,只要你看下书就会的,何苦来这问别人呢?

作者: wuwenbin104   发布时间: 2011-06-20

第2小题题目看错了VBScript code

dim MyTime
MyTime = Hour(Time())
if MyTime >="7:00" and MyTime<"11:00" then
response.write("早上")
elseif Mytime >="11:00" and MyTime<"14:00" then
response.write("中午")
elseif Mytime >="14:00" and MyTime<"18:00" then
response.write("下午")
else
response.write("晚上")
end if




作者: wuwenbin104   发布时间: 2011-06-20