SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, "select fullnaem from tb_User");
            if (dr.HasRows)
            {
                while (dr.Read() == true)
                {
                       “提示”
                }
            }
            dr.Close();
            dr.Dispose();所有会员循环并且每5秒钟向一个会员发出提示信息这个应该怎么做呢@请各位指点一下!我急啊!

解决方案 »

  1.   

    你这个是web应用? 你所说的发消息是主动发送还是 用户自己读取的,web的消息大部分是自己读取的,哪怕是即时的也是 轮询方式自己提交请求再相应的,请说明应用场合。为什么要5妙? 这样是不是会显得太平凡
      

  2.   

    如果是WEB应用的话,我建议楼主采用AJAX,每5分钟用户的客户端自动的去请求一下服务器
      

  3.   

    配合 thread去实现,处理完逻辑,让thread.sleep(5*60*1000);
      

  4.   

    给你一个例子:用微软的asp.net ajax来做的
    using System.Web.Services;  [WebMethod]
            public static int Cal(int num)
            {
                return num + 1;
            }
      <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods=true>
            </asp:ScriptManager>
        <input id="Text1" type="text" value=1 onfocus="Do()" onblur="UnDo()" />
          var w;
            function Do() {
                w = window.setInterval("Begin()", 1000);
            }
            function Begin() {
                PageMethods.Cal(document.getElementById("Text1").value, suc);
            }
            function suc(value) {
                document.getElementById("Text1").value=value;
            }
            function UnDo() {
                window.clearInterval(w);
            }每隔1秒中就跟服务器端进行交互。