开发者

what is webclient & uses of webclient in .net

What is webclient & 开发者_运维百科uses of webclient?


WebClient is a class that allows you to send HTTP requests to a remote address from a .NET application. Here's an example in a console application:

class Program
{
    static void Main()
    {
        using (var client = new WebClient())
        {
            string result = client.DownloadString("http://www.google.com");
            Console.WriteLine(result);
        }
    }
}


From MSDN

Provides common methods for sending data to and receiving data from a resource identified by a URI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜