當前位置:編程學習大全網 - 源碼下載 - 投票系統的代碼是怎麽設計的

投票系統的代碼是怎麽設計的

<form action="c.asp" method="post">

<font color=#88ddff size=2>妳對本站的印象如何:</font>

<p><font color=#ff0000 size=2>很好:<input type=radio name="ying" value="good">

壹般:<input type=radio name="ying" value="yiban">

<p>差:<input type=radio name="ying" value="bad">

很差:<input type=radio name="ying" value="vbad"></font>

<p><center><input type=submit value="查看結果">

<P><input type=reset value="重新選擇">

</center></form>

<%

ming=request.form("ying")

%>

<%

if ming="" then

%>

<%

elseif ming="good" then

countfile=Server.mappath("good.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile,1,false,false)

ren1=textinstance.readall

ren1=ren1+1

set textinstance=fileinstance.createtextfile(countfile,true,false)

textinstance.writeline(ren1)

%>

很好:<%=ren1%>;

<%

countfile1=Server.mappath("yiban.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile1,1,false,false)

ren2=textinstance.readall

%>

壹般:<%=ren2%>;

<%

countfile1=Server.mappath("bad.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile1,1,false,false)

ren3=textinstance.readall

%>

<P> 差:<%=ren3%>;

<%

countfile=Server.mappath("vbad.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile,1,false,false)

ren4=textinstance.readall

%>

很差:<%=ren4%>;

<%

elseif ming="yiban" then

countfile=Server.mappath("good.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile,1,false,false)

ren1=textinstance.readall

%>

很好:<%=ren1%>;

<%

countfile1=Server.mappath("yiban.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile1,1,false,false)

ren2=textinstance.readall

ren2=ren2+1

set textinstance=fileinstance.createtextfile(countfile1,true,false)

textinstance.writeline(ren2)

%>

壹般:<%=ren2%>;

<%

countfile1=Server.mappath("bad.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile1,1,false,false)

ren3=textinstance.readall

%>

<P>差:<%=ren3%>;

<%

countfile=Server.mappath("vbad.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile,1,false,false)

ren4=textinstance.readall

%>

很差:<%=ren4%>;

<%

elseif ming="bad" then

countfile=Server.mappath("good.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile,1,false,false)

ren1=textinstance.readall

%>

很好:<%=ren1%>;

<%

countfile1=Server.mappath("yiban.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile1,1,false,false)

ren2=textinstance.readall

%>

壹般:<%=ren2%>;

<%

countfile1=Server.mappath("bad.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile1,1,false,false)

ren3=textinstance.readall

ren3=ren3+1

set textinstance=fileinstance.createtextfile(countfile1,true,false)

textinstance.writeline(ren3)

%>

<P>差:<%=ren3%>;

<%

countfile=Server.mappath("vbad.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile,1,false,false)

ren4=textinstance.readall

%>

很差:<%=ren4%>;

<%

elseif ming="vbad" then

countfile=Server.mappath("good.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile,1,false,false)

ren1=textinstance.readall

%>

很好:<%=ren1%>;

<%

countfile1=Server.mappath("yiban.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile1,1,false,false)

ren2=textinstance.readall

%>

壹般:<%=ren2%>;

<%

countfile1=Server.mappath("bad.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile1,1,false,false)

ren3=textinstance.readall

%>

<P> 差:<%=ren3%>;

<%

countfile=Server.mappath("vbad.txt")

set fileinstance=Server.CreateObject("SCRIPTING.filesystemobject")

set textinstance=fileinstance.opentextfile(countfile,1,false,false)

ren4=textinstance.readall

ren4=ren4+1

set textinstance=fileinstance.createtextfile(countfile1,true,false)

textinstance.writeline(ren4)

%>

很差:<%=ren4%>;

<%

end if

%>

  • 上一篇:有沒有大神幫我回答壹下這些問題,實在看不明白?
  • 下一篇:python shell(用的IDIE)程序編輯器中、菜單Edit→怎麽沒有Run Script選項、快捷鍵Ctrl+F5也沒有、?
  • copyright 2024編程學習大全網