I want to use this code:
public void SendFile(string uri, string filepath)
{
using (var client = new WebClient())
{
client.Headers.Add("Content-Type", "application/xml");
byte[] response = client.UploadFile(uri, "POST", filepath);
return Encoding.ASCII.GetString(response);
}
}
...but I get the dreaded "The type or namespace name 'WebClient' could not be found (are you missing a using directive or an assembly reference?)"
According to this, WebClient is available in .NET 3.5 (this is a .NET 3.5 / Windows CE project).
Is this unfindability because this is a Windows CE / Compact Framework project that Visual Studio is pretending it doesn't recognize WebClient? Is there a workaround or am I, again, doomed?