一个函数完事! try { System.Net.WebClient client = new WebClient(); byte[] webpage = client.DownloadData(url); string content = System.Text.Encoding.UTF8.GetString(webpage); website = wipeScript(content); if ((website.Length < MIN_LEN) || (website.Length > MAX_LEN)) return -1; } catch (WebException ex) { return -1; } 不过WebClient对象没有timeout属性,这点不太好了,不过也有牛人把WebClient类直接改装!但是这样也很在可能产生某种XX的隐患...