c/s 定时操作
              private System.Timers.Timer time;

              time = new System.Timers.Timer(1000 * 10);
            time.Enabled = true;
            time.Elapsed += this.TimeOut;
            time.Start();

 
        private void TimeOut(object sender, EventArgs e)
        {
            try
            {
                string ids = "";
                string sql = "";
                string errorPath = "E:\\Item_eidt.log";
                if (!File.Exists(errorPath))
                {
                    FileStream create = File.Create(errorPath);
                    create.Close();
                }
                else
                {
                    FileStream fs = new FileStream(errorPath, FileMode.Open, FileAccess.Read);
                    StreamReader sr = new StreamReader(fs);
                    ids = sr.ReadToEnd().Replace(" ", "");
                    //while (sr.ReadLine())
                    //{
                    //    if (ids == "")
                    //    {
                    //        ids = sr.ReadLine().Trim().Replace(" ", "");
                    //    }
                    //    else
                    //    {
                    //        ids += "|" + sr.ReadLine().Trim().Replace(" ", "");
                    //    }
                    //}
                   
                    sr.Close();
                    fs.Close();
                    // StreamWriter sw = new StreamWriter(fs);
                    // sw.WriteLine("Exception: " + ex.Message + " --" + DateTime.Now.ToString());
                    // sw.Flush();
                    // sw.Close();
                }
                if (ids != "")
                {
                    //ids = ids.Trim().Replace(" ", "").Replace("||", "|").Replace("||", "|").Replace("|", ",");
                    sql = "select * from ItemInfo_Edit where i_e_nowstate=1 and addtime < getdate()  and id not in (" + ids + ")";
                }
                else
                {
                    sql = "select * from ItemInfo_Edit where i_e_nowstate=1 and addtime < getdate()";               
                }
                DataTable dt = Cls_Common.ExecQuerySql(sql);
                if (dt.Rows.Count > 0)
                {
                    sql = "有 " + dt.Rows .Count .ToString ()+ " 条修改信息等待处理。";
                    ids = "";
                    FileStream fw = new FileStream(errorPath, FileMode.Append, FileAccess.Write);
                    StreamWriter sw = new StreamWriter(fw);
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (ids == "")
                            ids = dt.Rows[i]["id"].ToString();
                        else
                            ids +="," + dt.Rows[i]["id"].ToString();
                        sql += " 【 " + dt.Rows[i]["i_e_title"].ToString() + " 】";
                    }
                    sw.Write(ids);
                    sw.Flush();
                    sw.Close();
                    fw.Close();
                    MessageBox.Show(sql);
                }
                
            }
            catch (Exception ex)
            {
            }
        }