missing System.Net.WebClient

  • Thread starter Thread starter xzzy
  • Start date Start date
X

xzzy

I have .net 1.1

c# . . . . .
using System.Net only lists sockets

what do I need to do to be able to do:

using System.Net.WebClient;
 
HI xzzy,

WebClient is a class. The using statements lists namespaces so you have
to stop at the last namespace.

using System.Net;
....
WebClient wc = new WebClient();

or

System.Net.WebClient wc = new System.Web.WebClient();

without the 'using'.
Well, there is a third and fourth way.

using (System.Net.WebClient wc = new System.Net.WebClient())
{
// code
}

using System.Net; // the namespace so we can write less in the code

using (WebClient wc = new WebClient()) // this using controls scope
{
// code
}
 
Back
Top