.NET Web客户端:在哪里DownloadString?客户端、NET、Web、DownloadString

2023-09-06 07:41:59 作者:じ☆ve﹎無訫

我可能失去了一些东西,但是当我使用Web客户端,并查找DownloadString方法(如在一本书的例子中),我只看到DownloadStringAsync。

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.

导入什么我错过?

推荐答案

您使用Silverlight?只有异步版本可以在Silverlight。否则,.NET框架4及以下(1.x的除外)有DownloadString()方法。

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