A Guided Garden Stroll through the .NET Framework Class Library

Namespace: SYSTEM.NET

● I am the Net Namespace and I am used for making it easy for your applications to communicate over most networks, including the Internet.

The easiest of my classes to work with is the WebClient class. It uses the HTTP POST method for sending data to a web server. By simply creating an instance of WebClient and calling its UploadData method, then supplying a URL and a byte array, you’ve just uploaded data to a web site. The same simplicity exists for uploading a file, using the UploadFile method.

To get data from a web site, is just as simple. Call the WebClient.DownloadData method and provide it a URL and it returns a byte array of the information retrieved.

I can also provide IO streams to the Internet as well, so that by calling, for example, WebClient.OpenRead and providing it a URL, it will return a IO.Stream from which you can use a IO.StreamReader to read from. Likewise, but in the other direction for the WebClient.OpenWrite method call.

Pretty simple, huh?

If you want to use the standard internet Request/Response scenario, you can use my WebRequest.Create method, passing it a URL, then call WebRequest.GetResponse call followed by a call to WebRequest.GetResponseStream to return a stream object to read the response from.

Using my HttpWebResponse class, you can examine the various header HTTP status codes returned and have your code behave appropriately.

In addition, I also work at the Sockets level where you can work with individual packets.

I also have TcpClient and TcpListner classes the communicate specifically using the TCP protocol. And I have a DNS class to help resolve server names to IP addresses.

www.Orbonyx.com