我想写个程序下载某一个指定网站上的所有word,或是 rar文件,各位提供个思路了

解决方案 »

  1.   

    读取这个页面的html代码,然后做一些判断,将.rar或.doc等的字符串存到文本中,倒入迅雷
      

  2.   

    WebClient下载文件
    WebClient client = new WebClient(); 
    client.DownloadFile(URL,Path); 
    还有ftpwebrequest
      

  3.   

    主要是能获取所有的html
    然后你去找所有的<a href="">
    然后判断后缀
    然后下载
    你去看看蜘蛛,然后修改一下就可以了
      

  4.   

    遍历出文件 然后下载
    TextBox2.Text = "";
            string web_url = this.TextBox1.Text;
            string all_code = "";
            HttpWebRequest all_codeRequest = (HttpWebRequest)WebRequest.Create(web_url);
            WebResponse all_codeResponse = all_codeRequest.GetResponse();
            StreamReader the_Reader = new StreamReader(all_codeResponse.GetResponseStream());
            all_code = the_Reader.ReadToEnd();
            the_Reader.Close();
            ArrayList my_list = new ArrayList();
            string p = @"http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
            Regex re = new Regex(p, RegexOptions.IgnoreCase);
            MatchCollection mc = re.Matches(all_code);        for (int i = 0; i <= mc.Count - 1; i++)
            {
                bool _foo = false;
                string name = mc[i].ToString();
                foreach (string list in my_list)
                {
                    if (name == list)
                    {
                        _foo = true;
                        break;
                    }
                }//过滤            if (!_foo)
                {
                    TextBox2.Text += name + "\n";
                }
            }