protected void Button2_Click(object sender, EventArgs e) { DataTable messages = new DataTable(); messages.Columns.Add("Subject"); messages.Columns.Add("From"); messages.Columns.Add("Date"); nntp1.Server = edtServer.Text; nntp1.Open(); nntp1.SelectGroup(cbNewsgroup.SelectedValue); nntp1.GroupOverviewing += delegate(object sender1, GroupOverviewEventArgs args) { DataRow row = messages.NewRow(); row["Subject"] = args.ArticleInfo.Subject; row["From"] = args.ArticleInfo.From.FullAddress; row["Date"] = args.ArticleInfo.Date.ToString(); messages.Rows.Add(row); }; nntp1.GroupOverview(); DataGrid1.DataSource = messages; DataGrid1.DataBind(); nntp1.Close(); }
private void btnGetArticles_Click(object sender, System.EventArgs e) { btnGetArticles.Enabled = false; btnPostNew.Enabled = false; btnReply.Enabled = false; tvArticles.Enabled = false; memBody.Enabled = false; isLoading = true; try { tvArticles.Nodes.Clear(); memBody.Text = ""; nntp1.SelectGroup(cbNewsGroup.Text); nntp1.GroupOverview(); } finally { isLoading = false; btnGetArticles.Enabled = true; btnPostNew.Enabled = true; btnReply.Enabled = true; tvArticles.Enabled = true; memBody.Enabled = true; } }