怎么定是读时网页,比如每隔三分钟读取http://www.zzz.cn/a.html,把读到的数据显示在窗体中.谢谢,我是新手!

解决方案 »

  1.   


    哈哈,你咋知道楼主的应用环境是web?万一他的应用环境是桌面的WinForm呢?
      

  2.   

    Timer定时刷新可以先抓取入库,然后从库里再获取
      

  3.   

      private void timer1_Tick(object sender, EventArgs e)
            {            timer1.Interval = 60000;
                timer1.Enabled = true;
                SqlConnection sqlconn = new SqlConnection("user id=sa;" + "password=sa;server=.;" + "database=国内旅游管理;" + "connection timeout=30");
                SqlCommand select = new SqlCommand("SELECT * from 游客", sqlconn);
                sqlconn.Open();
                SqlDataReader reader = select.ExecuteReader();
                DataSet ds = new DataSet();
                DataTable dt = new DataTable("MainTable");
                ds.Tables.Add(dt);
                ds.Load(reader, LoadOption.PreserveChanges, ds.Tables[0]);
                sqlconn.Close();            foreach (DataRow dr in dt.Rows)
                {
                    dataGridView1.DataSource = ds.Tables[0];
                }
                dataGridView1.DataSource = ds.Tables[0];//绑定数据源
            }这是我用过的,用Timer控件