如何用C#获取www.sohu.com的HTML 并且只让他显示部分内容. 比如说 只让他显示上面的栏目信息. 高手请指教....

解决方案 »

  1.   

    HttpWebRequest HttpWReq = 
        (HttpWebRequest)WebRequest.Create("http://www.contoso.com");
    // Turn off connection keep-alives.
    HttpWReq.KeepAlive = false;HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();// Get the HTTP protocol version number returned by the server.
    String ver = HttpWResp.ProtocolVersion.ToString();
    HttpWResp.Close();