469,903 Members | 1,902 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

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 5157
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
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.