C#中,如何通过http协议实现机器之间的数据交换,如JAVA中java.net.URLConnection之功能
即:URLConnection urlConn = new URLConnection("http://www.xxx.com/index.htm"),并可将
index.htm的内容给读到本地的文件中

解决方案 »

  1.   

    WebClient myClient = new WebClient();
    Stream response = myClient.OpenRead("http://www.contoso.com/index.htm");
    // The stream data is used here.
    response.Close();WebRequest req = WebRequest.Create("http://www.contoso.com/");
    WebResponse resp = req.GetResponse();
    StreamReader sr =
       new StreamReader(resp.GetResponseStream(), Encoding.ASCII);
      

  2.   

    webservice ,remoting....很多方案啊
      

  3.   

    HttpWebRequest
     socket
     webclient