2

I'm probably missing something here, but when I use WebClient and look for the DownloadString method (as found in a book example), I only see DownloadStringAsync.

What Import am I missing?

mraviator
  • 4,034
  • 9
  • 38
  • 51

3 Answers3

5

Are you using Silverlight? Only the Async version is available in Silverlight. Otherwise, the .NET 4 Framework and below (except 1.x) have the DownloadString() method.

http://msdn.microsoft.com/en-us/library/ms144200.aspx

Bryan
  • 2,775
  • 3
  • 28
  • 40
0

as indicated here, it looks like the DownloadString method is part of System.Net.

vlad
  • 4,748
  • 2
  • 30
  • 36
0

Well, I think you're creating a Silverlight application. In that case it is a normal thing: you will find usually only asynchronous methods in Silverlight applications; this makes your UI more responsive because operations will be executed in another thread without blocking it.

Try to create a desktop application (Console Application, WPF, etc.) and you will find the method you're looking for.

as-cii
  • 12,819
  • 4
  • 41
  • 43