O'Reilly logo

Special Edition Using® Microsoft® ASP.NET by Richard Leinecker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the WebClient Class

The WebClient class provides common methods for sending data to and receiving data from a resource identified by a URL. Underneath the covers, the WebClient class uses the WebRequest class (which is covered in more detail later in this chapter) to provide access to Internet resources. For this reason, the WebClient class is easier to use than the WebRequest class because it encapsulates the WebRequest class at a higher level, and abstracts much of the detail out.

The WebClient class has four methods for performing data transfer. They are the OpenWrite() method, which sends a stream to the resource; the UploadData() method, which sends a byte array to the resource and returns the byte array with any response; the UploadFile() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required