如果在应用程序中打开一个HTTP连接 System.Diagnostics.Process.Start("http://www.yahoo.com"); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我的意思是不调用浏览器,直接打开一个HTTP连接. 或者哪位能给我SOCKET方面打开网页的代码,非常感谢.(不跟浏览器发生任何关系) 用WebClient 就够了。WebClient myClient = new WebClient();Stream response = myClient.OpenRead("http://www.contoso.com/index.htm"); Stream response = myClient.OpenRead("http://www.contoso.com/index.htm");Stream 是如何创建的?这个地方报错...是不是还需要加载什么东西?能否麻烦告知,多谢! 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(); c# datatable的问题 没分了还请大家帮帮忙!谢谢! 请教:全屏游戏中的某个固定位置会出现一些汉字,有没有办法把汉字截取出来呢? 请问在CodeDom中如何表示一个属性 new{}是什么意思 在网页中读取文件 请问这种是怎么实现的? c# 调用FreeLibrary 释放dll,无法覆盖dll文件? (散分)毕业了,在穿上了五条裤衩的同时痛苦地送别同学 J#阴影未散,MS又发表新软件 Java Language Conversion Assistant Beta 1 如何在Form中动态生成几个checkbox? 如何获取DATATABLE中的某一列某一行的值`
WebClient myClient = new WebClient();
Stream response = myClient.OpenRead("http://www.contoso.com/index.htm");
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();