Chapter 26. Network Communications

   

In this chapter

Using the Dns Class

Using the WebClient Class

Using the WebRequest and WebResponse Classes

Using the WebProxy Class

NTLM Authentication

SSL Communication

Posting Data

System.Net Errors

There are times when you will need to request data from other Web servers within your ASP.NET application. At first, this idea might seem strange . After all, we have been talking about using Web Services to get data from other servers. Although Web Services are extremely useful and represent the current recommended way for obtaining data from other servers, not all servers will offer Web Services to your application.

For example, there might be a page on another server that presents data or information of some sort , and you would like to retrieve this information for use in your application. If this is an older server that does not support Web Services, you might need to employ some more pedestrian data retrieval methods . Essentially, you would request the Web page in which the data resides, and then process the Web page and extract the data. This technique is commonly known as data scraping , in which you retrieve a Web page and extract data that you would like to use in your application. One important note, though, is that you must have permission before you can legally scrape data from another Web site. Before you use data from someone else's Web site, be sure that you have the necessary permissions.

The System.Net namespace provides a simple programming interface to many of the protocols found in today's networks. It includes WebRequest , WebResponse , Dns , WebProxy , and many other types of classes with which you can easily write networking applications. This enables you to develop applications that use Internet resources, and the classes encapsulate them in such a way that you don't have to worry about the specific details of doing the networking.

   


Special Edition Using ASP. NET
Special Edition Using ASP.Net
ISBN: 0789725606
EAN: 2147483647
Year: 2002
Pages: 233

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net