开发者

what is webclient & uses of webclient in .net

开发者 https://www.devze.com 2023-01-30 01:49 出处:网络
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 applica

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

精彩评论

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