例9.5这个例子(vote.asp)利用计数器组件实现简单的投票计数功能(程序名:vote.asp)。
<%
Set Counters=Server.CreateObject(“MSWC.Counters”)
Vote=Request.QueryString(“Site”)
Counters.Increment(Vote)
%>
为你喜欢的网站投票:
<Form Name=“Voting for Sites”Method=“GET”Action=“vote.asp”>
<Input Type=“Radio”Name=“Site”Value=“qvtc”>qvtc
<Input Type=“Radio”Name=“Site”Value=“itnet”>itnet.com.cn
<Input Type=“Radio”Name=“Site”Value=“bbsnet”>bbsnet.net
<Br><INPUT TYPE=“Submit”Value=“投票”>
</Form>
当前投票结果:<Br>
Cnbruce:<%=Counters.Get(“qvtc”)%><Br>
It365cn:<%=Counters.Get(“itnet”)%><Br>
Blueidea:<%=Counters.Get(“bbsnet”)%><Br>
<%
Set Counters=Server.CreateObject(“MSWC.Counters”)
Vote=Request.QueryString(“Site”)
Counters.Increment(Vote)
%>
为你喜欢的网站投票:
<Form Name=“Voting for Sites”Method=“GET”Action=“vote.asp”>
<Input Type=“Radio”Name=“Site”Value=“qvtc”>qvtc
<Input Type=“Radio”Name=“Site”Value=“itnet”>itnet.com.cn
<Input Type=“Radio”Name=“Site”Value=“bbsnet”>bbsnet.net
<Br><INPUT TYPE=“Submit”Value=“投票”>
</Form>
当前投票结果:<Br>
Cnbruce:<%=Counters.Get(“qvtc”)%><Br>
It365cn:<%=Counters.Get(“itnet”)%><Br>
Blueidea:<%=Counters.Get(“bbsnet”)%><Br>