Why am I getting these errors?

V

vbMark

Here's my code:


public void DownloadImage(string sImagePath)
{
WebClient myWebClient = new WebClient();
myWebClient.DownloadFile(sImagePath,"blahblah.jpg");
}

Here are the errors:

The type or namespace name 'myWebClient' could not be found (are you
missing a using directive or an assembly reference?)

The type or namespace name 'WebClient' could not be found (are you missing
a using directive or an assembly reference?)

Thanks!
 
V

vbMark

Here's my code:


public void DownloadImage(string sImagePath)
{
WebClient myWebClient = new WebClient();
myWebClient.DownloadFile(sImagePath,"blahblah.jpg");
}

Here are the errors:

The type or namespace name 'myWebClient' could not be found (are you
missing a using directive or an assembly reference?)

The type or namespace name 'WebClient' could not be found (are you
missing a using directive or an assembly reference?)

Thanks!

Never mind :)
 
C

Curt_C [MVP]

you dont have a reference to the WebClient() class.
Either namespace path it out or add the reference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top