Esempio n. 1
0
        private void btnGetFilesTest_Click(object sender, EventArgs e)
        {
            IDataReader dr = Natsuhime.Data.DbHelper.ExecuteReader(
                CommandType.Text,
                "SELECT * FROM posts ORDER BY id"
                );

            int    postId;
            string postUrl = string.Empty;

            if (dr.Read())
            {
                postId  = Convert.ToInt32(dr["id"]);
                postUrl = dr["url"].ToString();
                dr.Close();
            }
            else
            {
                dr.Close();
                MessageBox.Show("No Record!");
                return;
            }

            FileListFetcher flf = new FileListFetcher();

            flf.FetchCompleted += new EventHandler <Natsuhime.Events.ReturnCompletedEventArgs>(FileList_FetchCompleted);
            flf.Cookie          = new CookieContainer();
            flf.Charset         = "big5";
            flf.Url             = postUrl;
            flf.FetchListAnsy(postId);
        }
Esempio n. 2
0
 /// <summary>
 /// 抓取主题中的文件连接
 /// </summary>
 void FetchFiles()
 {
     this.flf = new FileListFetcher();
     this.flf.FetchCompleted += new EventHandler <ReturnCompletedEventArgs>(FileList_FetchCompleted);
     this.flf.Cookie          = this.cookie;
     this.flf.Charset         = projects[0].Charset;
     this.flf.Url             = projects[0].PostList[0].Url;
     this.flf.FetchListAnsy(projects[0].PostList[0]);
 }