By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,312 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,312 IT Pros & Developers. It's quick & easy.

missing System.Net.WebClient

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.