472,119 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

missing System.Net.WebClient

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;
Nov 16 '05 #1
2 5243
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
}

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2
Morten,

Thank you for your help, it solved my problem.

"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:opsf7gqvpaklbvpo@pbn_computer...
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
}

--
Happy Coding!
Morten Wennevik [C# MVP]

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Justin Malloy | last post: by
reply views Thread by Kumar | last post: by
2 posts views Thread by zolof | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.