现在关键是不知道里面的算法是怎么进行的
如果是ajax做的更好。java,c#都可以

解决方案 »

  1.   

    其实没什么算法啦。
    就是 投票按钮事件,没单击一次,数据库中的票数加1.
    就是一条Sql语句: 更新语句 update 表 set Count=count+1 where ItemID=投票项目ID
      

  2.   

    算法楼上说的很对,如果石用VS.NET做的双击按钮就可以查看代码段,更有很多简单空间可以使用。VS.NET支持很多语言c# c++ vb等 自己可以装一个看看,数据库建议用SQL SERVER比较简单实用。
      

  3.   

    GDI+汇出投票的的图按数值不会是吧
      

  4.   


    if exists (select 1
                from  sysobjects
               where  id = object_id('Vote')
                and   type = 'U')
       drop table Vote
    go/*==============================================================*/
    /* Table: Vote                                                  */
    /*==============================================================*/
    create table Vote (
       VoteID               int                  identity(1,1),
       UserID               int                  not null,
       WebSiteID            int                  not null,
       VoteName             nvarchar(100)        not null,
       VoteDescription      nvarchar(800)        null,
       StartDate            datetime             null,
       EndDate              datetime             null,
       Visible              bit                  null,
       Item1                nvarchar(50)         not null,
       Item2                nvarchar(50)         null,
       Item3                nvarchar(50)         null,
       Item4                nvarchar(50)         null,
       Item5                nvarchar(50)         null,
       Item6                nvarchar(50)         null,
       Item7                nvarchar(50)         null,
       Item8                nvarchar(50)         null,
       Number1              int                  not null,
       Number2              int                  null,
       Number3              int                  null,
       Number4              int                  null,
       Number5              int                  null,
       Number6              int                  null,
       Number7              int                  null,
       Number8              int                  null,
       constraint PK_VOTE primary key (VoteID)
    )
    goItem(n)是选项的文字
    Number(n)是选项的票数
      

  5.   

    http://hi.baidu.com/vjame/blog/item/6cae55e7bc37c62cb838204f.html
      

  6.   

    ASP页面部分代码<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="vote.aspx.cs" Inherits="_Default" %><!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 runat="server">
        <title>无标题页</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Label ID="Label1" runat="server" Text="你平常使用什么语言进行开发"></asp:Label><br />
            <br />
            <asp:Label ID="Label2" runat="server" Text="java"></asp:Label>
            <asp:Label ID="lblOne" Text="<%#getPercent(vote1) %>" runat="server"></asp:Label>
            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="投  票" /><br />
            <br />
            <asp:Label ID="Label3" runat="server" Text="c#"></asp:Label>
            <asp:Label ID="lblTwo" Text="<%#getPercent(vote2) %>" runat="server"></asp:Label>
            <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="投  票" /><br />
            <br />
            <asp:Label ID="Label4" runat="server" Text="c++"></asp:Label>
            <asp:Label ID="lblThree" Text="<%#getPercent(vote3) %>" runat="server"></asp:Label>
            <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="投  票" /></div>
        </form>
    </body>
    </html>C# 实现代码部分:using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page 
    {
        protected static int vote1 = 0;
        protected static int vote2 = 0;
        protected static int vote3 = 0;    protected void Page_Load(object sender, EventArgs e)
        {    }
        protected void Button1_Click(object sender, EventArgs e)
        {
            vote1 = vote1 + 1;
            //lblOne.Text = vote1.ToString();
            this.DataBind();
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            vote2 = vote2 + 1;
            //lblTwo.Text = vote2.ToString();        this.DataBind();
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            vote3 = vote3 + 1;
            //lblThree.Text = vote3.ToString();
            this.DataBind();
        }    /// <summary>
        /// 投票的百分比
        /// </summary>
        /// <param name="v_vote"></param>
        /// <returns></returns>
        protected string getPercent(int v_vote)
        {
            int total = vote1 + vote2 + vote3;
            return (Convert.ToDouble(v_vote) / Convert.ToDouble(total) * 100).ToString() + "%";
        }
    }
      

  7.   

    button事件
    {
    int i,j;
    j=从数据库中得到投票的人数+1;
    if(radioButton1.checked)
    {
        i=从数据库中提取那个数+3;
     }
    if(radioButton2.checked)
    {
        Int i=从数据库中提取那个数+3;
    }
    if(radioButton3.checked)
    {
        Int i=从数据库中提取那个数+3;
    }
    }
    i代表分数,j代表投票的人数
      

  8.   

    button事件 

    int i,j; 
    j=从数据库中得到投票的人数+1; 
    if(radioButton1.checked) 

        i=从数据库中提取那个数+3; 

    if(radioButton2.checked) 

        Int i=从数据库中提取那个数+4; 

    if(radioButton3.checked) 

        Int i=从数据库中提取那个数+5; 


    i代表分数,j代表投票的人数
    呵呵,不好意思,