加入using System.Net;了,为什么WebClient client = new WebClient();这一句还不能编译成功? 加入using System.Net;了,为什么WebClient client = new WebClient();这一句还不能编译成功?这是怎么回事呀 ? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 编译通过System.Net.WebClient client = new System.Net.WebClient(); using System;using System.Net;class Test{ static void Main() { WebClient client = new WebClient(); string str = client.DownloadString("www.baidu.com"); }} using System;using System.Net;class Test{ static void Main() { WebClient client = new WebClient(); string str = client.DownloadString("http://www.baidu.com"); }} 报告 error CS0234: The type or namespace name 'WebClient' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) System.Net 名称空间不存在?右键项目属性/添加引用/.Net Tab/选择System/确定 编译通过!! 不好意思,可能我的平台的原因。在windows 上就有右键可以选择添加参考一项。 System.Net.WebClient client = new System.Net.WebClient(); c# xml 文章 谁能告诉我这个C# 泛型集合实例为何报这个错 在winfrom 中怎样读取json 数据...高手帮忙 c#递归 tcpclient 建立的FTP连接 关于移动设备开发的一些问题!! app.config问题 关于c#对象赋值问题! 调用存储过程,一切的代码都写好了,还作了压力测试...可是..... 请问那有.net的类库下载呢? 取文件的问题 C#焦点问题
using System.Net;class Test
{
static void Main()
{
WebClient client = new WebClient();
string str = client.DownloadString("www.baidu.com");
}
}
using System.Net;class Test
{
static void Main()
{
WebClient client = new WebClient();
string str = client.DownloadString("http://www.baidu.com");
}
}