| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 566 人关注过本帖
标题:清华出的书有"错".实力者请进
只看楼主 加入收藏
惠阳知多少
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-11-14
收藏
 问题点数:0 回复次数:1 
清华出的书有"错".实力者请进

原代码,下:
<%@ page language="vb" debug="true" %>
<script runat="server">
sub test_click(sernder as object,e as eventargs)
dim strname as string
dim stryear as string
dim strday as string
dim strmonth as string
dim strdate as date
dim i as integer
dim firstdate() as date={dateserial(2000,12,22),dateserial(2000,1,20),dateserial

(2000,2,19),dateserial(2000,3,21),dateserial(2000,4,20),dateserial(2000,5,21),dateserial

(2000,6,22),dateserial(2000,7,23),dateserial(2000,8,23),dateserial(2000,9,23),dateserial

(2000,10,24),dateserial(2000,11,23)}
dim lastdate() as date={dateserial(2001,1,19),dateserial(2000,2,18),dateserial

(2000,3,20),dateserial(2000,4,19),dateserial(2000,5,20),dateserial(2000,6,21),dateserial

(2000,7,22),dateserial(2000,8,22),dateserial(2000,9,22),dateserial(2000,10,23),dateserial

(2000,11,22),dateserial(2000,12,21)}
dim xz() as string={"魔羯座","水瓶座","双鱼座","白羊座","金牛座","双子座","巨蟹座","狮子

座","处女座","天秤座","天蝎座","射手座"}
strname=thename.text
stryear=theyear.text
strmonth=themonth.text
strday=theday.text
if strname="" or stryear="" or strmonth="" or strday="" then
thelabel.text="信息不全,无法测试星座!"
else
if (not isnumeric(stryear)) or (not isnumeric(strmonth)) or (not isnumeric(strday)) then
thelabel.text="信息错误,无法测试星座!"
else
if (ctype(strmonth,integer)<=0 or ctype(strmonth,integer)>12) or (ctype(strday,integer)<=0

or ctype(strday,integer)>31) then
thelabel.text="信息错误,无法测试星座!"
else
thedate=dateserial(2000,cint(strmonth),cint(strday))[浏览器显示这句错了,请问错在哪里?]
i=0
do while i<12
if thedate>=firstdate(i)and thedate<=lastdate(i) then
exit do
end if
i=i+l
loop
thelabel.text=strname & ", 你所属的星座是: " & xz(i)
end if
end if
end if
end if
end sub
</script>
<html>
<head>
<title>星座测试</title>
</head>
<body>
<h2 align="center" style="color:blue">星座测试<br></h2><hr>
<center>
<form runat="server">
<asp:table id="tablel" width="50%" runat="server">
<asp:tablerow height="40">
<asp:tablecell align="right">你的姓名: </asp:tablecell>
<asp:tablecell>
<asp:textbox id="thename" columns=23 runat=server />
</asp:tablecell>
</asp:tablerow>
<asp:tablerow height="40">
<asp:tablecell align="right">出生日期: </asp:tablecell>
<asp:tablecell>
<asp:textbox id="theyear" columns=6 runat=server />年
<asp:textbox id="themonth" columns=3 runat=server />月
<asp:textbox id="theday" columns=3 runat=server />日
</asp:tablecell>
</asp:tablerow>
<asp:tablerow height="40" align="center">
<asp:tablecell colspan=2>
<asp:button id="test" text="星座测试" onclick="test_click"
runat=server />
</asp:tablecell>
</asp:tablerow>
</asp:table><br><br>
<asp:label id="thelabel" font-size="14pt" forecolor="red" text=""
runat=server />
</form></center>
</body>
</html>

搜索更多相关主题的帖子: 清华 dateserial dim string 实力 
2006-11-14 21:40
惠阳知多少
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-11-14
收藏
得分:0 
dim strdate as date改dim thedate as date
i=i+l 改i=i=+1
end if 删掉一个

自已搞错了
2006-11-14 22:27
快速回复:清华出的书有"错".实力者请进
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017275 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved