Why am I getting these errors?

  • Thread starter Thread starter vbMark
  • Start date Start date
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!
 
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 :-)
 
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

Back
Top