回 帖 发 新 帖 刷新版面

主题:请教asp问题

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>投票结果</title>
</head>

<body bgcolor="#f2eadd">
<p align="center">☆感谢您参加本次网上投票调查☆</p>
<hr />
<table width="600" border="1" bordercolor="#00qqee" cellpadding="0" cellspacing="0" align="center">
<tr><td colspan="3" align="center">下表是目前的投票结果</td>
</tr>
<tr>
<td align="center">所选的操作系统</td><td align="center">目前得票数</td><td align="center">得票率</td>
</tr>
<%
dim selected,nowcnt,nowtime
redim percent(4)
redim name(5)
redim count(5)
application.lock
selected=cint(request.Form("os"))
set fso=server.CreateObject("scripting.filesystemobject")
filepath=server.MapPath("result.txt")
set getcnt=fso.opentextfile(filepath,1,0,0)
i=0
do while not getcnt.atendofstream
   temp=getcnt.readline
   name(i)=left(rtrim(temp),7)
   count(i)=right(rtrim(temp),7)
   if i=selected then
     j=cdbl(count(i))+1
     count(i)=right(space(8) & trim(cstr(j)),8)
    end if
i=i+1
loop 
getcnt.close
set writecnt=fso.createtextfile(filepath,-1,0)
nowcnt=0
for j=0 to 4
  nowcnt=nowcnt+cdbl(count(j))
  writecnt.writeline name(j) & count(j)
next
nowtime=now()
count(5)=nowtime
writecnt.writeline name(5) & count(5)
writecnt.close
application.UnLock()
for j= 0 to 4
  percent(j)=cdbl(count(j))/cdbl(nowcnt)
%>
<tr>
<td><% response.Write(trim(name(j))) %>
</td>
<td><%response.Write(formatnumber(count(j),0))%>
</td>
<td><%response.Write(formatpercent(percent(j)))%>
</td>
</tr>
<%next%>


</table>
</body>
</html>

它提示我第34行类型不匹配,我该怎么做,头好晕啊!我觉得没错啊

回复列表 (共2个回复)

沙发

index.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我制作的投票系统</title>
<style type="text/css">
<!--
td span{
font-size:24px;
font-family:Arial, Helvetica, sans-serif;
}
.span1{
font-size:14px;
}
.jz{
display:block;
margin:0px auto;

-->
</style>
</head>
<script language="vbscript">
sub check()
dim flag
flag=false
for i=0 to 4
if frm1.os.item(i).checked then
flag=true
end if
next
if flag=false then
msgbox "请您选择一个项目,提示"
frm1.action="index.asp"
exit sub
end if
end sub
</script>
<body>
<table border="1" bordercolor="#0066FF" cellpadding="0" cellspacing="0" align="center">
<tr><td width="600" align="center"><span>意见调查表</span></td>
</tr>
<tr><td height="300" valign="top"><p class="span1"><br />请选择您现在最想使用的操作系统:</p>
<br /><br />
<form action="submit.asp" method="post" name="frm1">
  <p>
    <label>
      <input type="radio" name="os" value="1" id="RG_0" />
      Unix</label>
    <br />
    <label>
      <input type="radio" name="os" value="2" id="RG_1" />
      Linux</label>
    <br />
     <label>
      <input type="radio" name="os" value="3" id="RG_2" />
      winxp</label>
    <br />
     <label>
      <input type="radio" name="os" value="4" id="RG_3" />
      win2000</label>
    <br />
    <label>
      <input type="radio" name="os" value="5" id="RG_4" />
      其他操作系统</label>
  </p>
  <hr  color="#FF0000"/>
  <input type="submit" name="button" id="button" value="我要投票"  onclick="check()"  class="jz"/>
 <p align="center"><a href="result.asp">查看投票结果</a></p>
</form>
</td>
</tr>
 

</table>
</body>
</html>

板凳

第34行是哪行啊

我来回复

您尚未登录,请登录后再回复。点此登录或注册