赛迪的博客里也有
<%
'读文件
set fos=server.CreateObject("scripting.FileSystemobject")
set fileread=fos.OpenTextFile(server.MapPath ("test.txt"),1)
w=cint(fileread.readline())
u=cint(fileread.readline())
l=cint(fileread.readline())
fileread.close()
' Response.Write w
'写文件
os1=request("os1")
if request("sub")="投票" then
set filewrite=fos.OpenTextFile(server.MapPath ("test.txt"),2)
if os1="windows" then w=w+1
if os1="Unix" then u=u+1
if os1="Linux" then l=l+1
filewrite.writeline(w)
filewrite.writeline(u)
filewrite.writeline(l)
filewrite.close
'计算:统计数量
pw=cint(w)+10
pu=cint(u)+10
pl=cint(l)+10
'统计比例
'total=u+w+l
'pw=cint(w/total*100)
'pu=cint(u/total*100)
'pl=cint(l/total*100)
end if
%>
<h2 align="center" style="FONT-SIZE: x-large; FONT-STYLE: italic; FONT-FAMILY: 隶书">操作系统调查</h2>
<hr>
<table border=0 align="center" >
<tr>
<td>Windows</td>
<td>
<IMG height=15 src="w.bmp" width="<%=pw%>" >
</td>
</tr>
<tr><td>Unix</td>
<td>
<IMG height=15 src="u.bmp" width="<%=pu%>" >
</td>
</tr>
<tr>
<td>Linux</td>
<td>
<IMG height=15 src="l.bmp" width="<%=pl%>" >
</td>
</tr>
</table>
<br><br>
<form action="vote.asp" method="post" >
<input type="radio" name="os1" value="windows" >Windows<br>
<input type="radio" name="os1" value="Unix">Unix<br>
<input type="radio" name="os1" value="Linux">Linux<br>
<input type="submit" name="sub" value="投票">
</form>