System.Diagnostics.Process.Start("http://www.yahoo.com");

解决方案 »

  1.   

    我的意思是不调用浏览器,直接打开一个HTTP连接.
      

  2.   

    或者哪位能给我SOCKET方面打开网页的代码,非常感谢.(不跟浏览器发生任何关系)
      

  3.   

    用WebClient 就够了。
    WebClient myClient = new WebClient();
    Stream response = myClient.OpenRead("http://www.contoso.com/index.htm");
      

  4.   

    Stream response = myClient.OpenRead("http://www.contoso.com/index.htm");Stream 是如何创建的?这个地方报错...是不是还需要加载什么东西?能否麻烦告知,多谢!
      

  5.   

    using System.Net;
    using System.IO;
    WebClient client = new WebClient();
    Stream strm = client.OpenRead("http://www.yahoo.com");
    StreamReader sr = new StreamReader(strm);

    Console.WriteLine(sr.ReadToEnd());
    strm.Close();