代码 ///summary ///获取页面源代码 summary ///paramname="url"/param ///returns/returns publicstaticstringGetPageResouceCode(stringurl) { try { WebRequestwrt=WebRequest.Create(url); WebResponsewrse=wrt.GetResponse(); StreamstrM=wrse.GetResponseStream(); StreamReaderSR=newStreamReader(strM,Encoding.UTF8); stringstrallstrm=SR.ReadToEnd(); returnstrallstrm; } catch{ return""; } }